diff --git a/Apollo/api/application/models/Employee_model.php b/Apollo/api/application/models/Employee_model.php index 44766299..5caefdef 100755 --- a/Apollo/api/application/models/Employee_model.php +++ b/Apollo/api/application/models/Employee_model.php @@ -90,7 +90,7 @@ class Employee_model extends CI_Model if ($loginEmpDetail) { $EmpId = $loginEmpDetail->StaffID; if($loginEmpDetail->ListCode != STUDENT){ - $this->db->select('t1.*'); + $this->db->select('t1.*'); $this->db->from('' . STAFF . ' as t1'); $this->db->where('t1.StaffID', $EmpId); // $this->db->join('T_StaffDetails as t2', 't1.StaffID = t2.StaffID', 'LEFT'); @@ -222,7 +222,7 @@ class Employee_model extends CI_Model $this->db->where_not_in('t1.StaffID', $staffId); $this->db->group_by('t1.StaffID'); $this->db->where('t1.BranchCode', $loginUserBranchId); - $this->db->where('t1.ListCode', EMPLOYEE); + $this->db->where('t1.ListCode', EMPLOYEE)->or_where("t1.ListCode",TRAINEE); $this->db->order_by('t1.CreatedOn', 'DESC'); $empDetails = $this->db->get(); $checkArr = $empDetails->result(); diff --git a/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js b/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js index 4f1e3e72..2b4b866a 100755 --- a/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js +++ b/Apollo/assets/js/controllers/sendSMSsuperadminCtrl.js @@ -275,6 +275,7 @@ app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", " // ===================================== send individual sms + $scope.disableSendButton = false; $scope.mobileNumList = { "mobile" : "", "messange": "" @@ -296,16 +297,55 @@ app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", " } $scope.composeMsgNumber = function() { + $scope.disableSendButton = true; var phoneno = /^\d{10}$/; var mobileNumber = $scope.mobileNumList.mobile; if($scope.mobileNumList.mobile !=='' && $scope.mobileNumList.mobile !== null && $scope.mobileNumList.mobile !== undefined && mobileNumber.match(phoneno)) { + $scope.disableSendButton = false; $scope.listMobileNums.push($scope.mobileNumList.mobile); $scope.mobileNumList.mobile = ''; }else { + $scope.disableSendButton = false; swal(" ", "Please Should Enter Valid Mobile Number.", "warning"); } } + + $scope.composeMsgMultipleNumber = function() { + $scope.disableSendButton = true; + var phoneno = /^\d{10}$/; + var multipleMobileNumber = $scope.mobileNumList.multipleMobile; + var resultingArr = [] ,errorNumbers = [] ; + if($scope.mobileNumList.multipleMobile !=='' && $scope.mobileNumList.multipleMobile !== null && $scope.mobileNumList.multipleMobile !== undefined) { + var myarray = multipleMobileNumber.split(','); + // for(var i = 0; i < myarray.length; i++) + // { + // if(myarray[i].match(phoneno)){ + // resultingArr.push() + // // $scope.listMobileNums.push(myarray[i]); + // }else{ + // errorNumbers.push(myarray[i]); + // // alert(errorNumbers); + // } + // } + resultingArr = myarray.reduce(function(a,b){ + if(a.indexOf(b)<0 && b.match(phoneno)){$scope.listMobileNums.push(b);a.push(b);} + return a; + },[]); + // alert(resultingArr); + // $scope.listMobileNums.push(resultingArr.split(',')); + $scope.disableSendButton = false; + // swal({ html:true, title:'Please Check Mobile Numbers are valid.', text:''+errorNumbers+''}); + // swal( " " , "Please check these Numners are valid test "+errorNumbers, "warning"); + $scope.mobileNumList.multipleMobile = ''; + }else { + swal(" ", "Please Should Enter Valid Mobile Number.", "warning"); + } + // alert(multipleMobileNumber); + + } + + // add a new daybook entry $scope.composeMsg = { submit: function (form) { @@ -325,7 +365,7 @@ app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", " angular.element('.ng-invalid[name=' + firstError + ']').focus(); } else { if($scope.listMobileNums.length > 0) { - +$scope.disableSendButton = true; var msg = $scope.mobileNumList.message; // alert(msg); var nums = $scope.listMobileNums; @@ -348,7 +388,9 @@ app.controller('sendSMSsuperadminCtrl', ["$scope", "$filter", "ngTableParams", " if (response.data.msgStatus == true) { swal(" ", response.data.message, "success"); $scope.mobileNumList.message = ''; + $scope.disableSendButton = false; } else { + $scope.disableSendButton = false; swal(" ", response.data.message, "error"); } }); diff --git a/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html b/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html index ad21168c..78fbcb97 100755 --- a/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html +++ b/Apollo/assets/views/sendSMS/sendSMSsuperadmin.html @@ -308,12 +308,12 @@