From 5be527a343f4f7c33afe025a1e223b90b3340ec3 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 19 Jan 2018 19:46:47 +0530 Subject: [PATCH] course details changes done --- Apollo/api/application/models/Fees_status_model.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 6bd23ca1..ea85d91c 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -700,7 +700,7 @@ class Fees_status_model extends CI_Model // check student fees paid details for get default course fees - $this->db->select('ifnull(SUM((SFS.CourseFees)),0) as CourseFees'); + $this->db->select('ifnull(SUM((SFS.CourseFees)),0) as CourseFees,ifnull(SUM((SFS.STFOrWR)),0) as STFOrWR,ifnull(SUM((SFS.Others)),0) as Others,ifnull(SUM((SFS.Waiver)),0) as Waiver'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType'); $this->db->where('SFS.CourseID',$student['CourseID']); @@ -714,7 +714,7 @@ class Fees_status_model extends CI_Model $this->db->where('SFS.StudentID',$student['StudentID']); $paidAmount = $this->db->get()->result(); - if($feesAmount[0]->CourseFees <= $paidAmount[0]->PaidAmount){ + if($feesAmount[0]->CourseFees+$feesAmount[0]->STFOrWR+$feesAmount[0]->Others-$feesAmount[0]->Waiver <= $paidAmount[0]->PaidAmount AND $feesAmount[0]->CourseFees !='0'){ // get default course fees $this->db->select('CourseID,CourseName,PC,TC,DC,MC,OtherFees'); $this->db->where('CourseID',$student['CourseID']); @@ -952,6 +952,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = FIN.FeesID','left'); $this->db->where('FIN.DueDate',$tomorrowDATE); $getStudentDetails = $this->db->get(); + if ($getStudentDetails->result()){ foreach ($getStudentDetails->result() as $row){ $this->db->select('ifnull(SUM((SFP.BillAmount)),0) as BillAmount'); @@ -960,9 +961,10 @@ class Fees_status_model extends CI_Model $this->db->where('SFS.CourseID',$row->CourseID); $this->db->where('SFS.StudentID',$row->StudentID); $getStudentPaiDetails = $this->db->get()->result(); - if($row->Amount < $getStudentPaiDetails[0]->BillAmount){ - $this->smssend($row->StudentID,$row->DueDate); - } + + if($row->Amount > $getStudentPaiDetails[0]->BillAmount){ + $this->smssend($row->StudentID,$row->DueDate); + } } } @@ -1009,7 +1011,6 @@ class Fees_status_model extends CI_Model // $mobile = "91$mobile"; $message = urlencode($msg); - $ch=curl_init(); curl_setopt($ch,CURLOPT_URL,"https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=xegCdYUIMf3&MobileNo=".$mobile."&SenderID=APOLLO&Message=".$message."&ServiceName=TEMPLATE_BASED");