course details changes done

This commit is contained in:
gandhimathi 2018-01-19 19:46:47 +05:30
parent bb4bc196dd
commit 5be527a343

View File

@ -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");