diff --git a/Apollo/api/application/models/Hallticket_model.php b/Apollo/api/application/models/Hallticket_model.php index e957ef17..3ccab16d 100644 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -273,7 +273,8 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId) public function getExistDetails($universityID,$courseIDS,$branchId,$Sem_Year) { - // echo $Sem_Year; + //print_r($courseIDS);die(); + //echo $Sem_Year;die(); // echo substr($Sem_Year, -1); $sem_yr_no =''; @@ -286,6 +287,25 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId) { $sem_yr_no =''; } + + + + $yearcheck_str = substr($Sem_Year, 0, 4); + $year_to_Upper= strtoupper($yearcheck_str); + + + if($year_to_Upper=='YEAR') + { + + if($sem_yr_no !='1') + {//echo 'in'; + $sem_yr_no = $sem_yr_no+1; + } + } + + // echo $sem_yr_no; + + // die(); $i=0; foreach($courseIDS as $c) @@ -335,6 +355,8 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId) $this->db->where('SMM.SemesterID',$sem_yr_no); } $result = $this->db->get(); + + // print_r($this->db->last_query());die(); return $result->result(); } } @@ -983,12 +1005,13 @@ BalFees.semyr'); } -//print_r($HallticketIDarray); +//print_r($HallticketIDarray);die(); foreach ($result_array as $key => $value) { //print_r($value); //echo $value['CourseID']; + // echo $value['semyr'];die(); foreach ($HallticketIDarray as $keyy => $vval) { $HallId = $vval; @@ -1012,13 +1035,41 @@ BalFees.semyr'); $this->db->from('T_Hallticket_Student_Details'); $this->db->where('Hallticket_ID',$HallId); $this->db->where('StudentID',$value['StudentID']); + $this->db->where('Sem_Year',$value['semyr']); $check = $this->db->get(); + $checkresult = $check->result(); + + + if(!empty($checkresult)) + { + //echo 'not empty'; + } + + else + { + //print_r($check->result()); //echo count($check); - if(count($check)>0) - { + // if(count($check)>0) + // { + + + $this->db->select('*'); + $this->db->from('T_Batch_Schedule_Master'); + $this->db->where('CourseID',$value['CourseID']); + $this->db->where('SEM_Year',$value['semyr']); + $schcheck = $this->db->get(); + + $sch_checkresult = $schcheck->result(); + + if(!empty($sch_checkresult)) + { + + + + $tempArray = array('Hallticket_ID'=>$HallId,'StudentID'=>$value['StudentID'],'EnrollmentID'=>$value['EnrollmentID'],'Sem_Year'=>$value['semyr']); @@ -1029,6 +1080,24 @@ BalFees.semyr'); $this->db->trans_complete(); $semid=substr($value['semyr'], -1); + + //echo $value['semyr']; + + + + $yearcheck_str = substr($value['semyr'], 0, 4); + $year_to_Upper= strtoupper($yearcheck_str); + + + if($year_to_Upper=='YEAR') + { + + if($semid !='1') + {//echo 'in'; + $semid = $semid+1; + } + } + //echo $semid; @@ -1045,6 +1114,8 @@ BalFees.semyr'); $res= $res->result(); + //print_r($this->db->last_query()); + foreach ($res as $keyres => $valueres) { @@ -1056,7 +1127,10 @@ BalFees.semyr'); } - } + + } + + } } }