diff --git a/Apollo/api/application/models/Dashboard_model.php b/Apollo/api/application/models/Dashboard_model.php index 55fc64dd..bd127be4 100755 --- a/Apollo/api/application/models/Dashboard_model.php +++ b/Apollo/api/application/models/Dashboard_model.php @@ -74,7 +74,37 @@ class Dashboard_model extends CI_Model * created by kms * */ public function get_univ_registered_student($details){ - + $this->db->distinct(); + $this->db->select('UniversityID,UniversityName'); + $this->db->from(UNIVERSITY); + $this->db->order_by('ID','DESC'); + $this->db->where('BranchCode',$details['localBranchID']); + $getUnivDetails = $this->db->get(); + if($getUnivDetails->result()){ + $resultDetails['resultStatus']=true; + foreach ($getUnivDetails->result() as $rows){ + $fetchDetails['UniversityID']=$rows->UniversityID; + $fetchDetails['UniversityName']=$rows->UniversityName; + $this->db->select('StudentID'); + $this->db->from(STUDENTCOURSE); + $this->db->where('BranchID',$details['localBranchID']); + $this->db->where('UniversityID',$rows->UniversityID); + $getRegisterDetails = $this->db->get(); + if($getRegisterDetails->num_rows()>0){ + $fetchDetails['StudentCounts']=$getRegisterDetails->num_rows(); + } + else{ + $fetchDetails['StudentCounts']=0; + } + $getArray[]=$fetchDetails; + } + $resultDetails['details']=$getArray; + } + else{ + $resultDetails['resultStatus']=false; + $resultDetails['Message']="No records found!"; + } + return $resultDetails; }