diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php index c7abf64c..49a074a0 100755 --- a/Apollo/api/application/models/Studentview_model.php +++ b/Apollo/api/application/models/Studentview_model.php @@ -613,48 +613,49 @@ class Studentview_model extends CI_Model - $this->db->select('max(t1.CreatedOn) as maxdate'); - $this->db->from('T_ApplicationFormStatus as t1'); - $this->db->join('T_Registration_Details as t2', 't2.ID = t1.Registration_Details_ID'); - $this->db->where('t2.StudentID',$studentid); - $this->db->where('t2.CourseID', $courseid); + // $subquery = 'select max(ID) from T_ApplicationFormStatus group by Registration_Details_ID'; - $dateres=$this->db->get(); - - $dateval = $dateres->result(); - - $madate =''; - - foreach($dateval as $va) - { - $madate = $va->maxdate; - } - - // echo $madate; - // die(); - - - $this->db->select('t1.ID, t2.BatchCode, t2.FeeType as SemID, CFD.Sem_Year as Sem_Year, t2.RegistrationMode, t2.RegistrationType, t1.AppFormDate as StatusUpdateDate,t3.ListName ,t1.Comments'); - $this->db->from('T_ApplicationFormStatus as t1'); - $this->db->join('T_Registration_Details as t2', 't2.ID = t1.Registration_Details_ID'); - $this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = t2.FeeType'); - $this->db->join('' . PICK_LIST_DETAILS . ' as t3', 't3.ListCode = t1.ListCode', 'LEFT'); + // $this->db->select('t1.ID, t2.BatchCode, t2.FeeType as SemID, CFD.Sem_Year as Sem_Year, t2.RegistrationMode, t2.RegistrationType, t1.AppFormDate as StatusUpdateDate,t3.ListName ,t1.Comments'); + // $this->db->from('T_ApplicationFormStatus as t1'); + // $this->db->join('T_Registration_Details as t2', 't2.ID = t1.Registration_Details_ID'); + // $this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = t2.FeeType'); + // $this->db->join('' . PICK_LIST_DETAILS . ' as t3', 't3.ListCode = t1.ListCode', 'LEFT'); - $this->db->where('t2.StudentID', $studentid); - $this->db->where('t2.CourseID', $courseid); - $this->db->where('t1.CreatedOn',$madate); - $fromTypes = $this->db->get(); - $formTypeDetails = $fromTypes->result(); - if($formTypeDetails) - { - return $fromTypes->result(); - } - else - { - // print_r($formTypeDetails);exit(); + // $this->db->where('t2.StudentID', $studentid); + // $this->db->where('t2.CourseID', $courseid); + // $this->db->where('t1.ID ',$subquery); + + // $fromTypes = $this->db->get(); + // $formTypeDetails = $fromTypes->result(); + // if($formTypeDetails) + // { + // return $fromTypes->result(); + // } + // else + // { + // return false; + + // } + + + + $subquery='SELECT t1.ID, t2.BatchCode, t2.FeeType as SemID, CFD.Sem_Year as Sem_Year,t2.RegistrationMode,t2.RegistrationType,t1.AppFormDate as StatusUpdateDate, t3.ListName,t1.Comments FROM T_ApplicationFormStatus as t1 JOIN T_Registration_Details as t2 ON t2.ID = t1.Registration_Details_ID JOIN T_Course_Fees_Details as CFD ON CFD.ID = t2.FeeType LEFT JOIN T_PickListDetails as t3 ON t3.ListCode = t1.ListCode WHERE t2.StudentID =? AND t2.CourseID = ? and t1.ID in (select max(ID) from T_ApplicationFormStatus group by Registration_Details_ID)'; + + $query = $this->db->query($subquery,array($studentid,$courseid)); + + $fromTypes = $query->result(); + + if(count($query)>0) + { + return $fromTypes; + } + + else + { return false; - - } + } + + } } \ No newline at end of file diff --git a/Apollo/assets/views/student/studentDetailsModal.html b/Apollo/assets/views/student/studentDetailsModal.html index 99781e41..e1344087 100755 --- a/Apollo/assets/views/student/studentDetailsModal.html +++ b/Apollo/assets/views/student/studentDetailsModal.html @@ -304,7 +304,7 @@ - +
@@ -330,7 +330,7 @@ - +