Calltracking filter issues fixes : ps

This commit is contained in:
Sanjeev 2021-01-12 21:57:14 +05:30
parent f29fce0010
commit e182f65831
7 changed files with 234 additions and 60 deletions

View File

@ -587,6 +587,32 @@ public function getstaffCountDetails_post()
/* /*
* End of call tracking * End of call tracking
*/ */
public function getTrackingLeadDetails2_post()
{
$activity = $this->post('activity');
$requestedBy = $this->post('requestedBy');
$mobileNumber = '';
$branchID = $this->post('branchID');
$loginType = $this->post('userType');
$getLeadDetails = $this->Calltracking_model->getLeadDetails($requestedBy,$mobileNumber,$branchID,$loginType);
$getLeadDetails['statusDetails'] = $this->Calltracking_model->getStatus($activity);
if ($getLeadDetails)
{
$getLeadDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getLeadDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
public function updateFollowupDetails2_post() public function updateFollowupDetails2_post()
{ {
$now = new DateTime(); $now = new DateTime();

View File

@ -127,10 +127,9 @@ class Broadcast_model extends CI_Model {
public function getSMSGroupDetails($reqData ,$reqBy) { public function getSMSGroupDetails($reqData ,$reqBy) {
$localBranch = $reqBy['localBranchID']; $localBranch = $reqBy['localBranchID'];
$querys = "SELECT t1.*, t2.DeliveredStatus, t2.DeliveredOn FROM T_BroadcastStatus as t1 $querys = "SELECT t1.id, t1.MsgId, t1.MsgBody, t1.Status, t1.MobileNumber, t1.CreatedBy, t1.CreatedOn, t1.MsgGroup, t1.BranchCode, t2.DeliveredStatus, t2.DeliveredOn FROM T_BroadcastStatus as t1
LEFT JOIN T_BroadcastDeliveryCron as t2 ON t2.MsgId = t1.MsgId LEFT JOIN T_BroadcastDeliveryCron as t2 ON t2.MsgId = t1.MsgId
WHERE t1.MsgGroup = '$reqData' AND t1.BranchCode='$localBranch' ORDER BY t1.CreatedOn DESC"; WHERE t1.MsgGroup = '$reqData' AND t1.BranchCode='$localBranch' ORDER BY t1.CreatedOn DESC";
// echo $querys;exit();
$smsSendGroupDetails = $this->db->query($querys); $smsSendGroupDetails = $this->db->query($querys);
$smsSendGroupDetailsList = $smsSendGroupDetails->result(); $smsSendGroupDetailsList = $smsSendGroupDetails->result();

View File

@ -1059,7 +1059,6 @@ $msg='Dear '.$name.', Thank you for enquiring with Apollo Distance Education Col
* created by kms * created by kms
* */ * */
public function getLoadFollowupDetails($trackingID) public function getLoadFollowupDetails($trackingID)
{ {
//sprint_r($trackingID);die(); //sprint_r($trackingID);die();

View File

@ -560,6 +560,7 @@ $scope.trackingTodayno=0;
$scope.data = []; $scope.data = [];
$scope.dCopy = [];
if(myModel!='' && myModel!=undefined){ if(myModel!='' && myModel!=undefined){
$scope.finalSearchArry=myModel; $scope.finalSearchArry=myModel;
@ -610,6 +611,7 @@ $scope.trackingTodayno=0;
$scope.dbFollowDate = getYear+'-'+getMonth+'-'+getDay; $scope.dbFollowDate = getYear+'-'+getMonth+'-'+getDay;
if (($scope.currentDate) > ( $scope.dbFollowDate) && (value.statusName!='CLOSE')) { if (($scope.currentDate) > ( $scope.dbFollowDate) && (value.statusName!='CLOSE')) {
$scope.data.push(value); $scope.data.push(value);
$scope.dCopy.push(value);
} }
@ -619,6 +621,7 @@ $scope.trackingTodayno=0;
angular.forEach(response.data.trackingDetails, function (value1, key1) { angular.forEach(response.data.trackingDetails, function (value1, key1) {
$scope.data.push(value1); $scope.data.push(value1);
$scope.dCopy.push(value1);
}); });
@ -637,6 +640,7 @@ $scope.trackingTodayno=0;
$rootScope.trackingStatus = response.data.statusDetails; $rootScope.trackingStatus = response.data.statusDetails;
$scope.data = response.data.trackingDetails; $scope.data = response.data.trackingDetails;
$scope.dCopy= response.data.trackingDetails;
sessionStorage.setItem('trackingList', JSON.stringify($scope.data)); sessionStorage.setItem('trackingList', JSON.stringify($scope.data));
} }
@ -659,6 +663,7 @@ $scope.trackingTodayno=0;
if (($scope.currentDate) > ($scope.dbFollowDate) && (value.statusName!='CLOSE')) { if (($scope.currentDate) > ($scope.dbFollowDate) && (value.statusName!='CLOSE')) {
$scope.data.push(value); $scope.data.push(value);
$scope.dCopy.push(value);
} }
}); });
sessionStorage.setItem('trackingList', JSON.stringify($scope.data)); sessionStorage.setItem('trackingList', JSON.stringify($scope.data));
@ -673,6 +678,7 @@ $scope.trackingTodayno=0;
$scope.branchInfo = ''; $scope.branchInfo = '';
$scope.data=''; $scope.data='';
$scope.dCopy='';
} }
@ -812,33 +818,151 @@ $scope.GetstaffwiseDetails($scope.tod);
} }
$scope.$watch(function () { $scope.searchableChange = function(search2,search3,search4,search5) {
$scope.filteredItems = $scope.$eval(" data |filter:search2| filter:search3| filter:search4| filter:search5"); $scope.search2_details = search2 != '' ? search2 : '';
// $scope.filteredItems = $scope.$eval(" data | filter:search3 "); $scope.search3_activity = search3 != '' ? search3 : '';
// console.log($scope.filteredItems); $scope.search4_assigned = search4 != '' ? search4 : '';
}); $scope.search5_status = search5 != '' ? search5 : '';
console.log($scope.search2_details,$scope.search3_activity,$scope.search4_assigned,$scope.search5_status);
$scope.myModel.all = false;
};
$scope.arrayReturn = function(search2,search3,search4,search5) {
console.log('Initial',$scope.data);
$scope.searchedData1=[];
$scope.selectedLeadID = [];
$scope.disable = false;
if(search2!='' && search2!=null && search2!=undefined){
$scope.regInteger = /^\d+$/;
if($scope.regInteger.test(search2)){
$scope.searchText = search2;
angular.forEach($scope.data, function(item) {
if( item.MobileNumber.indexOf($scope.searchText) >= 0 ){
$scope.searchedData1.push(item);
}
});
}
else{
$scope.search2 = search2.toLowerCase();
angular.forEach($scope.data, function(item) {
if( item.LeadName.toLowerCase().indexOf($scope.search2) >= 0 ){
$scope.searchedData1.push(item);
}
});
}
}
else{
angular.forEach($scope.data,function (value,key) {$scope.searchedData1.push(value);});
}
// console.log('Step1 output',$scope.searchedData1);
// console.log('search',search3);
$scope.searchedData2=[];
if(search3!='' && search3!=null && search3!=undefined){
// console.log('hai i have value',search3);
angular.forEach($scope.searchedData1, function(item) {
if( item.ActivityName.toLowerCase().indexOf(search3.toLowerCase()) >= 0 ){
$scope.searchedData2.push(item);
}
});
}
else{
angular.forEach($scope.searchedData1,function (value,key) {
$scope.searchedData2.push(value);
});
}
// serach assigned to in array list
// console.log('Step2 output',$scope.searchedData2);
$scope.searchedData3=[];
if(search4!='' && search4!=null && search4!=undefined){
angular.forEach($scope.searchedData2, function(item) {
if(item.Firstname.toLowerCase().indexOf(search4.toLowerCase()) >= 0 ){
$scope.searchedData3.push(item);
}
});
}
else{
angular.forEach($scope.searchedData2,function (value,key) {
$scope.searchedData3.push(value);
});
}
// console.log('Step3 output',$scope.searchedData3);
// // search status in array list
$scope.searchedData4=[];
if(search5!='' && search5!=null && search5!=undefined){
angular.forEach($scope.searchedData3, function(item) {
if( item.statusName.toLowerCase().indexOf(search5.toLowerCase()) >= 0 ){
$scope.searchedData4.push(item);
}
});
}
else{
angular.forEach($scope.searchedData3,function (value,key) {
$scope.searchedData4.push(value);
});
}
console.log('Step4 output',$scope.searchedData4);
$scope.disable = false;
};
// $scope.$watch(function () {
// // $scope.filteredItems = $scope.$eval(" data |filter:search2 ");
// $scope.filteredItems = $scope.$eval(" data | filter:"+$scope.search3_activity);
// // console.log($scope.filteredItems);
// // console.log($scope.search3_activity);
// });
/** /**
* Auto Call Tracking Sriram * Auto Call Tracking Sriram
*/ */
$scope.selectedLeadID = []; $scope.selectedLeadID = [];
$scope.isCheckAll = function(e){ $scope.isCheckAll = function(e){
var val = (e.target.checked ? true : false); var val = (e.target.checked ? true : false);
console.log('$scope.search2_details',$scope.search2_details);
console.log('$scope.search3_activity',$scope.search3_activity);
console.log('$scope.search4_assigned',$scope.search4_assigned);
console.log('$scope.search5_status',$scope.search5_status);
console.log('$scope.searchedData4',$scope.searchedData4);
$scope.arrayReturn($scope.search2_details,$scope.search3_activity,$scope.search4_assigned,$scope.search5_status);
// alert(val); // alert(val);
// return true; // return true;
if(val) if(val)
{ {
// $scope.disable = false; // $scope.disable = false;
var len2 = $scope.data.length; // var len2 = $scope.data.length;
var len = $scope.filteredItems.length; var len = $scope.searchedData4.length;
console.log("len2",len2);
console.log("len filter",len); console.log("len filter",len);
console.log($scope.filteredItems);
var i = 0; var i = 0;
for(i=0;i<len;i++) for(i=0;i<len;i++)
{ {
if($scope.selectedLeadID.indexOf($scope.data[i]) === -1) if($scope.selectedLeadID.indexOf($scope.searchedData4[i]) === -1)
{ {
$scope.selectedLeadID.push($scope.data[i]); $scope.selectedLeadID.push($scope.searchedData4[i]);
} }
} }
} }
@ -897,14 +1021,27 @@ $scope.GetstaffwiseDetails($scope.tod);
// swal('testing','','warning'); // swal('testing','','warning');
// return true; // return true;
//$rootScope.student = $scope.selectedStudentsID; //$rootScope.student = $scope.selectedStudentsID;
$scope.filteredList=[];
if($scope.selectedLeadID ==''){ if($scope.selectedLeadID ==''){
swal('Select Check box','','warning'); swal('Select Check box','','warning');
return false; return false;
}else{ }else{
// var len2 = $scope.selectedLeadID.length;
if($scope.search3_activity!='' && $scope.search3_activity!=null && $scope.search3_activity!=undefined){
angular.forEach($scope.selectedLeadID, function(item) {
if(item.ActivityName.toLowerCase().indexOf($scope.search3_activity.toLowerCase()) >= 0 ){
$scope.filteredList.push(item);
}
});
var ActivityID = $scope.filteredList[0].ActivityID;
}else{
var ActivityID = '';
}
// console.log(ActivityID,'ActivityID');
$scope.controller = 'ng-controller="callTrackingCtrl"'; $scope.controller = 'ng-controller="callTrackingCtrl"';
var lead = { var lead = {
method: 'POST', method: 'POST',
url: apiPoint.url + 'getTrackingLeadDetails/', url: apiPoint.url + 'getTrackingLeadDetails2/',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
@ -912,14 +1049,29 @@ $scope.GetstaffwiseDetails($scope.tod);
requestedBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID, requestedBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
branchID:JSON.parse(sessionStorage.getItem('localObj')).localBranchID, branchID:JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
userType:JSON.parse(sessionStorage.getItem('localObj')).localType, userType:JSON.parse(sessionStorage.getItem('localObj')).localType,
activity:ActivityID
} }
}; };
$http(lead).then(function (response) { $http(lead).then(function (response) {
if (response.data.status==200) { console.log('i got the response');
console.log('Here',response.data);
console.log('$scope.search3.ActivityName',$scope); if (response.data.status==200) {
$rootScope.activity = response.data.activityDetails; // if($scope.search3_activity){
$rootScope.status = response.data.statusDetails; // $scope.fS = $filter('filter')(response.data.activityDetails, {'activityName':$scope.search3_activity});
// console.log($scope.fS);
// console.log($scope.fS['activityStatus']);
// }else{
// $scope.fS = response.data.activityDetails;
// }
// var filteredList = $filter('filter')(response.data.activityDetails, function (i) {
// return (i.activityName == $scope.search3_activity);
// });
// $scope.filteredList = [];
// if($scope.search3_activity!='' && $scope.search3_activity!=null && $scope.search3_activity!=undefined){
// }
// console.log($scope.filteredList);
$rootScope.activity = $scope.search3_activity;
$rootScope.statusDetails = response.data.statusDetails;
$rootScope.staffDetails = response.data.staffDetails; $rootScope.staffDetails = response.data.staffDetails;
$rootScope.studentDetails = $scope.selectedLeadID; $rootScope.studentDetails = $scope.selectedLeadID;
// $scope.modalopen($scope.activity); // $scope.modalopen($scope.activity);
@ -950,7 +1102,6 @@ $scope.GetstaffwiseDetails($scope.tod);
} }
}]); }]);
/* /*
* lead controller * lead controller
* */ * */

View File

@ -7,39 +7,38 @@ app.controller('report_markcard_statusCtrl', ["$scope", "$filter","$rootScope",
*/ */
$scope.userType=JSON.parse(sessionStorage.getItem('localObj')).localType; $scope.userType=JSON.parse(sessionStorage.getItem('localObj')).localType;
$scope.isTblShow = false; $scope.isTblShow = false;
$scope.isLoader = false; $scope.isLoader = false;
$scope.isLoaderShow = false; $scope.isLoaderShow = false;
$scope.isLoaderShow1 =false; $scope.isLoaderShow1 =false;
$scope.isLoaderTxt = "Loading..."; $scope.isLoaderTxt = "Loading...";
$scope.generateButtonTxt = "GENERATE"; $scope.generateButtonTxt = "GENERATE";
$scope.generateButtonStatus = false; $scope.generateButtonStatus = false;
$scope.currentPage = 1; $scope.currentPage = 1;
$scope.myModel = { $scope.myModel = {
"date": new Date(), "date": new Date(),
"activity": "", "activity": "",
"assignedTo": "", "assignedTo": "",
"status": "", "status": "",
"referedBy": '', "referedBy": '',
"comments":'', "comments":'',
"enquiryStatus":'', "enquiryStatus":'',
"important":false,
"important":false, "branch":"",
"branch":"",
};
};
//get current date //get current date
$scope.hideDateSearch=true; $scope.hideDateSearch=true;
$scope.modifyMinDate = moment(); $scope.modifyMinDate = moment();
//$scope.minDate = $filter('date')($scope.modifyMinDate, 'MM-dd-yyyy'); //$scope.minDate = $filter('date')($scope.modifyMinDate, 'MM-dd-yyyy');
$scope.currentDate=$filter('date')(new Date(), 'dd-MM-yyyy'); $scope.currentDate=$filter('date')(new Date(), 'dd-MM-yyyy');
// get 30 plus date for follwup details // get 30 plus date for follwup details
$scope.modifyDate = moment(); $scope.modifyDate = moment();
$scope.modifyDate.add(30, 'days'); $scope.modifyDate.add(30, 'days');
$scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy'); $scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy');
$scope.myModel.date=$scope.currentDate; $scope.myModel.date=$scope.currentDate;
// console.log($scope.currentDate); // console.log($scope.currentDate);
/** /**
* End of the call tracking * End of the call tracking
*/ */
@ -198,6 +197,7 @@ $scope.generateButtonStatus = false;
}; };
$scope.$watch(function () { $scope.$watch(function () {
$scope.filteredItems = $scope.$eval(" markcard_data | filter: search "); $scope.filteredItems = $scope.$eval(" markcard_data | filter: search ");
console.log('Watch',$scope.filteredItems);
}); });
/** /**
* Auto Call Tracking Sriram * Auto Call Tracking Sriram

View File

@ -44,15 +44,14 @@
</spinner> </spinner>
</div> --> </div> -->
<!-- {{statusDetails | json}} -->
<div class="col-md-4 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}"> <div class="col-md-4 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}">
<label> Status Name </label> <label> Status Name </label>
<select class="form-control" name="status" id="Box3" tabindex="7" <select class="form-control" name="status" id="Box3" tabindex="7"
ng-model="myModel.status" ng-model="myModel.status"
> ng-options="sts.ListCode as sts.ListName for sts in statusDetails" >
<option value="">Select Status</option> <option value="">Select Status</option>
<option ng-repeat="checkStatus in myModel.activity.activityStatus" value="{{checkStatus.ListCode}}">{{checkStatus.ListName}}</option>
</select> </select>
</div> </div>
<!-- <span class="error text-small block" <!-- <span class="error text-small block"

View File

@ -99,19 +99,19 @@
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<input class="form-control" type="text" ng-model="search2" id="search2" autofocus tabindex="2" placeholder="Search anything" ng-change="change(search2, '{{search2}}')"/> <input class="form-control" type="text" ng-model="search2" id="search2" autofocus tabindex="2" placeholder="Search anything" ng-change="searchableChange(search2,search3.ActivityName,search4.Firstname,search5.statusName)"/>
</div> </div>
<!-- Search By Activity--> <!-- Search By Activity-->
<div class="col-md-2 col-md"> <div class="col-md-2 col-md">
<input class="form-control" type="text" ng-model="search3.ActivityName" id="search3" autofocus tabindex="3" placeholder=" Activity" /> <input class="form-control" type="text" ng-model="search3.ActivityName" id="search3" autofocus tabindex="3" placeholder=" Activity" ng-change="searchableChange(search2,search3.ActivityName,search4.Firstname,search5.statusName)"/>
</div> </div>
<!-- Search By Assign To--> <!-- Search By Assign To-->
<div class="col-md-2"> <div class="col-md-2">
<input class="form-control" type="text" ng-model="search4.Firstname" id="search4" autofocus tabindex="4" placeholder=" Assigned To" /> <input class="form-control" type="text" ng-model="search4.Firstname" id="search4" autofocus tabindex="4" placeholder=" Assigned To" ng-change="searchableChange(search2,search3.ActivityName,search4.Firstname,search5.statusName)"/>
</div> </div>
<!-- Search By Status--> <!-- Search By Status-->
<div class="col-md-2"> <div class="col-md-2">
<input class="form-control" type="text" ng-model="search5.statusName" id="search5" autofocus tabindex="5" placeholder="Status" /> <input class="form-control" type="text" ng-model="search5.statusName" id="search5" autofocus tabindex="5" placeholder="Status" ng-change="searchableChange(search2,search3.ActivityName,search4.Firstname,search5.statusName)"/>
</div> </div>
<br><br> <br><br>