dashboard changes

This commit is contained in:
gandhimathi 2018-08-17 17:55:44 +05:30
parent 1aa7d58683
commit 5f81769c1e

View File

@ -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;
}