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
*/
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()
{
$now = new DateTime();

View File

@ -127,10 +127,9 @@ class Broadcast_model extends CI_Model {
public function getSMSGroupDetails($reqData ,$reqBy) {
$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
WHERE t1.MsgGroup = '$reqData' AND t1.BranchCode='$localBranch' ORDER BY t1.CreatedOn DESC";
// echo $querys;exit();
$smsSendGroupDetails = $this->db->query($querys);
$smsSendGroupDetailsList = $smsSendGroupDetails->result();

View File

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

View File

@ -560,6 +560,7 @@ $scope.trackingTodayno=0;
$scope.data = [];
$scope.dCopy = [];
if(myModel!='' && myModel!=undefined){
$scope.finalSearchArry=myModel;
@ -610,6 +611,7 @@ $scope.trackingTodayno=0;
$scope.dbFollowDate = getYear+'-'+getMonth+'-'+getDay;
if (($scope.currentDate) > ( $scope.dbFollowDate) && (value.statusName!='CLOSE')) {
$scope.data.push(value);
$scope.dCopy.push(value);
}
@ -619,6 +621,7 @@ $scope.trackingTodayno=0;
angular.forEach(response.data.trackingDetails, function (value1, key1) {
$scope.data.push(value1);
$scope.dCopy.push(value1);
});
@ -637,6 +640,7 @@ $scope.trackingTodayno=0;
$rootScope.trackingStatus = response.data.statusDetails;
$scope.data = response.data.trackingDetails;
$scope.dCopy= response.data.trackingDetails;
sessionStorage.setItem('trackingList', JSON.stringify($scope.data));
}
@ -659,6 +663,7 @@ $scope.trackingTodayno=0;
if (($scope.currentDate) > ($scope.dbFollowDate) && (value.statusName!='CLOSE')) {
$scope.data.push(value);
$scope.dCopy.push(value);
}
});
sessionStorage.setItem('trackingList', JSON.stringify($scope.data));
@ -673,6 +678,7 @@ $scope.trackingTodayno=0;
$scope.branchInfo = '';
$scope.data='';
$scope.dCopy='';
}
@ -812,33 +818,151 @@ $scope.GetstaffwiseDetails($scope.tod);
}
$scope.$watch(function () {
$scope.filteredItems = $scope.$eval(" data |filter:search2| filter:search3| filter:search4| filter:search5");
// $scope.filteredItems = $scope.$eval(" data | filter:search3 ");
// console.log($scope.filteredItems);
});
$scope.searchableChange = function(search2,search3,search4,search5) {
$scope.search2_details = search2 != '' ? search2 : '';
$scope.search3_activity = search3 != '' ? search3 : '';
$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
*/
$scope.selectedLeadID = [];
$scope.isCheckAll = function(e){
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);
// return true;
if(val)
{
// $scope.disable = false;
var len2 = $scope.data.length;
var len = $scope.filteredItems.length;
console.log("len2",len2);
// var len2 = $scope.data.length;
var len = $scope.searchedData4.length;
console.log("len filter",len);
console.log($scope.filteredItems);
var i = 0;
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');
// return true;
//$rootScope.student = $scope.selectedStudentsID;
$scope.filteredList=[];
if($scope.selectedLeadID ==''){
swal('Select Check box','','warning');
return false;
}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"';
var lead = {
method: 'POST',
url: apiPoint.url + 'getTrackingLeadDetails/',
url: apiPoint.url + 'getTrackingLeadDetails2/',
headers: {
'Content-Type': 'application/json'
},
@ -912,14 +1049,29 @@ $scope.GetstaffwiseDetails($scope.tod);
requestedBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
branchID:JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
userType:JSON.parse(sessionStorage.getItem('localObj')).localType,
activity:ActivityID
}
};
$http(lead).then(function (response) {
if (response.data.status==200) {
console.log('Here',response.data);
console.log('$scope.search3.ActivityName',$scope);
$rootScope.activity = response.data.activityDetails;
$rootScope.status = response.data.statusDetails;
console.log('i got the response');
if (response.data.status==200) {
// if($scope.search3_activity){
// $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.studentDetails = $scope.selectedLeadID;
// $scope.modalopen($scope.activity);
@ -950,7 +1102,6 @@ $scope.GetstaffwiseDetails($scope.tod);
}
}]);
/*
* 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.isTblShow = false;
$scope.isLoader = false;
$scope.isLoaderShow = false;
$scope.isLoaderShow1 =false;
$scope.isLoaderTxt = "Loading...";
$scope.generateButtonTxt = "GENERATE";
$scope.generateButtonStatus = false;
$scope.currentPage = 1;
$scope.myModel = {
"date": new Date(),
"activity": "",
"assignedTo": "",
"status": "",
"referedBy": '',
"comments":'',
"enquiryStatus":'',
"important":false,
"branch":"",
};
$scope.isLoader = false;
$scope.isLoaderShow = false;
$scope.isLoaderShow1 =false;
$scope.isLoaderTxt = "Loading...";
$scope.generateButtonTxt = "GENERATE";
$scope.generateButtonStatus = false;
$scope.currentPage = 1;
$scope.myModel = {
"date": new Date(),
"activity": "",
"assignedTo": "",
"status": "",
"referedBy": '',
"comments":'',
"enquiryStatus":'',
"important":false,
"branch":"",
};
//get current date
$scope.hideDateSearch=true;
$scope.modifyMinDate = moment();
//$scope.minDate = $filter('date')($scope.modifyMinDate, 'MM-dd-yyyy');
$scope.currentDate=$filter('date')(new Date(), 'dd-MM-yyyy');
// get 30 plus date for follwup details
$scope.modifyDate = moment();
$scope.modifyDate.add(30, 'days');
$scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy');
$scope.myModel.date=$scope.currentDate;
// console.log($scope.currentDate);
//get current date
$scope.hideDateSearch=true;
$scope.modifyMinDate = moment();
//$scope.minDate = $filter('date')($scope.modifyMinDate, 'MM-dd-yyyy');
$scope.currentDate=$filter('date')(new Date(), 'dd-MM-yyyy');
// get 30 plus date for follwup details
$scope.modifyDate = moment();
$scope.modifyDate.add(30, 'days');
$scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy');
$scope.myModel.date=$scope.currentDate;
// console.log($scope.currentDate);
/**
* End of the call tracking
*/
@ -198,6 +197,7 @@ $scope.generateButtonStatus = false;
};
$scope.$watch(function () {
$scope.filteredItems = $scope.$eval(" markcard_data | filter: search ");
console.log('Watch',$scope.filteredItems);
});
/**
* Auto Call Tracking Sriram

View File

@ -44,15 +44,14 @@
</spinner>
</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}">
<label> Status Name </label>
<select class="form-control" name="status" id="Box3" tabindex="7"
ng-model="myModel.status"
>
ng-options="sts.ListCode as sts.ListName for sts in statusDetails" >
<option value="">Select Status</option>
<option ng-repeat="checkStatus in myModel.activity.activityStatus" value="{{checkStatus.ListCode}}">{{checkStatus.ListName}}</option>
</select>
</div>
<!-- <span class="error text-small block"

View File

@ -99,19 +99,19 @@
</div>
<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>
<!-- Search By Activity-->
<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>
<!-- Search By Assign To-->
<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>
<!-- Search By Status-->
<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>
<br><br>