diff --git a/Apollo/api/application/controllers/Call_Tracking_Controller.php b/Apollo/api/application/controllers/Call_Tracking_Controller.php index 78af826d..72211877 100755 --- a/Apollo/api/application/controllers/Call_Tracking_Controller.php +++ b/Apollo/api/application/controllers/Call_Tracking_Controller.php @@ -156,6 +156,10 @@ class Call_Tracking_Controller extends REST_Controller { // print_r( $search['searchDate']); $search['CreatedBranch'] = $this->post('branchId'); + // $search['callTrackingaccess'] = $this->post('callTrackingaccess'); + + // echo $search['callTrackingaccess'];die(); + $status=$this->post('status'); // $search['searchMobileNumber'] = $this->post('searchMobileNumber'); diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 42753040..707f8b22 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -269,7 +269,7 @@ class Calltracking_model extends CI_Model { // $this->db->where('STB.BranchCode',$branchID); // $this->db->where('LO.ID',$requestedBy); // } - if(($userType== SUPER_ADMIN)||($CallModuleAccess == '1')){ + if(($userType== SUPER_ADMIN)||($userType== ADMIN)||($CallModuleAccess == '1')){ $this->db->where('STB.BranchCode',$branchID); } @@ -543,7 +543,7 @@ class Calltracking_model extends CI_Model { $branch = $search['CreatedBranch']; //echo $branch;die(); - // echo $search['requestedDept'] ;die(); + // echo $search['requestedDept'] ;die(); $EMPID = ''; @@ -583,7 +583,7 @@ class Calltracking_model extends CI_Model { } - // echo $CallModuleAccess;die(); + //echo $CallModuleAccess;die(); @@ -605,12 +605,29 @@ class Calltracking_model extends CI_Model { } // if (($search['requestedDept'] == EMPLOYEE)||($search['requestedDept'] == TRAINEE)){ - if (($CallModuleAccess == '0')&&($search['requestedDept'] != SUPER_ADMIN)){ + // if (($CallModuleAccess == '0')&&(($search['requestedDept'] != SUPER_ADMIN)||($search['requestedDept'] != ADMIN))){ + + // $this->db->where('LT.AssignedTo', $search['requestedBy']); + + // } + + if($CallModuleAccess == '0') + { + if (($search['requestedDept'] == EMPLOYEE)||($search['requestedDept'] == TRAINEE)) + { + + $this->db->where('LT.AssignedTo', $search['requestedBy']); + $this->db->where('LT.CreatedBranch', $search['CreatedBranch']); + } + } + + + + + + - $this->db->where('LT.AssignedTo', $search['requestedBy']); - // $this->db->where('LT.CreatedBranch', $search['CreatedBranch']); - } if($search['searchDate']!='' OR $search['searchDate']!=null){ /* if(sizeof($search['searchDate']) == '1'){ $this->db->where('LTF.FollowupOn <= ', $search['searchDate'][0]); @@ -631,7 +648,7 @@ class Calltracking_model extends CI_Model { $leadDet=$this->db->get(); - // print_r($this->db->last_query());die(); + // print_r($this->db->last_query());die(); if($this->db->affected_rows()==0){ $result_array['trackingStatus']=false; @@ -798,11 +815,28 @@ class Calltracking_model extends CI_Model { } // if ($search['requestedDept'] == EMPLOYEE - if (($CallModuleAccess == '0')&& ($search['requestedDept'] != SUPER_ADMIN)){ - $this->db->where('LT.AssignedTo', $search['requestedBy']); - $this->db->where('LT.CreatedBranch', $search['CreatedBranch']); + // if (($CallModuleAccess == '0')&& ($search['requestedDept'] != SUPER_ADMIN)){ + // $this->db->where('LT.AssignedTo', $search['requestedBy']); + // $this->db->where('LT.CreatedBranch', $search['CreatedBranch']); + + // } + + + if($CallModuleAccess == '0') + { + if (($search['requestedDept'] == EMPLOYEE)||($search['requestedDept'] == TRAINEE)) + { + + $this->db->where('LT.AssignedTo', $search['requestedBy']); + $this->db->where('LT.CreatedBranch', $search['CreatedBranch']); + } + } + + + + + - } if(($search['searchDate']!='' OR $search['searchDate']!=null) AND sizeof($search['searchDate']) == '1'){ // $this->db->where('LTF.FollowupOn <= ', $search['searchDate'][0]); @@ -1012,17 +1046,32 @@ class Calltracking_model extends CI_Model { // if ($trackingID['requestedDept'] == EMPLOYEE){ - if (($CallModuleAccess == '0')&& ($trackingID['requestedDept'] != SUPER_ADMIN)){ + // if (($CallModuleAccess == '0')&& ($trackingID['requestedDept'] != SUPER_ADMIN)){ + + // $this->db->where('LT.AssignedTo', $trackingID['UpdatedBy']); + // $this->db->where('LT.CreatedBranch', $trackingID['CreatedBranch']); + + // } + + + if($CallModuleAccess == '0') + { + if (($trackingID['requestedDept'] == EMPLOYEE)||($trackingID['requestedDept'] == TRAINEE)) + { + + $this->db->where('LT.AssignedTo', $trackingID['UpdatedBy']); + $this->db->where('LT.CreatedBranch', $trackingID['CreatedBranch']); + } + } + + - $this->db->where('LT.AssignedTo', $trackingID['UpdatedBy']); - $this->db->where('LT.CreatedBranch', $trackingID['CreatedBranch']); - } $leadDet=$this->db->get(); - // print_r($this->db->last_query());die(); +// print_r($this->db->last_query());die(); //print_r($leadDet->result());die(); diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index a09f00d2..84d2cdae 100755 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -490,6 +490,7 @@ $scope.trackingTodayno=0; requestedDept: JSON.parse(localStorage.getItem('localObj')).localType, branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, searchDate: $scope.finalSearchArry, + callTrackingaccess : JSON.parse(localStorage.getItem('localObj')).is_CalltrackApproval_Access, status: $scope.status } }; diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index 96f22ed0..d89f3468 100755 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -140,7 +140,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " $scope.univ = response.data.univ; $scope.fyr = response.data.fyr; - console.log($scope.branch); + // console.log($scope.branch); } else { $scope.message = response.data.message; @@ -836,7 +836,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " } }; - console.log(JSON.parse(localStorage.getItem('localObj')).localType); + // console.log(JSON.parse(localStorage.getItem('localObj')).localType); $http(fpending).then(function (response) { if (response.data.lList == true) { @@ -859,7 +859,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " } else { $scope.Dt_fpending = $scope.fpending; - console.log($scope.Dt_fpending); + // console.log($scope.Dt_fpending); // console.log('else'); } } else { @@ -1108,7 +1108,7 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " for (var i = 0; i < $scope.fout.length; i++) // $scope.fout[i].Sl_No = i + 1; $scope.fo = false; - console.log($scope.fout); + //console.log($scope.fout); } else { $scope.fo = true; $scope.message = response.data.message; @@ -1204,8 +1204,8 @@ app.controller('dashboardCtrl', ["$scope", "$rootScope", "toaster", "$filter", " } }; - console.log($scope.filters.fout_year); - console.log(JSON.parse(localStorage.getItem('localObj')).localBranchID); + // console.log($scope.filters.fout_year); + //console.log(JSON.parse(localStorage.getItem('localObj')).localBranchID); $http(admissionYear).then(function (response) { if (response.data.lList == true) { $scope.adYear = response.data.l_data; diff --git a/Apollo/assets/js/controllers/sessionCtrl.js b/Apollo/assets/js/controllers/sessionCtrl.js index 105c9ea6..32772fda 100755 --- a/Apollo/assets/js/controllers/sessionCtrl.js +++ b/Apollo/assets/js/controllers/sessionCtrl.js @@ -202,20 +202,25 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage", }); }; - $scope.upDateLocalBran = function (Id, listCode, financeAccess,calltrackAccess) { //console.log(calltrackAccess);return false; +var call = calltrackAccess; + +//alert(call) localDetail.localBranchID = Id; localDetails.localBranchID = Id; localDetail.localType = listCode; localDetails.localType = listCode; localDetail.is_DayBookApproval_Access = financeAccess; localDetails.is_DayBookApproval_Access = financeAccess; - localDetails.is_CalltrackApproval_Access = calltrackAccess; + localDetail.is_CalltrackApproval_Access = call; + localDetails.is_CalltrackApproval_Access = call; + ipCookie('cookiechk', localDetails, { expires: 21 }); localStorage.setItem('localObj', JSON.stringify(localDetail)); $window.location.reload(); - // alert(JSON.stringify(localDetail)); + //alert(JSON.stringify(localDetail)); + } }]); diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index ddbea47b..8e5b42b8 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -3,6 +3,8 @@ + + -