From 2a3a4b0e6a9cad38d9d9fd8ec748dc03a6996ab1 Mon Sep 17 00:00:00 2001 From: resicovenba Date: Fri, 19 Jan 2018 19:31:52 +0530 Subject: [PATCH 1/2] bugs fixed, bulk sms pages added: kdk --- Apollo/.htaccess | 0 .../controllers/Broadcast_Controller.php | 112 ++++++++ .../application/models/Broadcast_model.php | 164 ++++++++++++ .../models/StatusUpdation_model.php | 59 +++- Apollo/assets/i18n/en.json | 3 + .../js/controllers/answerBookletStatusCtrl.js | 6 +- .../js/controllers/applicationStatusCtrl.js | 6 +- .../js/controllers/certificationStatusCtrl.js | 6 +- Apollo/assets/js/controllers/daybookCtrl.js | 15 ++ .../js/controllers/sendSMSsuperadminCtrl.js | 253 +++++++++++++++--- Apollo/assets/js/controllers/studentCtrl.js | 16 +- .../js/controllers/studyMaterialStatusCtrl.js | 6 +- Apollo/assets/views/daybook/daybook.html | 6 +- .../views/sendSMS/sendSMSsuperadmin.html | 227 +++++++++++++++- .../status-update/answer_booklet_status.html | 8 +- .../status-update/application_status.html | 8 +- .../status-update/certification_status.html | 8 +- .../status-update/study_material_status.html | 8 +- .../views/student/editStudentDetails.html | 2 +- .../assets/views/student/student_details.html | 4 +- .../student/student_details_SuperAdmin.html | 4 +- Apollo/index.html | 2 +- 22 files changed, 838 insertions(+), 85 deletions(-) create mode 100644 Apollo/.htaccess create mode 100644 Apollo/api/application/controllers/Broadcast_Controller.php create mode 100644 Apollo/api/application/models/Broadcast_model.php diff --git a/Apollo/.htaccess b/Apollo/.htaccess new file mode 100644 index 00000000..e69de29b diff --git a/Apollo/api/application/controllers/Broadcast_Controller.php b/Apollo/api/application/controllers/Broadcast_Controller.php new file mode 100644 index 00000000..8ba3a8f0 --- /dev/null +++ b/Apollo/api/application/controllers/Broadcast_Controller.php @@ -0,0 +1,112 @@ +methods['getUniversity_post']['limit'] = 100; + $this->methods['chkUnivIdExistDetail_post']['limit'] = 100; + // load the broadcast model + $this->load->model('Broadcast_model', 'broadcast_model'); + } + + // get University, Course, Branch Detailss + public function getUniveCourseBatch_post() { + $reqData = $this->post('data'); + $loginUserId = $reqData['localUserID']; + $loginUserBranchId = $reqData['localBranchID']; + $loginUserType = $reqData['localType']; + $getUniversityListDetails = $this->broadcast_model->get_university_course_batch();// Check if the employee exist + if ($getUniversityListDetails) + { + $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No list were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } + + // ger Result fot searched keyword details + public function getStuListForBrodcast_post() { + $reqSearchData = $this->post('data'); + $reqData = $this->post('requestDetails'); + // print_r($reqSearchData);exit(); + + $getSearchDetails = $this->broadcast_model->get_search_result($reqSearchData, $reqData);// Check if the employee exist + if ($getSearchDetails) + { + $getSearchDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getSearchDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No list were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } + + public function sendSMSStudentApi_post() { + $reqData = $this->post('data'); + $reqDetails = $this->post('requestDetails'); + $msg = $this->post('msg'); + $time = date('Y-m-d H:i:s'); + $dateTime = $time; + $count = count($reqData); + for($i=0; $i < $count; $i++) { + $data[] = array( + 'StudentID' => $reqData[$i]['StudentID'] + ); + } + + $sendMsgDetails = $this->broadcast_model->send_msg_students($data, $msg);// Check if the employee exist + if ($sendMsgDetails) + { + $sendMsgDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($sendMsgDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No list were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } +} diff --git a/Apollo/api/application/models/Broadcast_model.php b/Apollo/api/application/models/Broadcast_model.php new file mode 100644 index 00000000..915bfa20 --- /dev/null +++ b/Apollo/api/application/models/Broadcast_model.php @@ -0,0 +1,164 @@ +db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + + return $results; + } + + // get list of universities, course, batch + public function get_university_course_batch() { + $this->db->select('t1.UniversityID, t1.UniversityName'); + $this->db->order_by('CreatedOn', 'DESC'); + $this->db->from(''.UNIVERSITY. ' as t1'); + $this->db->where('IsActive', 1); + // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); + $univDetails = $this->db->get(); + $universityDetails = $univDetails->result(); + $endResult = []; + foreach($universityDetails as $clip){ + // University Details + $resultArr['UniversityID'] = $clip->UniversityID; + $resultArr['UniversityName'] = $clip->UniversityName; + + // Course Details + $this->db->select('t2.CourseID, t2.CourseName'); + $this->db->from(''.COURSE. ' as t2'); + $this->db->where('t2.UniversityID', $clip->UniversityID); + $this->db->where('t2.IsActive', 1); + $courDetails = $this->db->get(); + $courseDetails = $courDetails->result(); + $resultArr['Course'] =$courseDetails; + + // Batch Details + $this->db->select('t3.BatchName, t3.BatchCode'); + $this->db->from(''.BATCH. ' as t3'); + $this->db->where('t3.UniversityID', $clip->UniversityID); + $this->db->where('t3.IsActive', 1); + $batDetails = $this->db->get(); + $batchDetails = $batDetails->result(); + $resultArr['Batch'] =$batchDetails; + array_push($endResult, $resultArr); + } + $results['univList'] = true; + $results['university_details'] = $endResult; + return $results; + } + + + public function send_msg_students($arr, $msg) { + $msg_body = $msg['content']; + $mesg = "Status Update : check - check check."; + $resp = $this->smssend($arr, $mesg); + // $arrss = explode('
', $resp); + // $results['resp'] = $resp; + // for($i=0; $i MsgID +// [1] => 4fad03cf13734a869307b19fcc293570 +// [2] => 919942080003 +// [3] => 201801191700328088 +// [4] => success +// ) + // $msgId = $a[0]; + // $msgNumb = $a[1]; + // $msgStatus = $a[4]; + // // print_r ($a);exit; + // // echo $a[1];exit(); + // $data[] = array( + // 'MsgID' => $msgId, + // 'MsgNum' => $msgNumb, + // 'MsgDelvStatus' => $msgStatus + // ); + // } + + // $msgID = $arrss[1]; + // $msgSendTime = $arrss[2]; + // $msgDeleveredNum = $arrss[3]; + // $msgSendStatus = $arrss[3]; + + // print_r($data);exit(); + $result['msgStatus'] = true; + $result['message'] = "Successfully Messages Sended!!"; + return $result; + } + + // self function for getting registered mobile for sms + public function get_registered_mobile($num) { + $this->db->select('MobileNumber'); + $this->db->from(STUDENTS); + $this->db->where('StudentID', $num); + $roleDetails = $this->db->get()->first_row(); + return $roleDetails->MobileNumber; + } + + // http://www.24x7sms.com/downloads/24X7SMS_http_API2.0.pdf + // API Key : xegCdYUIMf3 + + // Your new password for logging into Apollo student portal is (Password). Please change the password as soon as you login. + // This is the template to be used. + + public function smssend($arr, $msg) + { + $number =array(); + foreach($arr as $ar){ + $mobi = $this->get_registered_mobile($ar['StudentID']); + array_push($number, "91$mobi"); + } + $mobile = implode(',', $number); + // $message ="Your new password for logging into Apollo student portal is SAMPLE. Please change the password as soon as you login."; + // $mobile = "91$mobile"; + + $message = urlencode($msg); + // echo $mobile , $message; + $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"); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); + $output =curl_exec($ch); + + // print_r($output);exit(); + curl_close($ch); + return $output; + } + +} \ No newline at end of file diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index 478748bc..dc9ac13f 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -51,6 +51,17 @@ class StatusUpdation_model extends CI_Model $results['message'] = 'No record found'; } return $results; + } + + public function get_couser_name($cours) { + + $this->db->select('t2.CourseName'); + // $this->db->from('' . COURSE_FEES . ' as t1'); + $this->db->from('' . COURSE . ' as t2'); + $this->db->where('t2.CourseID', $cours); + $roleDetails = $this->db->get()->first_row(); + return "$roleDetails->CourseName"; + } // update Application status @@ -61,7 +72,8 @@ class StatusUpdation_model extends CI_Model $dateToMsg = $arr[0]['AppDate']; $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); - $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg."; + $getCourseName = $this->get_couser_name($arr[0]['CourseID']); + $mesg = "Status Update : $cerNamtToMsg $getCourseName - $statuToMsg $dateToMsg."; $this->smssend($arr, $mesg); } // $result['addStatus'] = true; @@ -88,8 +100,13 @@ class StatusUpdation_model extends CI_Model $dateToMsg = $arr[0]['CDate']; $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); // $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); - $cerNamtToMsg = 'MARK CARD'; - $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg."; + $cerNamtToMsg = 'MARK CARD'; + $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); + $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; + + + + // $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg."; $this->smssend($arr, $mesg); } $result['addStatus'] = true; @@ -270,8 +287,20 @@ class StatusUpdation_model extends CI_Model return $result; } + public function get_couser_sem_yr_msg($cours) { + + $this->db->select('t1.Sem_Year, t2.CourseName'); + $this->db->from('' . COURSE_FEES . ' as t1'); + $this->db->join('' . COURSE . ' as t2', 't2.CourseID = t1.CourseID', 'LEFT'); + $this->db->where('ID', $cours); + $roleDetails = $this->db->get()->first_row(); + return "$roleDetails->Sem_Year $roleDetails->CourseName"; + + } + // update study material status public function update_semyear($arr) { + // echo $cours;exit(); // $this->get_status_name_ListCode($arr[0]['ListCode']); $this->db->insert_batch(STUDY_MATERIAL_STATUS, $arr); if ($this->db->affected_rows() >= 1) { @@ -280,7 +309,8 @@ class StatusUpdation_model extends CI_Model $dateToMsg = $arr[0]['SDate']; $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); $cerNamtToMsg = 'Study Material'; - $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg."; + $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); + $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; $this->smssend($arr, $mesg); } // $this->smssend($arr); @@ -320,7 +350,10 @@ class StatusUpdation_model extends CI_Model $Course = $reqData['Course']; $Batch = $reqData['Batch']; - $subQuery = "SELECT S.* , SC.CourseID , C.CourseName , U.UniversityName + $branch = $req['localBranchID']; + + if( $branch == 'All' ) { + $subQuery = "SELECT S.* , SC.CourseID , C.CourseName , U.UniversityName FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON SC.CourseID = C.CourseID @@ -334,7 +367,23 @@ class StatusUpdation_model extends CI_Model $queryDetails = $this->db->query($subQuery); $results['searchResult'] = true; $results['search_result_details'] = $queryDetails->result(); + } else { + $subQuery = "SELECT S.* , SC.CourseID , C.CourseName , U.UniversityName + FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID + LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + SC.CourseID = C.CourseID + WHERE + SC.UniversityID LIKE '%$University%' + AND SC.CourseID LIKE '%$Course%' + AND SC.BatchCode LIKE '%$Batch%' + AND S.IsActive = '1' + AND S.BranchCode = '$branch' + AND SC.IsActive = '1'"; + $queryDetails = $this->db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + } return $results; } diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index 069ade4c..fe66f650 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -124,6 +124,9 @@ }, "profile": { "MAIN": "MY PROFILE" + }, + "sendSMSPage": { + "MAIN": "SMS SEND" } } }, diff --git a/Apollo/assets/js/controllers/answerBookletStatusCtrl.js b/Apollo/assets/js/controllers/answerBookletStatusCtrl.js index 919da6f5..d630787d 100755 --- a/Apollo/assets/js/controllers/answerBookletStatusCtrl.js +++ b/Apollo/assets/js/controllers/answerBookletStatusCtrl.js @@ -304,15 +304,15 @@ app.controller('answerBookletStatusCtrl', ["$scope", "toaster", "$filter", "ngTa $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { - let getStudentID = new getStudentForUpdateDetails(item.StudentID); + let getStudentID = new getStudentForUpdateDetails(item.StudentID, item.BranchCode); studentForUpdate.push(getStudentID); return true; } }); - function getStudentForUpdateDetails(id) { + function getStudentForUpdateDetails(id, bCode) { this.StudentID = id; this.CourseID = $scope.myStatusModel.semYear; - this.BranchCode = localDetails.localBranchID; + this.BranchCode = bCode; this.ListCode = $scope.myStatusModel.staus; this.SDate = $scope.myStatusModel.dateOn; this.Coursedetail = id; diff --git a/Apollo/assets/js/controllers/applicationStatusCtrl.js b/Apollo/assets/js/controllers/applicationStatusCtrl.js index b21b8268..a572e999 100755 --- a/Apollo/assets/js/controllers/applicationStatusCtrl.js +++ b/Apollo/assets/js/controllers/applicationStatusCtrl.js @@ -337,15 +337,15 @@ app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { - let getStudentID = new getStudentForUpdateDetails(item.StudentID, item.CourseID); + let getStudentID = new getStudentForUpdateDetails(item.StudentID, item.CourseID, item.BranchCode); studentForUpdate.push(getStudentID); return true; } }); - function getStudentForUpdateDetails(id, courseId) { + function getStudentForUpdateDetails(id, courseId, dCode) { this.StudentID = id; this.CourseID = courseId; - this.BranchCode = localDetails.localBranchID; + this.BranchCode = dCode; this.ListCode = $scope.myStatusModel.staus; this.SDate = $scope.myStatusModel.dateOn; this.Coursedetail = id; diff --git a/Apollo/assets/js/controllers/certificationStatusCtrl.js b/Apollo/assets/js/controllers/certificationStatusCtrl.js index 71a2edf3..457f552a 100755 --- a/Apollo/assets/js/controllers/certificationStatusCtrl.js +++ b/Apollo/assets/js/controllers/certificationStatusCtrl.js @@ -339,15 +339,15 @@ app.controller('certificationStatusCtrl', ["$scope", "toaster", "$filter", "ngTa $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { - let getStudentID = new getStudentForUpdateDetails(item.StudentID); + let getStudentID = new getStudentForUpdateDetails(item.StudentID, item.BranchCode); studentForUpdate.push(getStudentID); return true; } }); - function getStudentForUpdateDetails(id) { + function getStudentForUpdateDetails(id, bCode) { this.StudentID = id; this.CourseID = $scope.myStatusModel.semYear; - this.BranchCode = localDetails.localBranchID; + this.BranchCode = bCode; this.ListCode = $scope.myStatusModel.staus; this.SDate = $scope.myStatusModel.dateOn; this.Coursedetail = id; diff --git a/Apollo/assets/js/controllers/daybookCtrl.js b/Apollo/assets/js/controllers/daybookCtrl.js index 4d0fe31b..95bc80a6 100755 --- a/Apollo/assets/js/controllers/daybookCtrl.js +++ b/Apollo/assets/js/controllers/daybookCtrl.js @@ -274,6 +274,21 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng } }); } + }, + reset: function (form) { + form.$setPristine(true); + $scope.myModelAdd = { + "id": "", + "date": "", + "name": "", + "type": "", + "amount": "", + "status": "", + "description": "", + "paidTo": "", + "description_paid": "", + "voucherNumber": "" + } } } diff --git a/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js b/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js index 4102d428..8dd2844b 100644 --- a/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js +++ b/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js @@ -11,60 +11,235 @@ app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", " $scope.init = function () { if (localDetail != null) { - $scope.getProfile(); + // $scope.getBranchList(); + $scope.getUniversityList(); } else { } - } - - $scope.loginUser = { - 'staffID': '', - 'fName': '', - 'lName': '', - 'mobileNumber': '', - 'gender': '', - 'branchCode': '', - 'branchList': '', }; + $scope.searchData = { + 'University': '', + 'Course': '', + 'Batch': '' + }; - // client side logined details - $scope.getProfile = function () { - var req = { + $scope.branchList_data = ''; + // get Branch List + $scope.getBranchList = function () { + var empListreq = { method: 'POST', - url: apiPoint.url + 'employeeGetProf/', + url: apiPoint.url + 'getBranchListDetails/', headers: { 'Content-Type': 'application/json' }, data: { - employeeLoginID: localDetails.localUserID + data: localDetails } }; - $http(req).then(function (response) { - if (response.data.empStatus == true) { - /* - * Get Top Nav user details - */ - $scope.userInfo = response.data.details; - $scope.userStatusInfo = response.data.work_State; - $scope.userBranchInfo = response.data.branch_details; - // alert(JSON.stringify($scope.userInfo)); - // alert(JSON.stringify($scope.userStatusInfo)); - // alert(JSON.stringify($scope.userBranchInfo)); - // $scope.loginImage = $scope.resultData.ProfilePicPath; - // $scope.loginUser = { - // 'staffID': $scope.resultData.StaffID, - // 'fName': $scope.resultData.Firstname, - // 'lName': $scope.resultData.Lastname, - // 'mobileNumber': $scope.resultData.MobileNumber, - // 'gender': $scope.resultData.Gender, - // 'branchCode': $scope.resultData.BranchCode, - // 'branchList': response.data.branch_details, - // }; - // var currArr = response.data.branch_details; - // $scope.getCurrentBran = currArr.find(item => item.BranchCode === localDetails.localBranchID); + $http(empListreq).then(function (response) { + if (response.data.branDetailstatus) { + $scope.branchList_data = response.data.branch_details; + } else { } }); }; + $scope.universityData = ''; + // get university list while the page is load + $scope.getUniversityList = function () { + var empListreq = { + method: 'POST', + url: apiPoint.url + 'getUniveCourseBratchBroadCast/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: localDetails + } + }; + $http(empListreq).then(function (response) { + if (response.data.univList) { + $scope.universityData = response.data.university_details; + } else { + } + }); + }; + + $scope.getUniveId = function (univ) { + let name = JSON.parse(univ); + $scope.searchData.University = name.UniversityID; + $scope.searchData.Course = ''; + $scope.searchData.Batch = ''; + $scope.courseData = name.Course; + $scope.batchData = name.Batch; + $scope.OpenWindowStatus = false; + $scope.getSearch(); + }; + + $scope.getValueChange = function() { + $scope.getSearch(); + }; + + $scope.OpenWindowStatus = false; + $scope.searchLoading = false; + $scope.getSearch = function() { + console.log($scope.searchData); + $scope.OpenWindowStatus = false; + $scope.searchLoading = true; + var getSearchDetails = { + method: 'POST', + url: apiPoint.url + 'getStuListForBroadcast/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.searchData, + requestDetails: localDetails + } + }; + $http(getSearchDetails).then(function (response) { + if (response.data.searchResult) { + $scope.studentListDetails = response.data.search_result_details; + let studentListDetails = response.data.search_result_details; + const filterAddSelect = studentListDetails.filter(val => { + val['Selected'] = false; + return val; + }); + $scope.searchResultDetails = filterAddSelect; + $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; + + $scope.searchResultStatus = response.data.searchResult; + $scope.searchLoading = false; + } else { + $scope.searchLoading = false; + } + }); + }; + + // select all or individual functionality + + var getAllSelected = function () { + var selectedItems = $scope.searchResultDetails.filter(function (item) { + return item.Selected; + }); + + return selectedItems.length === $scope.searchResultDetails.length; + } + + var setAllSelected = function (value) { + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = value; + }); + } + + $scope.allSelected = function (value) { + if (value !== undefined) { + return setAllSelected(value); + } else { + return getAllSelected(); + } + } + + $scope.OpenWindowStatus = false; + $scope.openScreenSen = function() { + var ItemsSelected = $scope.searchResultDetails.filter(function (item) { + if (item.Selected === true) { return true; } + }); + if(ItemsSelected.length > 0) { + $scope.OpenWindowStatus = true; + $scope.openUpdateWind(); + } else { + $scope.OpenWindowStatus = false; + $scope.openUpdateWind(); + } + } + + $scope.msg_details = { + "content": "" + } + + // Select one row in a table once + // $scope.setOneSelect = function (value) { + // angular.forEach($scope.searchResultDetails, function (item) { + // item.Selected = value; + // }); + // value.Selected = true; + // $scope.OpenWindowStatus = true; + // $scope.openUpdateWind(); + // } + + // End: select all or individual functionality + + $scope.openUpdateWind = function() { + + } + + $scope.statusUpdate = { + submit: function (form, msg_details) { + var firstError = null; + if (form.$invalid) { + var field = null, firstError = null; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$name; + } + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); + } else { + $scope.disableButton = true; + var studentForUpdate = []; + var ItemsSelected = $scope.searchResultDetails.filter(function (item) { + if (item.Selected === true) { + let getStudentID = new getStudentForUpdateDetails(item.StudentID); + studentForUpdate.push(getStudentID); + return true; + } + }); + function getStudentForUpdateDetails(id) { + this.StudentID = id; + } + var sendMSGApi = { + method: 'POST', + url: apiPoint.url + 'sendSMSStudentApi/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: studentForUpdate, + msg: msg_details, + requestDetails: localDetails + } + }; + $http(sendMSGApi).then(function (response) { + if (response.data.msgStatus) { + swal("Success!", response.data.message, "success"); + $scope.disableButton = false; + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.OpenWindowStatus = false; + } else { + swal("Failed!", response.data.message, "error"); + $scope.disableButton = false; + } + }); + + } + }, + reset: function (form) { + form.$setPristine(false); + $scope.msg_details = { + "content": "" + } + // $scope.msg_details.content = ""; + } + } + }]); diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 56095713..b8fad21b 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -659,6 +659,13 @@ $scope.studentListLength = 0; 'DeactiveComments': '', 'Comments': '' }; + $scope.myModelCourseAdd = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; }, resetCourse: function (form) { form.$setPristine(true); $scope.myModelCourse = { @@ -1479,7 +1486,7 @@ $scope.myUnivSearch = ""; // add student $scope.studentFORM = { submit: function (form, myModel, myModelCourseAdd) { - alert(JSON.stringify(myModelCourseAdd)); + // alert(JSON.stringify(myModelCourseAdd)); var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -1595,6 +1602,13 @@ $scope.myUnivSearch = ""; 'DeactiveComments': '', 'Comments': '' }; + $scope.myModelCourseAdd = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; }, resetCourse: function (form) { form.$setPristine(true); $scope.myModelCourse = { diff --git a/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js b/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js index cddae935..7adbdb08 100755 --- a/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js +++ b/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js @@ -315,15 +315,15 @@ app.controller('studyMaterialStatusCtrl', ["$scope", "toaster", "$filter", "ngTa $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { - let getStudentID = new getStudentForUpdateDetails(item.StudentID); + let getStudentID = new getStudentForUpdateDetails(item.StudentID, item.BranchCode); studentForUpdate.push(getStudentID); return true; } }); - function getStudentForUpdateDetails(id) { + function getStudentForUpdateDetails(id, bCode) { this.StudentID = id; this.CourseID = $scope.myStatusModel.semYear; - this.BranchCode = localDetails.localBranchID; + this.BranchCode = bCode; this.ListCode = $scope.myStatusModel.staus; this.SDate = $scope.myStatusModel.dateOn; this.Coursedetail = id; diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html index 3b9f41b5..24b1fbb4 100755 --- a/Apollo/assets/views/daybook/daybook.html +++ b/Apollo/assets/views/daybook/daybook.html @@ -337,7 +337,7 @@ Amount is Required - +
diff --git a/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html b/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html index 89fc9eab..38aa7643 100644 --- a/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html +++ b/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html @@ -13,10 +13,231 @@
-
- -

D

+
+ +
+ +
+ + + +
+ + +
+ + + +
+ +
+ + + +
+
+ + + + +
+ +
+ +
+

fetching...

+
+ +
+ +
+
+

No + records found...

+
+ +
+
+

No + records found...

+
+ +
+ +
+
+
+ + + +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + First Name + + Last Name + + MobileNumber + + Email ID + + Course + +
+ + {{p.Firstname}}{{p.Lastname}}{{p.MobileNumber}}{{p.EmailID}}{{p.CourseName}}
+ + +
+
+ +
+ +
+
+
+
+
+
+ +
+
+ + SMS Details + + + +
+
+
+ + +