From 64017631d69a25999506d5a0af4fa841f4195dba Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 20 Aug 2018 12:10:16 +0530 Subject: [PATCH] dashboard changes --- .../application/models/Dashboard_model.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Apollo/api/application/models/Dashboard_model.php b/Apollo/api/application/models/Dashboard_model.php index bd127be4..0c4b2b77 100755 --- a/Apollo/api/application/models/Dashboard_model.php +++ b/Apollo/api/application/models/Dashboard_model.php @@ -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; + + + } } \ No newline at end of file