From d0aa8f0c077d6f1ecec93d54d7ada0571a709adc Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 18 Jan 2018 17:48:48 +0530 Subject: [PATCH 1/8] call tracking changes done --- .../application/models/Calltracking_model.php | 41 ++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 38bee274..e263585f 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -13,7 +13,7 @@ class Calltracking_model extends CI_Model { * @params mobile number,requestedby * created by kms * */ - public function getLeadDetails($requestedBy=null,$mobileNumber=null) + public function getLeadDetails($requestedBy=null,$mobileNumber=null,$branchID=null,$userType=null) { $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,LT.University,LT.Course,LT.AlternateMobile,LT.Address'); $this->db->from(LEAD_DETAILS.' as LD'); @@ -63,7 +63,7 @@ class Calltracking_model extends CI_Model { //$result_array['universityDetails']=$this->getUniversityDetails(); $result_array['activityDetails']=$this->getActivityDetails(); // $result_array['statusDetails']=$this->getStatus(); - $result_array['staffDetails']=$this->getStaff("1"); + $result_array['staffDetails']=$this->getStaff("1",$branchID,$userType,$requestedBy); return $result_array; } @@ -175,12 +175,19 @@ class Calltracking_model extends CI_Model { * * */ - public function getStaff($status=null) + public function getStaff($status=null,$branchID=null,$userType=null,$requestedBy) { $this->db->select('LO.ID,ST.StaffID,ST.Firstname'); $this->db->from(LOGIN.' as LO'); $this->db->join(STAFF.' as ST', 'ST.StaffID = LO.StaffID'); $this->db->where('ST.IsActive',$status); + if($userType== ADMIN){ + $this->db->where('ST.BranchCode',$branchID); + $this->db->where('LO.ListCode !=',SUPER_ADMIN); + } + if($userType== EMPLOYEE){ + $this->db->where('LO.ID',$requestedBy); + } $staffDetails=$this->db->get(); if($staffDetails){ $result_staff = array(); @@ -264,6 +271,11 @@ class Calltracking_model extends CI_Model { $this->db->where('LT.CreatedBranch', $search['CreatedBranch']); } + if ($search['requestedDept'] == EMPLOYEE){ + + $this->db->where('LT.AssignedTo', $search['requestedBy']); + + } if($search['searchDate']!='' OR $search['searchDate']!=null){ /* if(sizeof($search['searchDate']) == '1'){ $this->db->where('LTF.FollowupOn <= ', $search['searchDate'][0]); @@ -348,6 +360,11 @@ class Calltracking_model extends CI_Model { if($search['CreatedBranch'] !='All'){ $this->db->where('LT.CreatedBranch', $search['CreatedBranch']); + } + if ($search['requestedDept'] == EMPLOYEE){ + + $this->db->where('LT.AssignedTo', $search['requestedBy']); + } if(($search['searchDate']!='' OR $search['searchDate']!=null) AND sizeof($search['searchDate']) == '1'){ @@ -492,6 +509,11 @@ class Calltracking_model extends CI_Model { if($trackingID['CreatedBranch'] !='All'){ $this->db->where('LT.CreatedBranch', $trackingID['CreatedBranch']); + } + if ($trackingID['requestedDept'] == EMPLOYEE){ + + $this->db->where('LT.AssignedTo', $trackingID['UpdatedBy']); + } $leadDet=$this->db->get(); @@ -520,7 +542,7 @@ class Calltracking_model extends CI_Model { $tracking_array["AlternateMobile"]=$row->AlternateMobile; $tracking_array["Address"]=$row->Address; $tracking_array["followupDetails"]=$this->getTrackingFollowup($row->TrackingID); - $tracking_array["collectTrackedID"]=$this->getStudentTrackedID($row->MobileNumber,$trackingID['CreatedBranch']); + $tracking_array["collectTrackedID"]=$this->getStudentTrackedID($row->MobileNumber,$trackingID['CreatedBranch'],$trackingID['requestedDept'],$trackingID['UpdatedBy']); $result[]=$tracking_array; @@ -528,6 +550,9 @@ class Calltracking_model extends CI_Model { } $result_array['trackingDetails']=$result; $result_array['statusDetails']=$this->getStatus($activityID); + $result_array['staffDetails']=$this->getStaff("1",$trackingID['CreatedBranch'],$trackingID['requestedDept'],$trackingID['UpdatedBy']); + + $result_array['trackingDetails']=$result; } @@ -546,7 +571,7 @@ class Calltracking_model extends CI_Model { * @params mobile number * created by kms * */ - public function getStudentTrackedID($stuMobile=null,$branchId=null) + public function getStudentTrackedID($stuMobile=null,$branchId=null,$reqDept=null,$updatedBy=null) { $this->db->distinct(); $this->db->select('LT.TrackingID,LT.LeadID,AV.ActivityID,AV.ActivityName,PLD.ListName'); @@ -555,9 +580,15 @@ class Calltracking_model extends CI_Model { $this->db->join(ACTIVITY.' as AV', 'AV.ActivityID = LT.ActivityStatus'); $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.StatusCode'); $this->db->where('LD.MobileNumber',$stuMobile); + if($branchId !='All'){ $this->db->where('LT.CreatedBranch', $branchId); + } + if ($reqDept == EMPLOYEE){ + + $this->db->where('LT.AssignedTo', $updatedBy); + } $this->db->order_by('LT.TrackingID','ASC'); From 7e89211386c5dc40bd07ad3716cb6f6645e79f9c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 18 Jan 2018 17:52:34 +0530 Subject: [PATCH 2/8] course details changes done --- Apollo/assets/js/controllers/callTrackingCtrl.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index 0fff435d..a98e175c 100755 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -267,7 +267,9 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", }, data: { requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, - mobileNumber:mobile + mobileNumber:mobile, + branchID:JSON.parse(localStorage.getItem('localObj')).localBranchID, + userType:JSON.parse(localStorage.getItem('localObj')).localType, } }; $http(lead).then(function (response) { @@ -1190,6 +1192,7 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", trackingID: followupDetails.TrackingID, date: $scope.nextFollowupDate, status: myModel1.status, + assignedTo: myModel1.assignStaff, comments: myModel1.comments, updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, @@ -1219,7 +1222,9 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", data: { trackingID: trackID, updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, - branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID + branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, + requestedDept: JSON.parse(localStorage.getItem('localObj')).localType, + } }; @@ -1234,8 +1239,11 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", $rootScope.modifyDate1 = moment(); $rootScope.modifyDate1.add(30, 'days'); $rootScope.futureDate1 = $filter('date')($scope.modifyDate1, 'dd-MM-yyyy'); - $rootScope.myModel1.status=$rootScope.followupDetails.StatusCode; + // $rootScope.myModel1.status=$rootScope.followupDetails.StatusCode; $rootScope.trackingStatus=response.data.statusDetails; + $rootScope.myModel1.assignStaff=$rootScope.followupDetails.AssignedTo; + $rootScope.staffDetails=response.data.staffDetails; + } else { swal("Failed!", response.data.message, "error"); } From 9e6d043ea41a1a2c74896572e7f6b67b2dcb0a5d Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 18 Jan 2018 17:52:50 +0530 Subject: [PATCH 3/8] course details changes done --- Apollo/assets/views/callTrackingFollowup.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Apollo/assets/views/callTrackingFollowup.html b/Apollo/assets/views/callTrackingFollowup.html index b424336f..a81e08c1 100755 --- a/Apollo/assets/views/callTrackingFollowup.html +++ b/Apollo/assets/views/callTrackingFollowup.html @@ -151,13 +151,26 @@ + + Assigned To + + + + Status -