diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 2afba12a..d757c011 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -318,4 +318,5 @@ $route['report_doc_pending'] = 'Report/doc_pending'; $route['report_wav_ref'] = 'Report/wav_ref'; $route['report_examfee'] = 'Report/examfee'; $route['report_balfee'] = 'Report/balfee'; +$route['report_lead'] = 'Report/lead'; diff --git a/Apollo/api/application/controllers/Report.php b/Apollo/api/application/controllers/Report.php index fd0be293..8a5eb136 100755 --- a/Apollo/api/application/controllers/Report.php +++ b/Apollo/api/application/controllers/Report.php @@ -310,6 +310,31 @@ class Report extends REST_Controller { } + } + public function lead_post() + { + $from = $this->post('from'); + $to = $this->post('to'); + $br = $this->post('branch'); + + $getStatus = $this->report_model->lead($from,$to,$br); + //print_r($getStatus); + if ($getStatus) + { + $getStatus['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getStatus, 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 + } + + } public function filters_post() { diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 5d391bb9..8fcab464 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -741,6 +741,48 @@ left join (SELECT StudentID as sid,UniversityID as uid,CourseID as cid,Enrollmen return $results; + } + public function lead($from=null,$to=null,$br=null){ + + $sql = "select InteractionID,date_format(ltf.CreatedOn,'%d-%m-%Y') as date,ltf.TrackingID as tid,ltf.FollowupOn as fup,ld.LeadName as name,ld.MobileNumber as mobile,lt.University as univ,lt.Course as course,lt.Course as prvStatus,list.ListName as prsStatus,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo +from T_Lead_Tracking_Followup as ltf + left join T_Lead_Tracking lt on lt.TrackingID=ltf.TrackingID + join T_Login l on l.ID=lt.AssignedTo + join T_StaffDetails sd on sd.StaffID=l.StaffID + left join T_Lead_Details ld on ld.LeadID=lt.LeadID + left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus + join T_PickListDetails list on list.ListCode=ltf.StatusName + where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID) and lt.CreatedBranch = '".$br."' + + "; + + if ($from and $to != ''){ + $fromd= date("Y-m-d",strtotime($from)); + $tod=date("Y-m-d",strtotime($to)); + + $sql.=" and date(ltf.CreatedOn) >= '".$fromd."' + and date(ltf.CreatedOn) <= '".$tod."'"; + + } + + + + + $leadDet=$this->db->query($sql); + $answer = $leadDet->result(); + + //echo $sql; + + if (count($answer) > 0) { + $results['leadList'] = true; + $results['lead_data'] = $answer; + } else { + $results['leadList'] = false; + $results['message'] = 'No record found'; + } + + return $results; + } } \ No newline at end of file diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index 2936f67c..6898b6e5 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -90,7 +90,8 @@ "doc_pending": "DOCUMENT PENDING STUDENT LIST REPORT", "wav_ref": "WAIVER AND REFERAL REPORT", "examfee": "EXAM WRITING FEE REPORT", - "balfee": "FEE BALANCE REPORT" + "balfee": "FEE BALANCE REPORT", + "lead": "LEAD TRACKING REPORT" }, "student": { diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index 16a9188a..165e47e5 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -216,6 +216,7 @@ app.constant('JS_REQUIRES', { 'report_waiver_referalCtrl':'assets/js/controllers/report_waiver_referalCtrl.js', 'report_examfeeCtrl':'assets/js/controllers/report_examfeeCtrl.js', 'report_balfeeCtrl':'assets/js/controllers/report_balfeeCtrl.js', + 'report_leadCtrl':'assets/js/controllers/report_leadCtrl.js', }, //*** angularJS Modules modules: [{ diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index e2b93790..053d2cf3 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -651,6 +651,12 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com resolve: loadSequence('ui.select','report_balfeeCtrl','ngTable', 'ladda', 'angular-ladda'), title: 'Balance Fee Report', + }).state('app.reports.lead', { + url: '/report_leadCtrl', + templateUrl: "assets/views/report_lead.html", + resolve: loadSequence('ui.select','report_leadCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'Lead Details Report', + }).state('app.hallTicket', { url: '/hallticket', template: '
HALLTICKET
', diff --git a/Apollo/assets/js/controllers/report_leadCtrl.js b/Apollo/assets/js/controllers/report_leadCtrl.js new file mode 100644 index 00000000..601838c7 --- /dev/null +++ b/Apollo/assets/js/controllers/report_leadCtrl.js @@ -0,0 +1,514 @@ +'use strict'; +/*** controller***/ +app.controller('report_leadCtrl', ["$scope", "$filter","$rootScope","$modal", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, $filter,$rootScope,$modal, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { + + /* + * auto call tracking/ + */ + $scope.userType=JSON.parse(localStorage.getItem('localObj')).localType; + $scope.myModel = { + + "date": new Date(), + "activity": "", + "assignedTo": "", + "status": "", + "referedBy": '', + "comments":'', + "enquiryStatus":'', + + "important":false, + "branch":"", + + }; + + //get current date + $scope.hideDateSearch=true; + $scope.modifyMinDate = moment(); + //$scope.minDate = $filter('date')($scope.modifyMinDate, 'MM-dd-yyyy'); + $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; + // console.log($scope.currentDate); + /** + * End of the call tracking + */ + // DataTables configurable options + + + $scope.filters = { + "branch": "", + "from_date": "", + "to_date": "", + + }; + + $scope.filters = function () { + var filterlist = { + method: 'POST', + url: apiPoint.url + 'report_filters/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + branch : JSON.parse(localStorage.getItem('localObj')).localBranchID + + } + + }; + $http(filterlist).then(function (response) { + if (response.data) { + $scope.batch=[]; + $scope.batchlist = response.data.batch; + $scope.university = response.data.university; + //Desc order Batchlist + angular.forEach($scope.batchlist,function (values,key) { + var parts = values.BatchDate.split("-"); + $scope.batch.push({ + "batchcode":values.batchcode, + "batch":values.batch + '('+ values.batchcode + ')', + "BatchDate":values.BatchDate, + "givenDateObject":new Date(parts[2], parts[1] - 1, parts[0]) + }) + }); + // call service for make a list in desc order based on date + $scope.batch=dateListDescService.getOrderByList($scope.batch); + //console.log($scope.branch); + } else { + } + }); + } + + $scope.onSubmit = function () { + //alert($scope.batch.name); + $scope.lead_data = ''; + $scope.message = ''; + var response_data = { + method: 'POST', + url: apiPoint.url + 'report_lead/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + branch: JSON.parse(localStorage.getItem('localObj')).localBranchID, + from : $scope.filters.from_date, + to : $scope.filters.to_date + } + + }; + + $http(response_data).then(function (response) { + if (response.data.leadList == true) { + $scope.lead_data = response.data.lead_data; + for(var i=0;i<$scope.lead_data.length;i++) + $scope.lead_data[i].SL_NO = i+1; + + } else { + $scope.message = response.data.message; + } + + }); + + } + var mystyle = { + sheetid: 'Lead REPORT', + headers: true, + caption: { + title:'Calls done on a Particular Day/Period - Report', + width: '300px', + style:'font-size:50px;' + }, + // style:'background:#00FF00', + column: { + style:'font-size:10px' + }, + + }; + + + + $scope.exportData = function () { + alasql('SELECT CAST(SL_NO AS NUMBER) as SLNO,date as Date,CAST(tid AS NUMBER) as TrackingID,fup as FollowupDate,name as Name,CAST(mobile AS NUMBER) as MobileNo,univ as University,course as Course,prsStatus as PresentStatus,cmnts as Comments,activity as Activity,AssignTo as AssignTo INTO XLS("Lead_Report.xls",?) FROM ?',[mystyle,$scope.lead_data]); + }; + + /*modal controller + * */ + app.controller('studentModalDemoCtrl', ["$scope","$rootScope", "$modal", "$log", "API_POINTS", "$http", function ($scope,$rootScope, $modal, $log, apiPoint, $http) { + //Tooltip for print button + $scope.dynamicTooltip = 'Student View'; + + + + // $scope.items = ['item1', 'item2', 'item3']; + + $scope.open = function (studentDetails) { + + + // get student view details + var getcourse = { + method: 'POST', + url: apiPoint.url + 'getStudentBasicInfo/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + requestedBy: studentDetails.Phone_number, + requestedFrom: 3, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID + } + }; + $http(getcourse).then(function (response) { + + if (response.data.status == 200 && response.data.studentStatus == true) { + $scope.courseEditLoading = false; + // $scope.studentDetails = response.data.studentDetails; + $scope.studentDetails = response.data; + // $scope.courseDetails = response.data.courseDetails; + var modalInstance = $modal.open({ + templateUrl: 'assets/views/student/studentDetailsModal.html', + controller: 'ModalInstanceCtrl', + // size: size, + resolve: { + items: function () { + return $scope.studentDetails; + } + } + }); + + modalInstance.result.then(function (selectedItem) { + $scope.selected = selectedItem; + }, function () { + $log.info('Modal dismissed at: ' + new Date()); + }); + + } else { + swal("Failed!", "This student is not registerd", "warning"); + $scope.courseEditLoading = false; + $scope.studentDetails = ""; + $scope.courseDetails = ""; + + } + }); + + + }; + $scope.open1 = function (values,type) { + + var modalInstance1 = $modal.open({ + templateUrl: 'assets/views/student/studentPaymentModal.html', + controller: 'ModalInstanceCtrl1', + // size: size, + resolve: { + items1: function () { + var myvalues = + { + "values":values, + "type":type + }; + return myvalues; + } + } + }); + + modalInstance1.result.then(function (selectedItem) { + $scope.selected = selectedItem; + }, function () { + $log.info('Modal dismissed at: ' + new Date()); + }); + }; + + $scope.printStudentDetails = function (details) { + $rootScope.pdfItems = details; + + var printInstance = $modal.open({ + templateUrl: 'assets/views/student/studentPdf.html', + controller: 'studentModalDemoCtrl', + }); + }; + + // generate pdf for student view + $scope.export = function(getName) { + kendo.drawing.drawDOM($("#exportthis")).then(function(group) { + kendo.drawing.pdf.saveAs(group, getName+".pdf"); + }); + } + + +}]); + +// Please note that $modalInstance represents a modal window (instance) dependency. +// It is not the same as the $modal service used above. + +app.controller('ModalInstanceCtrl', ["$scope", "$modalInstance", "items", "WordsService", function ($scope, $modalInstance, items, WordsService) { + + $scope.items = items; + $scope.selected = { + item: $scope.items[0] + }; + + $scope.ok = function () { + $modalInstance.close($scope.selected.item); + }; + + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; + + +}]); +app.controller('ModalInstanceCtrl1', ["$scope", "$modalInstance", "items1", "WordsService", function ($scope, $modalInstance, items1, WordsService) { + + $scope.items1 = items1.values; + $scope.selectedtype = items1.type; + + $scope.ok = function () { + $modalInstance.close($scope.selected.item); + }; + + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; + + +}]); + /** + * Auto Call Tracking Sriram + */ + $scope.selectedStudentsID = []; + $scope.isCheckAll = function(e){ + var val = (e.target.checked ? true : false); + if(val) + { + // $scope.disable = false; + var len = $scope.lead_data.length; + var i = 0; + for(i=0;iBalance Fee Report +
  • + + Lead Tracking Report + +
  • @@ -925,6 +930,11 @@ Balance Fee Report +
  • + + Lead Tracking Report + +
  • diff --git a/Apollo/assets/views/report_lead.html b/Apollo/assets/views/report_lead.html new file mode 100644 index 00000000..3325460b --- /dev/null +++ b/Apollo/assets/views/report_lead.html @@ -0,0 +1,157 @@ +
    +
    +
    +

    Calls done on a Particular Day/Period - Report

    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +
    +
    + + +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    SL.NoDateTracking IDFollowup DateNameMobile NoUniversityCoursePresent StatusCommentsActivityAssigned To
    {{p.SL_NO}}{{p.date}}{{p.tid}}{{p.fup}}{{p.name}}{{p.mobile}}{{p.univ}}{{p.course}}{{p.prsStatus}}{{p.cmnts}}{{p.activity}}{{p.AssignTo}}
    +

    {{message}}

    + +
    + + + +
    +
    \ No newline at end of file