diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index a540f673..96895764 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -108,9 +108,28 @@ class StatusUpdation_model extends CI_Model { //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']); - //print_r($answerBookletStatus);die(); + //print_r($answerBookletStatus); + +// echo $answerBookletStatus['ListName']; +// die(); //echo "COURSE ====$arr[0]['CourseID']"; // echo "PARENT -- $answerBookletStatus"; + +$getlastansbookstatus = $this->GetLastAns_status($arr[0]['StudentID'],$arr[0]['Sem'],$arr[0]['CourseID']); + +$latestappstatus=''; + if(!empty($getlastansbookstatus)) + { + + foreach($getlastansbookstatus as $get) + { + $latestappstatus= $get->ListCode; + } + } + + +// echo $latestappstatus; +// die(); if($answerBookletStatus['isIssueToStudentExist'] == 0 && $answerBookletStatus['statusCount'] != 0) { //echo "SEND SMS"; @@ -119,8 +138,11 @@ class StatusUpdation_model extends CI_Model { $studentName = $this->getStudentName($arr[0]['StudentID']); $CmntToMsg = $arr[0]['Comments']; $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); + + + // $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); - if( $statuToMsg == 'received' || $statuToMsg == 'Received' || $statuToMsg == 'RECEIVED'){ + if( ($statuToMsg == 'received' || $statuToMsg == 'Received' || $statuToMsg == 'RECEIVED') && $latestappstatus == 'S057'){ $cerNamtToMsg = 'Mark Card'; $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); $getSemYearANDType = "$getSemYearMsg $cerNamtToMsg"; @@ -128,6 +150,10 @@ class StatusUpdation_model extends CI_Model { $mesg = "$cerNamtToMsg Received - Dear $studentName, Your $getSemYearANDType had been received, Please come and collect it."; $this->smssend($arr, $mesg); $this->mailsend($arr, $mesg, $cerNamtToMsg); + + + // echo $statuToMsg; + // die(); } else if($statuToMsg == 'issued' || $statuToMsg == 'Issued' || $statuToMsg == 'ISSUED') { $cerNamtToMsg = 'Mark Card'; $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); @@ -891,6 +917,9 @@ class StatusUpdation_model extends CI_Model { //echo "FINAL RES SEND TO PARENT"; // print_r($data); // die(); + + // print_r($this->db->last_query()); + // die(); return $data; } @@ -972,4 +1001,26 @@ class StatusUpdation_model extends CI_Model { } return $resultArr; } -} \ No newline at end of file + + + + + public function GetLastAns_status($StudentID,$Sem,$CourseID) + { + $subQuery = 'select T_AnswerBookletStatus.ListCode,ListName from T_AnswerBookletStatus + join T_PickListDetails on T_AnswerBookletStatus.ListCode=T_PickListDetails.ListCode + where T_AnswerBookletStatus.StudentID=? and + T_AnswerBookletStatus.CreatedOn=(select max(CreatedOn) from T_AnswerBookletStatus + where StudentID= ?) and Sem=? and CourseID=?'; + + $query = $this->db->query($subQuery,array($StudentID,$StudentID,$Sem,$CourseID)); + + $expense = $query->result(); + + return $expense; + + } +} + + + diff --git a/Apollo/assets/js/controllers/markcardStatusCtrl.js b/Apollo/assets/js/controllers/markcardStatusCtrl.js index 8fb63ce8..531e9989 100644 --- a/Apollo/assets/js/controllers/markcardStatusCtrl.js +++ b/Apollo/assets/js/controllers/markcardStatusCtrl.js @@ -242,7 +242,9 @@ app.controller('markcardStatusCtrl', ["$scope", "toaster", "$filter", "ngTablePa // Select one row in a table once $scope.setOneSelect = function (value) { - // alert(); + // alert(); + + // return false; angular.forEach($scope.searchResultDetails, function (item) { item.Selected = false; }); @@ -366,6 +368,9 @@ app.controller('markcardStatusCtrl', ["$scope", "toaster", "$filter", "ngTablePa // Update the status For Certification $scope.statusUpdate = { submit: function (form, myStatusModel, localBranchDetails) { + + // alert('in'); + // return false; var firstError = null; if (form.$invalid) { var field = null, firstError = null; diff --git a/Apollo/assets/views/student/student_details.html b/Apollo/assets/views/student/student_details.html index 7001a8de..269b8850 100755 --- a/Apollo/assets/views/student/student_details.html +++ b/Apollo/assets/views/student/student_details.html @@ -279,7 +279,7 @@ - +
diff --git a/Apollo/assets/views/student/student_details_SuperAdmin.html b/Apollo/assets/views/student/student_details_SuperAdmin.html index 465698ce..b9abaaf3 100755 --- a/Apollo/assets/views/student/student_details_SuperAdmin.html +++ b/Apollo/assets/views/student/student_details_SuperAdmin.html @@ -312,7 +312,7 @@ - +