From 9c4a5e9ecf4069ad15d9c0988cdbed03b912fbee Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 1 Dec 2017 13:13:10 +0530 Subject: [PATCH 1/6] commit the tracking model changes --- .../application/models/Calltracking_model.php | 137 +++++------------- 1 file changed, 37 insertions(+), 100 deletions(-) diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index d3a02289..e562f4bc 100644 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -15,11 +15,9 @@ class Calltracking_model extends CI_Model { * */ public function getLeadDetails($requestedBy=null,$mobileNumber=null) { - $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,US.UniversityID,US.UniversityName,CU.CourseID,CU.CourseName'); + $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,LT.University,LT.Course'); $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); - $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = LT.University'); - $this->db->join(COURSE.' as CU', 'CU.CourseID = LT.Course'); $this->db->where('LD.MobileNumber',$mobileNumber); $leadDet=$this->db->get()->last_row(); $result_array = []; @@ -27,20 +25,38 @@ class Calltracking_model extends CI_Model { $result_array['existLeadDetails']=$leadDet; } else{ - $leadDet['LeadName']=""; - $leadDet['MobileNumber']=$mobileNumber; - $leadDet['IsNewEnquiry']="1"; - $leadDet['UniversityID']=""; - $leadDet['UniversityName']=""; - $leadDet['CourseID']=""; - $leadDet['CourseName']=""; - $leadDet['ActivityStatus']=""; - $leadDet['AssignedTo']=""; - $leadDet['StatusCode']=""; - $result_array['existLeadDetails']=$leadDet; + $this->db->select('ST.MobileNumber,ST.Firstname,US.UniversityName,CU.CourseName'); + $this->db->from(STUDENTS.' as ST'); + $this->db->join(STUDENTCOURSE.' as STC', 'ST.StudentID = STC.StudentID'); + $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID'); + $this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID'); + $this->db->where('ST.MobileNumber',$mobileNumber); + $enrolledStudDet=$this->db->get()->last_row(); + if($enrolledStudDet) { + $leadDet['LeadName'] = $enrolledStudDet->Firstname; + $leadDet['MobileNumber'] = $enrolledStudDet->MobileNumber; + $leadDet['IsNewEnquiry'] = "1"; + $leadDet['University'] = $enrolledStudDet->UniversityName; + $leadDet['Course'] = $enrolledStudDet->CourseName; + $leadDet['ActivityStatus'] = ""; + $leadDet['AssignedTo'] = ""; + $leadDet['StatusCode'] = ""; + $result_array['existLeadDetails'] = $leadDet; + } + else{ + $leadDet['LeadName'] = ""; + $leadDet['MobileNumber'] = ""; + $leadDet['IsNewEnquiry'] = "1"; + $leadDet['University'] = ""; + $leadDet['Course'] = ""; + $leadDet['ActivityStatus'] = ""; + $leadDet['AssignedTo'] = ""; + $leadDet['StatusCode'] = ""; + $result_array['existLeadDetails'] = $leadDet; + } } // store lead,university and course details in comman array - $result_array['universityDetails']=$this->getUniversityDetails(); + //$result_array['universityDetails']=$this->getUniversityDetails(); $result_array['activityDetails']=$this->getActivityDetails(); $result_array['statusDetails']=$this->getStatus(); $result_array['staffDetails']=$this->getStaff("1"); @@ -208,11 +224,9 @@ class Calltracking_model extends CI_Model { public function getTrackingDetails($search=null) { - $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,US.UniversityID,US.UniversityName,CU.CourseID,CU.CourseName,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,PLD.ListCode,PLD.ListName'); + $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,LT.University,LT.Course,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,PLD.ListCode,PLD.ListName'); $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); - $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = LT.University'); - $this->db->join(COURSE.' as CU', 'CU.CourseID = LT.Course'); $this->db->join(LOGIN.' as LO', 'LO.ID = LT.AssignedTo'); $this->db->join(STAFF.' as ST', 'ST.StaffID = LO.StaffID'); $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.ActivityStatus'); @@ -241,10 +255,8 @@ class Calltracking_model extends CI_Model { $tracking_array["Firstname"]=$row->Firstname; $tracking_array["StatusCode"]=$row->StatusCode; $tracking_array["statusListName"]=$row->statusListName; - $tracking_array["UniversityID"]=$row->UniversityID; - $tracking_array["UniversityName"]=$row->UniversityName; - $tracking_array["CourseID"]=$row->CourseID; - $tracking_array["CourseName"]=$row->CourseName; + $tracking_array["UniversityName"]=$row->University; + $tracking_array["CourseName"]=$row->Course; $tracking_array["ListCode"]=$row->ListCode; $tracking_array["ListName"]=$row->ListName; // $tracking_array["followupDetails"]=$this->getTrackingFollowup($row->TrackingID); @@ -261,9 +273,6 @@ class Calltracking_model extends CI_Model { } } - - - return $result_array; } @@ -324,11 +333,9 @@ class Calltracking_model extends CI_Model { public function getLoadFollowupDetails($trackingID) { - $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,US.UniversityID,US.UniversityName,CU.CourseID,CU.CourseName,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,PLD.ListCode,PLD.ListName'); + $this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,LT.University,LT.Course,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,PLD.ListCode,PLD.ListName'); $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); - $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = LT.University'); - $this->db->join(COURSE.' as CU', 'CU.CourseID = LT.Course'); $this->db->join(LOGIN.' as LO', 'LO.ID = LT.AssignedTo'); $this->db->join(STAFF.' as ST', 'ST.StaffID = LO.StaffID'); $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.ActivityStatus'); @@ -353,10 +360,8 @@ class Calltracking_model extends CI_Model { $tracking_array["Firstname"]=$row->Firstname; $tracking_array["StatusCode"]=$row->StatusCode; $tracking_array["statusListName"]=$row->statusListName; - $tracking_array["UniversityID"]=$row->UniversityID; - $tracking_array["UniversityName"]=$row->UniversityName; - $tracking_array["CourseID"]=$row->CourseID; - $tracking_array["CourseName"]=$row->CourseName; + $tracking_array["UniversityName"]=$row->University; + $tracking_array["CourseName"]=$row->Course; $tracking_array["ListCode"]=$row->ListCode; $tracking_array["ListName"]=$row->ListName; $tracking_array["followupDetails"]=$this->getTrackingFollowup($row->TrackingID); @@ -529,72 +534,4 @@ class Calltracking_model extends CI_Model { } } - - /* - * 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->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 6d848dedab235485fcba4c63f2ef604443f39e5c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 1 Dec 2017 13:13:56 +0530 Subject: [PATCH 2/6] course details changes done --- .../assets/js/controllers/callTrackingCtrl.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index daf9740e..50075b39 100644 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -105,7 +105,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", data: { studentName: myModel.studentName, mobileNumber: myModel.mobileNumber, - universityID: myModel.universityName.universityID, + universityID: myModel.universityName, courseName: myModel.courseName, date: $scope.nextFollowupDate, activity: myModel.activity, @@ -165,11 +165,6 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", //call form success if(form.mobilenumber.$valid){ $scope.loading=true; - /* $scope.ldloading2 = {}; - - $scope.ldloading2[loading.replace('-', '_')] = true;*/ - - var lead = { method: 'POST', url: apiPoint.url + 'getTrackingLeadDetails/', @@ -183,29 +178,28 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", }; $http(lead).then(function (response) { if (response.data.status==200) { - $scope.myModel.courseName=response.data.existLeadDetails.CourseID; $scope.myModel.enquiryStatus=response.data.existLeadDetails.IsNewEnquiry; $scope.activity=response.data.activityDetails; $scope.status=response.data.statusDetails; $scope.staffDetails=response.data.staffDetails; - $scope.university=response.data.universityDetails; - + //$scope.university=response.data.universityDetails; $scope.myModel.status=$scope.status[0].ListCode; $scope.myModel.studentName=response.data.existLeadDetails.LeadName; + $scope.myModel.universityName=response.data.existLeadDetails.University; + $scope.myModel.courseName=response.data.existLeadDetails.Course; // find index for university drop down list - for(var i in $scope.university) { + /* for(var i in $scope.university) { if($scope.university[i].universityID==response.data.existLeadDetails.UniversityID){ $scope.myModel.universityName=$scope.university[i]; } - } + }*/ $scope.loading=false; } else { $scope.loading=false; - $scope.myModel.universityName=""; } }); From ab87914281c658da5ee58a23cb9c69ac73225ef1 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 1 Dec 2017 13:14:10 +0530 Subject: [PATCH 3/6] course details changes done --- Apollo/assets/views/callTrackingDetails.html | 40 +++++++------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/Apollo/assets/views/callTrackingDetails.html b/Apollo/assets/views/callTrackingDetails.html index 4ecf2f8b..0764dd12 100644 --- a/Apollo/assets/views/callTrackingDetails.html +++ b/Apollo/assets/views/callTrackingDetails.html @@ -156,14 +156,6 @@ - - - - - - - - @@ -255,18 +247,15 @@
-
@@ -283,16 +272,15 @@
-
From 4002e2ca89137f8b82f0be2adf02a5a1ec91b002 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 1 Dec 2017 13:56:00 +0530 Subject: [PATCH 4/6] update call tracking controller --- Apollo/assets/js/controllers/callTrackingCtrl.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index 50075b39..b9dd4d59 100644 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -20,10 +20,14 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", "enquiryStatus":'' }; - //get current date $scope.hideDateSearch=true; $scope.currentDate=$filter('date')(new Date(), 'dd-MM-yyyy'); + // get 30 plus date for follwup details + $scope.modifyDate = moment(); + $scope.modifyDate.add(30, 'days'); + $scope.futureDate = $filter('date')($scope.modifyDate, 'dd-MM-yyyy'); + $scope.myModel.date=$scope.currentDate; $scope.search=$scope.currentDate; $scope.myModel.searchDate=$scope.currentDate; @@ -361,6 +365,10 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", $rootScope.currentDate1=new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2); $rootScope.myModel1.date=$rootScope.followupDetails.followupDetails[0].FollowupOn; + // get 30 plus date for follwup details + $rootScope.modifyDate1 = moment(); + $rootScope.modifyDate1.add(30, 'days'); + $rootScope.futureDate1 = $filter('date')($scope.modifyDate1, 'dd-MM-yyyy'); $rootScope.myModel1.status=$rootScope.followupDetails.StatusCode; $rootScope.trackingStatus=response.data.statusDetails; } else { From ace7669bd1efb4d678f0470578db555b573bf96c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 1 Dec 2017 14:36:02 +0530 Subject: [PATCH 5/6] course details changes done --- Apollo/assets/views/callTrackingFollowup.html | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Apollo/assets/views/callTrackingFollowup.html b/Apollo/assets/views/callTrackingFollowup.html index 1d1caf0c..c65f9e5d 100644 --- a/Apollo/assets/views/callTrackingFollowup.html +++ b/Apollo/assets/views/callTrackingFollowup.html @@ -107,7 +107,7 @@ datepicker-options="dateOptions" placeholder="Select Date" min-date="currentDate1" - max-date="minStartDate" + max-date="futureDate1" close-text="Close" required="required"/> Date is required. @@ -146,12 +146,8 @@
-
- - - - -
    +
    +
    • @@ -171,6 +167,7 @@
    +
@@ -244,7 +241,7 @@
-
+
  • From 381cf2886fe7d3dda745dc426834a248d3a7fdd9 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 1 Dec 2017 14:36:24 +0530 Subject: [PATCH 6/6] course details changes done --- Apollo/assets/views/callTrackingDetails.html | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Apollo/assets/views/callTrackingDetails.html b/Apollo/assets/views/callTrackingDetails.html index 0764dd12..7b3de802 100644 --- a/Apollo/assets/views/callTrackingDetails.html +++ b/Apollo/assets/views/callTrackingDetails.html @@ -15,6 +15,7 @@ } +
    @@ -102,9 +103,10 @@
    + - + @@ -126,12 +128,12 @@ - + - + @@ -140,13 +142,17 @@ - + + @@ -305,7 +311,7 @@ datepicker-options="dateOptions" placeholder="Select Date" min-date="currentDate" - max-date="minStartDate" + max-date="futureDate" close-text="Close" required="required"/> Date is required.
    Tracking ID Assigned To Status
    {{p.TrackingID}} {{p.followupDetails }} {{p.LeadName}}{{p.CourseName }} {{p.ListName}} {{p.Firstname}} + + +