PROD SMS SEND ISSUE FIXED
This commit is contained in:
parent
c6579d6b2c
commit
72df729da5
@ -95,8 +95,17 @@ class StatusUpdation_model extends CI_Model {
|
|||||||
|
|
||||||
// update certificate stauts
|
// update certificate stauts
|
||||||
public function update_certificateStatus($arr) {
|
public function update_certificateStatus($arr) {
|
||||||
|
|
||||||
|
|
||||||
$this->db->insert_batch(CERTIFICATION_STATUS, $arr);
|
$this->db->insert_batch(CERTIFICATION_STATUS, $arr);
|
||||||
if ($this->db->affected_rows() >= 1) {
|
if ($this->db->affected_rows() >= 1) {
|
||||||
|
//If condition for Check ANSWERBOOKLET_STATUS, If it is null or 'Issued to Student' for do not send sms.
|
||||||
|
|
||||||
|
$answerBookletStatus = $this->getAnswerBookletStatus($arr[0]['StudentID'],$arr[0]['CourseID'],$arr[0]['BranchCode'],$arr[0]['Sem']);
|
||||||
|
// echo "PARENT -- $answerBookletStatus";
|
||||||
|
if($answerBookletStatus == 0 )
|
||||||
|
{
|
||||||
|
//echo "SEND SMS";
|
||||||
if ($this->get_ListCode_status($arr[0]['ListCode'])) {
|
if ($this->get_ListCode_status($arr[0]['ListCode'])) {
|
||||||
$dateToMsg = $arr[0]['CDate'];
|
$dateToMsg = $arr[0]['CDate'];
|
||||||
$studentName = $this->getStudentName($arr[0]['StudentID']);
|
$studentName = $this->getStudentName($arr[0]['StudentID']);
|
||||||
@ -123,6 +132,9 @@ class StatusUpdation_model extends CI_Model {
|
|||||||
// $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg.";
|
// $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg.";
|
||||||
// $this->smssend($arr, $mesg);
|
// $this->smssend($arr, $mesg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//else {echo "DO NOT SEND SMS";}
|
||||||
|
|
||||||
$result['addStatus'] = true;
|
$result['addStatus'] = true;
|
||||||
$result['message'] = "Successfully Mark Card Status Updated";
|
$result['message'] = "Successfully Mark Card Status Updated";
|
||||||
} else {
|
} else {
|
||||||
@ -792,4 +804,34 @@ class StatusUpdation_model extends CI_Model {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Get AnswerBooklet Status based on StudentID,CourseID,BranchCode,Sem
|
||||||
|
function getAnswerBookletStatus($StudentID,$CourseID,$BranchCode,$Sem)
|
||||||
|
{
|
||||||
|
|
||||||
|
// echo "MODEL - $StudentID,$CourseID,$BranchCode,$Sem";
|
||||||
|
$this->db->select("T_AnswerBookletStatus.ListCode,T_PickListDetails.ListName");
|
||||||
|
$this->db->from("T_AnswerBookletStatus");
|
||||||
|
$this->db->join("T_PickListDetails","T_AnswerBookletStatus.BranchCode = T_PickListDetails.BranchCode
|
||||||
|
AND T_AnswerBookletStatus.ListCode = T_PickListDetails.ListCode");
|
||||||
|
$this->db->where("T_AnswerBookletStatus.BranchCode",$BranchCode);
|
||||||
|
$this->db->where("T_AnswerBookletStatus.StudentID",$StudentID);
|
||||||
|
$this->db->where("T_AnswerBookletStatus.CourseID",$CourseID);
|
||||||
|
$this->db->where("T_AnswerBookletStatus.Sem",$Sem);
|
||||||
|
$res = $this->db->get();
|
||||||
|
// print_r($res->result());
|
||||||
|
$isIssueToStudentExist = 0;
|
||||||
|
foreach($res->result() as $status)
|
||||||
|
{
|
||||||
|
$isExist = strcasecmp(trim($status->ListName),'ISSUED TO STUDENT');
|
||||||
|
if( $isExist == 0)
|
||||||
|
{
|
||||||
|
$isIssueToStudentExist = $isIssueToStudentExist + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $isIssueToStudentExist;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user