From 208535b42d88f0a9b728b786b34797e208a5c062 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 30 Nov 2017 18:13:59 +0530 Subject: [PATCH 1/4] changes in course --- Apollo/assets/js/controllers/dashboardCtrl.js | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index c2c359f9..c905b8a2 100644 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -10,7 +10,7 @@ app.controller('dashboardCtrl', ["$scope","toaster", "$filter", "ngTableParams", * this method called from view ng-init directive * created by kms * */ - $scope.todayFolloupDetails=""; + $scope.initCallTracking = function () { var getCallTrack = { method: 'POST', @@ -25,15 +25,38 @@ app.controller('dashboardCtrl', ["$scope","toaster", "$filter", "ngTableParams", $http(getCallTrack).then(function (response) { if (response.data.status==200) { if(response.data.todayStatus){ - $scope.todayFolloupDetails=response.data.todayFolloupDetails; + + $scope.todayFolloupDetails=response.data.todayFolloupDetails.trackingDetails; + $scope.emptyDataToday=false; } else{ - $scope.todayFolloupDetails='EMPTY'; + $scope.todayFolloupDetails=""; + $scope.emptyDataToday=true; } + if(response.data.todayPendingStatus){ + $scope.pendingFolloupDetails=response.data.PendingFolloupDetails.trackingDetails; + $scope.emptyDataPending=false; + } + else{ + $scope.pendingFolloupDetails=""; + $scope.emptyDataPending=true; + } + if(response.data.todayLeadStatus){ + $scope.leadDetails=response.data.todayLeadDetails.trackingDetails; + $scope.emptyDataLead=false; + } + else{ + $scope.leadDetails=""; + $scope.emptyDataLead=true; + } + + + } else { - $scope.todayFolloupDetails='EMPTY'; + $scope.emptyDataToday=true; + $scope.emptyDataPending=true; } }); From 26d43b6bd85222c72da5a3d26113690279b379f2 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 30 Nov 2017 18:14:52 +0530 Subject: [PATCH 2/4] changes in course --- Apollo/assets/views/dashboard.html | 76 ++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/Apollo/assets/views/dashboard.html b/Apollo/assets/views/dashboard.html index 0d256d51..4ff1136e 100644 --- a/Apollo/assets/views/dashboard.html +++ b/Apollo/assets/views/dashboard.html @@ -16,17 +16,18 @@
+
-
+

Today Follow Up Details

-
+
No Followup!
-
+
@@ -59,13 +60,16 @@
-
+

Pending Follow Up Details

-
+
+
No Pending Followup!
+
+
@@ -73,22 +77,20 @@ + - + - - - - - - - - - + + + + + + @@ -97,5 +99,49 @@ + + +
+
+
+
+

Today Created Lead Details

+ +
+
+
+
No Lead Created By Today!
+
+
+
Lead Name Mobile No ActivityFollowup On Status
{{today.TrackingID}}{{today.LeadName}}{{today.MobileNumber}}{{today.ListName}}{{pending.TrackingID}}{{pending.LeadName}}{{pending.MobileNumber}}{{pending.ListName}}{{pending.FollowupOn}}
+ + + + + + + + + + + + + + + + + + + + + + + +
Tracking IDLead NameMobile NoActivityFollowup OnStatus
{{lead.TrackingID}}{{lead.LeadName}}{{lead.MobileNumber}}{{lead.ListName}}{{lead.FollowupOn}}
+
+
+
+
+
From fa79b6e74b6da13f5c79dc9637d61c0f0aa64be9 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 30 Nov 2017 18:15:08 +0530 Subject: [PATCH 3/4] changes in course --- .../application/models/Calltracking_model.php | 170 +++++++++++++++++- 1 file changed, 161 insertions(+), 9 deletions(-) diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 9bb82924..6583c9f4 100644 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -118,7 +118,7 @@ class Calltracking_model extends CI_Model { public function getStatus() { $this->db->select('ListCode,ListName'); - $this->db->where('ListCode !=','S003'); + $this->db->where('ListCode !=',REOPEN); $this->db->where('ListGroup','1'); $this->db->order_by('ListCode','ASC'); $status = $this->db->get(PICK_LIST_DETAILS); @@ -407,7 +407,9 @@ class Calltracking_model extends CI_Model { $now = new DateTime(); $now->setTimezone(new DateTimezone('Asia/Kolkata')); $todayFollowupDate=$now->format('d-m-Y'); - $follouwpDetails=$this->todayFollowupDetails($todayFollowupDate,'S001'); + + $todayDateTime=$now->format('Y-m-d'); + $follouwpDetails=$this->todayFollowupDetails($todayFollowupDate,CLOSE,'1'); if($follouwpDetails){ $result_array['todayStatus']=true; $result_array['todayFolloupDetails']=$follouwpDetails; @@ -417,8 +419,28 @@ class Calltracking_model extends CI_Model { $result_array['todayFolloupDetails']=""; } - /* $follouwpPendingDetails=$this->getPendingFollowupDetails($todayFollowupDate,'S001'); -print_r($follouwpPendingDetails);die();*/ + $follouwpPendingDetails=$this->todayFollowupDetails($todayFollowupDate,CLOSE,'2'); + + if($follouwpPendingDetails){ + $result_array['todayPendingStatus']=true; + $result_array['PendingFolloupDetails']=$follouwpPendingDetails; + } + else{ + $result_array['todayPendingStatus']=false; + $result_array['PendingFolloupDetails']=""; + + } + $todayLeadDetails=$this->todayFollowupDetails($todayDateTime,OPEN,'3'); + if($todayLeadDetails){ + $result_array['todayLeadStatus']=true; + $result_array['todayLeadDetails']=$todayLeadDetails; + } + else{ + $result_array['todayLeadStatus']=false; + $result_array['todayLeadDetails']=""; + + } + return $result_array; } @@ -426,19 +448,149 @@ print_r($follouwpPendingDetails);die();*/ * get date wise followup details * @params date and status and check status * */ - public function todayFollowupDetails($todayDate=null,$status=null) + public function todayFollowupDetails($todayDate=null,$status=null,$check=null) { $this->db->distinct(); + $this->db->select('LT.TrackingID'); + $this->db->from(LEAD_DETAILS.' as LD'); + $this->db->from(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); + $this->db->order_by('LT.TrackingID','ASC'); + if($check!='3'){ + $this->db->where('LT.StatusCode !=',$status); + } + else if($check=='3'){ + $this->db->like('LD.CreatedOn', $todayDate, 'after'); + } + + $leadDetails=$this->db->get(); + if($leadDetails){ + $result_array = array(); + foreach ($leadDetails->result() as $row){ + $this->db->select('LTF.TrackingID,LTF.InteractionId'); + $this->db->from(LEAD_TRACKING_FOLLOWUP.' as LTF'); + $this->db->where('LTF.TrackingID',$row->TrackingID); + $lastFollowpID=$this->db->get()->last_row(); + // get last followup details date wise + $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.InteractionId',$lastFollowpID->InteractionId); + + // check today date based follwup details + if($check=='1'){ + $this->db->where('LTF.FollowupOn',$todayDate); + $this->db->where('LT.StatusCode !=',$status); + } + // check today date based pending followp details + else if($check=='2'){ + $this->db->where('LTF.FollowupOn <= ',$todayDate); + $this->db->where('LT.StatusCode !=',$status); + } + else if($check=='3'){ + $this->db->like('LD.CreatedOn', $todayDate, 'after'); + } + $trackDetails=$this->db->get(); + foreach ($trackDetails->result() as $row1) + { + $tracking_array["LeadID"]=$row1->LeadID; + $tracking_array["LeadName"]=$row1->LeadName; + $tracking_array["MobileNumber"]=$row1->MobileNumber; + $tracking_array["TrackingID"]=$row1->TrackingID; + $tracking_array["FollowupOn"]=$row1->FollowupOn; + $tracking_array["StatusCode"]=$row1->StatusCode; + $tracking_array["statusListName"]=$row1->statusListName; + $tracking_array["ListCode"]=$row1->ListCode; + $tracking_array["ListName"]=$row1->ListName; + + + $result[]=$tracking_array; + + + } + + + + } + $result_array['trackingDetails']=$result; + return $result_array; + + } + + else{ + return false; + } + + } + + /* + * get today created lead details for dashboard + * @params today date + * created by kms + * */ + public function todayLeadDetails($todayDate=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(); + $this->db->like('LD.CreatedOn', $todayDate, 'after'); + $this->db->order_by('LT.TrackingID','DESC'); + + return $this->db->get()->result();*/ + + $this->db->distinct(); + $this->db->select('LT.TrackingID,LD.LeadID'); + $this->db->from(LEAD_DETAILS.' as LD'); + $this->db->from(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); + $this->db->order_by('LD.LeadID','DESC'); + $this->db->like('LD.CreatedOn', $todayDate, 'after'); + $leadDetails=$this->db->get(); + if($leadDetails){ + foreach ($leadDetails->result() as $row){ + $this->db->select('LTF.TrackingID,LTF.InteractionId'); + $this->db->from(LEAD_TRACKING_FOLLOWUP.' as LTF'); + $this->db->where('LTF.TrackingID',$row->TrackingID); + $lastFollowpID=$this->db->get()->last_row(); + // get last followup details date wise + $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.InteractionId',$lastFollowpID->InteractionId); + foreach ($trackDetails->result() as $row1) + { + $tracking_array["LeadID"]=$row1->LeadID; + $tracking_array["LeadName"]=$row1->LeadName; + $tracking_array["MobileNumber"]=$row1->MobileNumber; + $tracking_array["TrackingID"]=$row1->TrackingID; + $tracking_array["FollowupOn"]=$row1->FollowupOn; + $tracking_array["StatusCode"]=$row1->StatusCode; + $tracking_array["statusListName"]=$row1->statusListName; + $tracking_array["ListCode"]=$row1->ListCode; + $tracking_array["ListName"]=$row1->ListName; + + $result[]=$tracking_array; + + + } + + } + } + + else{ + return false; + } + } } \ No newline at end of file From 1cd46de68de0c4b44691ac8cf148a0a850a37d61 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 30 Nov 2017 18:17:07 +0530 Subject: [PATCH 4/4] changes in course --- Apollo/assets/views/dashboard.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollo/assets/views/dashboard.html b/Apollo/assets/views/dashboard.html index 4ff1136e..e809332f 100644 --- a/Apollo/assets/views/dashboard.html +++ b/Apollo/assets/views/dashboard.html @@ -105,7 +105,7 @@
-

Today Created Lead Details

+

Today Created Lead Details