diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index a47d030f..1862477e 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -97,6 +97,9 @@ $route['callAsImportantFlag'] = 'Call_Tracking_Controller/callAsImportantFlag'; $route['autoAddlead'] = 'Call_Tracking_Controller/autoAddlead'; $route['autoTrackingDetails'] = 'Call_Tracking_Controller/autoTrackingDetails'; +$route['getstaffcallDetails'] = 'Call_Tracking_Controller/getstaffcallDetails'; + + // university $route['insertUniversity'] = 'University_Controller/insertUniversity'; diff --git a/Apollo/api/application/controllers/Call_Tracking_Controller.php b/Apollo/api/application/controllers/Call_Tracking_Controller.php index 1425c328..590cdb64 100755 --- a/Apollo/api/application/controllers/Call_Tracking_Controller.php +++ b/Apollo/api/application/controllers/Call_Tracking_Controller.php @@ -513,6 +513,34 @@ public function autoTrackingDetails_post(){ // ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code // } } + + +public function getstaffcallDetails_post() +{ + $branchID = $this->post('branch'); + // $myDate = date('Y-m-d'); + + $myDate = $this->post('date'); + + $todaycalldetails = $this->Calltracking_model->GetStaffCallDetails($branchID,$myDate); + + + if($todaycalldetails) + { + $todaycalldetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($todaycalldetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } +} + + /* * End of call tracking */ diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index dda5f0ca..c72d1e6b 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -1637,4 +1637,41 @@ class Calltracking_model extends CI_Model { return $result; } + +public function GetStaffCallDetails($branchID,$myDate) +{ + $this->db->select('LeadName,LD.MobileNumber,IsNewEnquiry,StatusCode,Course,University,FollowupComments,FollowupOn,AssignedStaff,ListName,Firstname,Lastname'); + $this->db->from('T_Lead_Tracking_Followup LTF'); + $this->db->join('T_Lead_Tracking LT','LT.TrackingID=LTF.TrackingID'); + $this->db->join('T_Lead_Details LD','LD.LeadID=LT.LeadID'); + $this->db->join('T_Login L','L.ID=LT.AssignedTo'); + $this->db->join('T_StaffDetails SD','SD.StaffID=L.StaffID'); + $this->db->join('T_PickListDetails PLD','PLD.ListCode = LTF.StatusName'); + $this->db->where("date_format(LTF.CreatedOn,'%Y-%m-%d')=",$myDate); + $this->db->where('LT.CreatedBranch',$branchID); + $this->db->group_by('InteractionId'); + + $Details = $this->db->get()->result(); + + + // print_r($this->db->last_query());die(); + + if($Details) + { + $result_array['searchst'] = true; + $result_array['details'] = $Details; + } + else + { + $result_array['searchst'] = false; + $result_array['details'] = "No records found!"; + } + + return $result_array; + + +} + + + } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index 19c2b0a3..51d407b3 100755 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -567,7 +567,7 @@ $scope.trackingTodayno=0; } else if(response.data.trackingStatus == 1) { - console.log('hai'); + //console.log('hai'); } else { @@ -591,6 +591,115 @@ $scope.trackingTodayno=0; +$scope.SatffCallDetails=''; + +$scope.calldata=''; +$scope.GetstaffwiseDetails = function (date) +{ + +//console.log(date); + var getDetails = { + method: 'POST', + url: apiPoint.url + 'getstaffcallDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + + branch:JSON.parse(localStorage.getItem('localObj')).localBranchID, + date:date, + + } + }; + + $http(getDetails).then(function (response) { + + console.log(response.data.details); + + if (response.data.status == 200 && response.data.details !='No records found!' ) { + + $scope.SatffCallDetails=response.data.details; + $scope.callnodata=true; + $scope.calldata=false; + + + } else { + // swal("Failed!", "No details Availble", "warning"); + + $scope.calldata=true; + $scope.callnodata=false; + + console.log($scope.calldata); + + + } + + }); + +} + + $scope.filters = { + + "to_date": "", + + }; + + + + + +$scope.changeDate = function() +{ + + + var to = $scope.filters.to_date; + //alert(to); + + if(to !='') + { + + var t = new Date(to), + month = '' + (t.getMonth() + 1), + day = '' + t.getDate(), + year = t.getFullYear(); + + if (month.length < 2) month = '0' + month; + if (day.length < 2) day = '0' + day; + +var to_dt = [year, month ,day].join('-'); + +$scope.tod = to_dt; + + + +} + +else +{ + var date = new Date(); + var t = new Date(date), + month = '' + (t.getMonth() + 1), + day = '' + t.getDate(), + year = t.getFullYear(); + + if (month.length < 2) month = '0' + month; + if (day.length < 2) day = '0' + day; + +var to_dt = [year, month ,day].join('-'); + +$scope.tod = to_dt; + + +} + +//console.log($scope.tod); + + +$scope.GetstaffwiseDetails($scope.tod); + +} + + @@ -815,6 +924,14 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte } + + + + + + + + }]); /* * close tracking controller @@ -1144,6 +1261,8 @@ app.controller('callTrackingPendingCtrl', ["$scope","$rootScope","toaster", "$fi * */ $scope.init = function (myModel) { + //console.log('in') + /* if(isNaN(myModel.pendingDate)){ $scope.loadDate= $filter('date')(new Date(), 'yyyy-MM-dd'); diff --git a/Apollo/assets/views/callTrackingDetails.html b/Apollo/assets/views/callTrackingDetails.html index ccb61149..6adbfd99 100755 --- a/Apollo/assets/views/callTrackingDetails.html +++ b/Apollo/assets/views/callTrackingDetails.html @@ -668,6 +668,69 @@ + + + + +
+ +
+ + + +
+ +
+ +

+ + +
+
+
+
+
+
+

No Records Found !!

+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Staff NameUniversityCourseFollowup DateStudent NameMobile NumberFollow up CommentsStatus
{{p.Firstname}}{{p.Lastname}}{{p.University}}{{p.Course}}{{p.FollowupOn}}{{p.LeadName}}{{p.MobileNumber}}{{p.FollowupComments}}{{p.ListName}}
+ +
+
+
+ +