dashboard changes

This commit is contained in:
gandhimathi 2018-08-20 12:10:16 +05:30
parent d7f52f08e2
commit 64017631d6

View File

@ -97,8 +97,10 @@ class Dashboard_model extends CI_Model
$fetchDetails['StudentCounts']=0;
}
$getArray[]=$fetchDetails;
$getFeesArray[]= $this->getUniversityFeesPending($rows->UniversityName,$rows->UniversityID,$details['localBranchID']);
}
$resultDetails['details']=$getArray;
$resultDetails['universityFeesDetails']=$getFeesArray;
}
else{
$resultDetails['resultStatus']=false;
@ -106,6 +108,51 @@ class Dashboard_model extends CI_Model
}
return $resultDetails;
}
/*
* get university pending fees details
* created by kms
* */
public function getUniversityFeesPending($universityName=null,$universityID=null,$branchCode=null){
$feesDetails=array();
$feesDetails['UniversityID']=$universityID;
$feesDetails['UniversityName']=$universityName;
$this->db->select("SUM(SFS.CourseFees) as PayableFees");
$this->db->from( STUDENTS_FEES_STATUS . ' as SFS');
$this->db->join( COURSE . ' as CU', 'CU.CourseID = SFS.CourseID');
$this->db->where('CU.UniversityID',$universityID);
$this->db->where('CU.BranchCode',$branchCode);
$this->db->order_by('CU.CourseID','DESC');
$getUnivFeesDetails = $this->db->get();
if($getUnivFeesDetails->result()){
foreach ($getUnivFeesDetails->result() as $payableRow){
$feesDetails['PayableFees']=$payableRow->PayableFees;
}
}
else{
$feesDetails['PayableFees']=0;
}
$this->db->select("SUM(SFP.BillAmount) as PaidFees");
$this->db->from( STUDENTS_FEES_PAID . ' as SFP');
$this->db->join( STUDENTS_FEES_STATUS . ' as SFS', 'SFS.FeesID = SFP.FeesId');
$this->db->join( COURSE . ' as CU', 'CU.CourseID = SFS.CourseID');
$this->db->where('CU.UniversityID',$universityID);
$this->db->where('CU.BranchCode',$branchCode);
$this->db->order_by('CU.CourseID','DESC');
$getUnivPaidFeesDetails = $this->db->get();
if($getUnivPaidFeesDetails->result()){
foreach ($getUnivPaidFeesDetails->result() as $paidRow){
$feesDetails['PaidFees']=$paidRow->PaidFees;
}
}
else{
$feesDetails['PaidFees']=0;
}
return $feesDetails;
}
}