sms multiple mobile number enter enabling , new employee listing on employee list : kdk

This commit is contained in:
dineshkumarkannan 2018-06-11 18:37:05 +05:30
parent 363cba0d41
commit 626dd30bb7
3 changed files with 71 additions and 13 deletions

View File

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

View File

@ -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:'<i style="font-size: 14px;">Please Check Mobile Numbers are valid.</i>', text:'<b>'+errorNumbers+'</b>'});
// swal( " " , "Please check these Numners are valid <b>test</b> "+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");
}
});

View File

@ -308,12 +308,12 @@
</div>
</div>
<div class="row">
<div class="col-md-4">
<!--<div class="col-md-4">
<label>Mobile Numbers : <span class="symbol required"></span>
<label>Mobile Number : <span class="symbol required"></span>
</label>
<div>
<input type="text" class="form-control inputCls"
<input type="text" class="form-control inputCls" placeholder="Enter Mobile Number"
ng-model="mobileNumList.mobile" name="mobile" ng-pattern="/^[0-9-+]*$/" minlength="6" maxlength="13">
<span class="error text-small block" ng-if="addressForm.mobile.$error.pattern && addressForm.mobile.$error.minlength && addressForm.mobile.$error.maxlength">Valid Mobile is Required </span>
</div>
@ -322,15 +322,30 @@
<i ng-click="composeMsgNumber()" class="addBtn" >add</i>
</div>
<!--ng-click="addContactsList(mobileNumList)"-->
</div>
<div class="col-md-2">
<label>
<!--Mobile Numbers : <span class="symbol required"></span>-->
</label>
</div>-->
<div class="col-md-4">
<label>Multiple Mobile Numbers : <span class="symbol required"></span>
</label>
<!--<span ng-click="composeMsgNumber()" class="addBtn" >add</span>-->
</div>
<div>
<textarea type="text" placeholder="Enter Multiple Mobile Numbers" tabindex="5" class="form-control inputCls" name="addMulipleNumbers"
ng-model="mobileNumList.multipleMobile"
/>
<span><b>Note:</b> Mobile Numbers Must Be Valid And Separate by commas(<b>eg : </b> 9876543210, 9786543210, ...)</span>
<span class="error text-small block" ng-if="addressForm.mobile.$error.pattern && addressForm.mobile.$error.minlength && addressForm.mobile.$error.maxlength">Valid Mobile is Required </span>
</div>
<br>
<div>
<i ng-click="composeMsgMultipleNumber()" class="addBtn" >add</i>
</div>
<!--ng-click="addContactsList(mobileNumList)"-->
</div>
<div class="col-md-6">
<div class="mobileNumberList">
<ul>
@ -338,7 +353,8 @@
</ul>
</div>
</div>
</div>
</div>
<!--<div>
<label>Mobile Numbers : </label> <textarea class="inputCls" ng-model="mobileNumList.mobile"></textarea>
</div>
@ -348,7 +364,7 @@
<div class="row">
<div class="pull-left">
<button type="submit" ng-disabled="disableAddButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
<button type="submit" ng-disabled="disableSendButton" tabindex="4" ladda="ldloading1.zoom_in" class="btn btn-sm btn-success"
data-style="zoom-in">
<i class='fa fa-spinner fa-spin' ng-if="disableSendButton"> </i>Send
</button>