diff --git a/Apollo/api/application/config/constants.php b/Apollo/api/application/config/constants.php index af611e46..d5b452e4 100644 --- a/Apollo/api/application/config/constants.php +++ b/Apollo/api/application/config/constants.php @@ -88,6 +88,10 @@ defined('SUPER_ADMIN') OR define('SUPER_ADMIN','R004'); defined('ADMIN') OR define('ADMIN','R003'); defined('EMPLOYEE') OR define('EMPLOYEE','R002'); defined('STUDENT') OR define('STUDENT','R001'); +//status code +defined('OPEN') OR define('OPEN','S001'); +defined('CLOSE') OR define('CLOSE','S002'); +defined('REOPEN') OR define('REOPEN','S003'); //encript database table name defined('LOGIN') OR define('LOGIN','T_Login'); defined('BRANCH') OR define('BRANCH','T_BranchMaster'); diff --git a/Apollo/api/application/controllers/Call_Tracking_Controller.php b/Apollo/api/application/controllers/Call_Tracking_Controller.php index 6837b348..0b595a1b 100644 --- a/Apollo/api/application/controllers/Call_Tracking_Controller.php +++ b/Apollo/api/application/controllers/Call_Tracking_Controller.php @@ -38,7 +38,7 @@ class Call_Tracking_Controller extends REST_Controller { $this->methods['getTrackingDetails_post']['limit'] = 1000; // 50 requests per hour per user/key $this->methods['updateFollowupDetails_post']['limit'] = 1000; // 50 requests per hour per user/key $this->methods['loadFollowupDetails_post']['limit'] = 1000; // 50 requests per hour per user/key - + $this->methods['getDashboardCallTrack_post']['limit'] = 1000; // 50 requests per hour per user/key // load the model $this->load->model('Calltracking_model', 'Calltracking_model'); @@ -225,7 +225,32 @@ class Call_Tracking_Controller extends REST_Controller { } + /* + * get dash board call track details + * created by kms + * */ + public function getDashboardCallTrack_post() + { + $search['requestedBy'] = $this->post('requestedBy'); + $getdashBoardCallDetails = $this->Calltracking_model->getDashboardTrackingDetails($search); + if ($getdashBoardCallDetails) + { + $getdashBoardCallDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getdashBoardCallDetails, 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 + } + + + } } \ No newline at end of file diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index ce29f9b6..9bb82924 100644 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -398,6 +398,47 @@ class Calltracking_model extends CI_Model { $studeTrackID = $this->db->get(); return $studeTrackID->result(); } + /* + * used to get dash board call track details + * created by kms + * */ + public function getDashboardTrackingDetails($serach=null) + { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $todayFollowupDate=$now->format('d-m-Y'); + $follouwpDetails=$this->todayFollowupDetails($todayFollowupDate,'S001'); + if($follouwpDetails){ + $result_array['todayStatus']=true; + $result_array['todayFolloupDetails']=$follouwpDetails; + } + else{ + $result_array['todayStatus']=false; + $result_array['todayFolloupDetails']=""; + } + /* $follouwpPendingDetails=$this->getPendingFollowupDetails($todayFollowupDate,'S001'); +print_r($follouwpPendingDetails);die();*/ + return $result_array; + + } + /* + * get date wise followup details + * @params date and status and check status + * */ + public function todayFollowupDetails($todayDate=null,$status=null) + { + $this->db->distinct(); + $this->db->select('LD.LeadName,LD.MobileNumber,LT.TrackingID,LT.LeadID,PLD.ListCode,PLD.ListName,LTF.FollowupOn,LT.StatusCode,PLD1.ListName as statusListName'); + $this->db->from(LEAD_DETAILS.' as LD'); + $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); + $this->db->join(LEAD_TRACKING_FOLLOWUP.' as LTF', 'LTF.TrackingID = LT.TrackingID'); + $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.ActivityStatus'); + $this->db->join(PICK_LIST_DETAILS.' as PLD1', 'PLD1.ListCode = LT.StatusCode'); + $this->db->where('LTF.FollowupOn',$todayDate); + $this->db->where('LT.StatusCode',$status); + $this->db->order_by('LT.TrackingID','ASC'); + return $this->db->get()->result(); + } } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index 17e85291..c2c359f9 100644 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -1,304 +1,43 @@ 'use strict'; -/** - * controllers used for the dashboard -*/ -app.controller('SparklineCtrl', ["$scope", function ($scope) { - $scope.sales = [600, 923, 482, 1211, 490, 1125, 1487]; - $scope.earnings = [400, 650, 886, 443, 502, 412, 353]; - $scope.referrals = [4879, 6567, 5022, 5890, 9234, 7128, 4811]; -}]); +/** + * controllers for ng-table + * Simple table with sorting and filtering on AngularJS + */ -app.controller('VisitsCtrl', ["$scope", function ($scope) { +app.controller('dashboardCtrl', ["$scope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", function ($scope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state) { + /* + * used to get dash board call track details + * this method called from view ng-init directive + * created by kms + * */ + $scope.todayFolloupDetails=""; + $scope.initCallTracking = function () { + var getCallTrack = { + method: 'POST', + url: apiPoint.url + 'getDashboardCallTrack/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + } + }; + $http(getCallTrack).then(function (response) { + if (response.data.status==200) { + if(response.data.todayStatus){ + $scope.todayFolloupDetails=response.data.todayFolloupDetails; + } + else{ + $scope.todayFolloupDetails='EMPTY'; + } - $scope.data = { - labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - datasets: [ - { - label: 'My First dataset', - fillColor: 'rgba(220,220,220,0.2)', - strokeColor: 'rgba(220,220,220,1)', - pointColor: 'rgba(220,220,220,1)', - pointStrokeColor: '#fff', - pointHighlightFill: '#fff', - pointHighlightStroke: 'rgba(220,220,220,1)', - data: [65, 59, 80, 81, 56, 55, 40, 84, 64, 120, 132, 87] - }, - { - label: 'My Second dataset', - fillColor: 'rgba(151,187,205,0.2)', - strokeColor: 'rgba(151,187,205,1)', - pointColor: 'rgba(151,187,205,1)', - pointStrokeColor: '#fff', - pointHighlightFill: '#fff', - pointHighlightStroke: 'rgba(151,187,205,1)', - data: [28, 48, 40, 19, 86, 27, 90, 102, 123, 145, 60, 161] - } - ] - }; + } else { - $scope.options = { + $scope.todayFolloupDetails='EMPTY'; - maintainAspectRatio: false, - - // Sets the chart to be responsive - responsive: true, - - ///Boolean - Whether grid lines are shown across the chart - scaleShowGridLines: true, - - //String - Colour of the grid lines - scaleGridLineColor: 'rgba(0,0,0,.05)', - - //Number - Width of the grid lines - scaleGridLineWidth: 1, - - //Boolean - Whether the line is curved between points - bezierCurve: false, - - //Number - Tension of the bezier curve between points - bezierCurveTension: 0.4, - - //Boolean - Whether to show a dot for each point - pointDot: true, - - //Number - Radius of each point dot in pixels - pointDotRadius: 4, - - //Number - Pixel width of point dot stroke - pointDotStrokeWidth: 1, - - //Number - amount extra to add to the radius to cater for hit detection outside the drawn point - pointHitDetectionRadius: 20, - - //Boolean - Whether to show a stroke for datasets - datasetStroke: true, - - //Number - Pixel width of dataset stroke - datasetStrokeWidth: 2, - - //Boolean - Whether to fill the dataset with a colour - datasetFill: true, - - // Function - on animation progress - onAnimationProgress: function () { }, - - // Function - on animation complete - onAnimationComplete: function () { }, - - //String - A legend template - legendTemplate: '
We are building something very cool stay tuned and be patient. your patience will be well paid
- +| Tracking ID | +Lead Name | +Mobile No | +Activity | +Status | + +|
|---|---|---|---|---|---|
| {{today.TrackingID}} | +{{today.LeadName}} | +{{today.MobileNumber}} | +{{today.ListName}} | +{{today.statusListName}} | +{{today.statusListName}} | + + + +
| Tracking ID | +Lead Name | +Mobile No | +Activity | +Status | + +|
|---|---|---|---|---|---|
| {{today.TrackingID}} | +{{today.LeadName}} | +{{today.MobileNumber}} | +{{today.ListName}} | +{{today.statusListName}} | +{{today.statusListName}} | + + + +