From 5f4ea6b0dafba9803c212c4bff65f389aa84bbc3 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 20 Aug 2018 17:35:15 +0530 Subject: [PATCH] new registration report --- Apollo/api/application/config/constants.php | 7 +- Apollo/api/application/config/routes.php | 4 + Apollo/api/application/controllers/Report.php | 59 +++++ .../api/application/models/Reports_model.php | 77 +++++++ Apollo/assets/i18n/en.json | 3 +- Apollo/assets/js/config.constant.js | 4 + Apollo/assets/js/config.router.js | 8 + .../js/controllers/newreg_reportCtrl.js | 193 ++++++++++++++++ Apollo/assets/views/newreg_report.html | 210 ++++++++++++++++++ Apollo/assets/views/partials/nav.html | 14 ++ 10 files changed, 577 insertions(+), 2 deletions(-) create mode 100644 Apollo/assets/js/controllers/newreg_reportCtrl.js create mode 100644 Apollo/assets/views/newreg_report.html diff --git a/Apollo/api/application/config/constants.php b/Apollo/api/application/config/constants.php index b3370401..935ba6d1 100755 --- a/Apollo/api/application/config/constants.php +++ b/Apollo/api/application/config/constants.php @@ -166,4 +166,9 @@ defined('APPLICATION_CONST') OR define('APPLICATION_CONST','APPLICATION'); //encripted password -> md5 defined('ENCR_PASSWORD') OR define('ENCR_PASSWORD','e99a18c428cb38d5f260853678922e03'); -//end of encripted password \ No newline at end of file +//end of encripted password + +//new registration + +defined('NewReg') OR define('NewReg','New-Reg'); +//end new reg \ No newline at end of file diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 5b101c65..eff15fac 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -192,6 +192,10 @@ $route['getAllDayBookDetails'] = 'DayBook_Controller/getAllDayBookDetails'; $route['update_DayBookDetails'] = 'DayBook_Controller/update_DayBookDetailsData'; + + +$route['AllgetUniversity'] = 'Report/getAllUniversity'; +$route['NewregDetails'] = 'Report/NewregDetails'; /* Add New Contact Group */ $route['addNewGroup'] = 'Broadcast_Controller/addNewGroup'; $route['getGroups'] = 'Broadcast_Controller/getGroups'; diff --git a/Apollo/api/application/controllers/Report.php b/Apollo/api/application/controllers/Report.php index d089469b..10ffdf1b 100755 --- a/Apollo/api/application/controllers/Report.php +++ b/Apollo/api/application/controllers/Report.php @@ -383,6 +383,65 @@ class Report extends REST_Controller { } + + + + + public function getAllUniversity_post() + { + + //echo 'in'; + + $branchId = $this->post('branchId'); + + // echo $branchId; + // die(); + + $univlist = $this->report_model->GetAllUniversity($branchId); + + if($univlist) + { + $univlist['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($univlist, 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); + } + + + + } + + + public function NewregDetails_post() + { + $det['from'] = $this->post('from'); + $det['to'] = $this->post('to'); + $det['university'] = $this->post('university'); + // print_r($det); + + $newlist = $this->report_model->GetNewRegList($det); + + if($newlist) + { + $newlist['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($newlist, 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); + } + } + diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 1fd15252..532b02e6 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -837,5 +837,82 @@ from T_Lead_Tracking_Followup as ltf $batchDetails = $this->db->get(BATCH); return $batchDetails->result(); } + + + + public function GetAllUniversity($branchId) + { + $this->db->select('UniversityID,UniversityName'); + $this->db->from('T_UniversityMaster'); + $this->db->where('T_UniversityMaster.BranchCode',$branchId); + $searchDetails = $this->db->get(); + + if($searchDetails->result()) + { + + //print_r($searchDetails->result()); + $result_array['UnivStatus'] = true; + $result_array['details'] = $searchDetails->result(); + } + else + { + $result_array['UnivStatus'] = false; + $result_array['details'] = "No records found!"; + } + + + return $result_array; + } + + + public function GetNewRegList($det) + { + + $fdate=$det['from']; + $tdate=$det['to']; + + $fromd= date("Y-m-d",strtotime($fdate)); + $tod=date("Y-m-d",strtotime($tdate)); + $university = $det['university']; + + // echo 'f'.$fromd.'t'.$tod; + // die(); + + +$subQuery='SELECT T_StudentDetails.StudentID,DOJ,BatchName,CourseName ,T_Student_CourseDetails.UniversityID, T_Student_CourseDetails.CourseID, Firstname,T_StudentDetails. MobileNumber, Fathername, UniversityName,CourseName FROM T_Student_CourseDetails +JOIN T_StudentDetails ON T_StudentDetails.StudentID=T_Student_CourseDetails.StudentID +JOIN T_UniversityMaster ON T_UniversityMaster.UniversityID=T_Student_CourseDetails.UniversityID JOIN T_CourseMaster ON T_CourseMaster.CourseID=T_Student_CourseDetails.CourseID +left JOIN T_Registration_Details ON T_Registration_Details.CourseID = T_Student_CourseDetails.CourseID and T_Registration_Details.StudentID=T_Student_CourseDetails.StudentID +left JOIN T_BatchMaster ON T_BatchMaster.BatchCode = T_Registration_Details.BatchCode +WHERE T_Registration_Details.RegistrationType = ? and str_to_date(DOJ,?)>=? and str_to_date(DOJ,?)<=? and T_Registration_Details.RegistrationMode=?'; + +$query = $this->db->query($subQuery,array(NewReg,'%d-%m-%Y',$fromd,'%d-%m-%Y',$tod,'1')); + + + $searchDetails =$query->result(); +//print_r( $this->db->last_query()); +//die(); + + //print_r($searchDetails);die(); + + + if($searchDetails) + { + + //print_r($searchDetails->result()); + $result_array['searchst'] = true; + $result_array['details'] = $query->result(); + } + 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/i18n/en.json b/Apollo/assets/i18n/en.json index aad81771..142041a4 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -91,7 +91,8 @@ "wav_ref": "WAIVER AND REFERAL REPORT", "examfee": "EXAM WRITING FEE REPORT", "balfee": "FEE BALANCE REPORT", - "lead": "LEAD TRACKING REPORT" + "lead": "LEAD TRACKING REPORT", + "newreg":"NEW REG REPORT" }, "student": { diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index 22c0a514..d0574559 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -138,6 +138,10 @@ app.constant('JS_REQUIRES', { 'datacorrectionCtrl': 'assets/js/controllers/datacorrectionCtrl.js', /* + * */ + 'newreg_reportCtrl': 'assets/js/controllers/newreg_reportCtrl.js', + /* + diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index e74f2e4e..52046734 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -186,6 +186,14 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com ncyBreadcrumb: { label: 'datacorrection' }, + }).state('app.daybooksuperadmin.datacorrection', { + url: '/datacorrection', + templateUrl: "assets/views/data_correction.html", + resolve: loadSequence('datacorrectionCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'datacorrection', + ncyBreadcrumb: { + label: 'datacorrection' + }, }).state('app.master.studentStatusUpdate', { url: '/default activity', templateUrl: "assets/views/studentStatusUpdate.html", diff --git a/Apollo/assets/js/controllers/newreg_reportCtrl.js b/Apollo/assets/js/controllers/newreg_reportCtrl.js new file mode 100644 index 00000000..ac7c32c1 --- /dev/null +++ b/Apollo/assets/js/controllers/newreg_reportCtrl.js @@ -0,0 +1,193 @@ +'use strict'; +/*** controller***/ +app.controller('newreg_reportCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage" ,"$http", "$state","$modal","$log", + function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http,ipCookie ,$state,$modal,$log){ + + //function ($scope, apiPoint, $http, SweetAlert, $state,$modal, md5, ipCookie, $window, dateListDescService) { + + // DataTables configurable options + + + $scope.filters = { + + "from_date": "", + "to_date": "", + + }; + + + var localDetails = JSON.parse(localStorage.getItem('localObj')); + //var localDetails = ipCookie('cookiechk'); + + console.log(localDetails); + + + // $scope.initHead = function() { +//console.log('rfd'); + var logcheck = JSON.parse(localStorage.getItem('localObj')); + + const LOCALTYPE = logcheck.localType; + if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' || LOCALTYPE == 'R002' || LOCALTYPE == 'R005')) { + console.log("if"); + }else { + if(logcheck != null && LOCALTYPE !='R001') { + console.log("else if"); + $state.go('app.dashboard'); + } else { + + console.log("else else"); + //ipCookie.remove('cookiechk'); + window.localStorage.clear(); + $state.go('login.signin'); + } + } + + // } + $scope.universitySearchData = ''; + + $scope.init = function() + { + + // alert() + var getuniv = { + method: 'POST', + url: apiPoint.url + 'AllgetUniversity/', + headers: { + 'Content-Type': 'application/json' + }, + + data: { + + branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, + } + + }; + + $http(getuniv).then(function (response) { + + if(response.status == 200) + { + $scope.universitySearchData=response.data.details; + } + + }); + + + }; + + + + + + +//$scope.opinctotal=''; +$scope.newreglist=''; +$scope.isLoaderShow =''; + $scope.getDetails = function (form,myModel) + { + // alert('in') + + console.log(form.$dirty); + var from = $scope.filters.from_date; + var to = $scope.filters.to_date; + var university = myModel.myUnivSearch + // console.log(from) + + var getstudentdetails = { + + method: 'POST', + url: apiPoint.url + 'NewregDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + university: university, + from : $scope.filters.from_date, + to : $scope.filters.to_date + + } + } + + $http(getstudentdetails).then(function (response) { + + if(response.data.status == 200) + { + $scope.newreglist = response.data.details; + $scope.isLoaderShow = true; + + } + + else + { + $scope.isLoaderShow=false; + } + + + }); + + } + + + + + var mystyle = { + sheetid: 'New Registration List', + headers: true, + caption: { + title:'New Registration List', + width: '500px', + style:'font-size:50px;bold:true' + }, + // style:'background:#00FF00', + column: { + style:'font-size:12px' + }, + + }; + + + + $scope.exportData = function () + { + //alert() + + + +//console.log($scope.fullincomedetail); + alasql('SELECT Firstname as Name,Fathername,CourseName,BatchName,UniversityName,DOJ as RegistrationDate,MobileNumber INTO XLS("New Registration report.xls",?) FROM ?',[mystyle,$scope.newreglist]); + + }; + + + $scope.OpenWindowStatus = false; + $scope.editId = -1; + $scope.setEditId = function (P) + { + //alert(P); + $scope.editId = P; + + } + + $scope.close = function () + { + + $scope.editId = -1; + + } + + +$scope.fdate =''; +$scope.tdate =''; +//$scope.Subtypes = ''; + + + + + + + + }]); + + + + diff --git a/Apollo/assets/views/newreg_report.html b/Apollo/assets/views/newreg_report.html new file mode 100644 index 00000000..9882e15b --- /dev/null +++ b/Apollo/assets/views/newreg_report.html @@ -0,0 +1,210 @@ + + + + + + +
+
+
+

New Registration Report

+
+ +
+
+ + +
+
+
+
+
+
+ + +
+
+ +
+ + + +
+
+ + +
+ +
+ + + +
+
+ + +
+ + + +
+ + + + + +
+
+ + + +
+
+
+ + + +
+
+
+ +
+ +
+
+ +
+ + + + + + +
+ +
+
+

{{load}}

+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Student NameFather NameCourseBatchUniversityDate Of RegistrationMobile
{{p.Firstname}}{{p.Fathername}}{{p.CourseName}}{{p.BatchName}}{{p.UniversityName}}{{p.DOJ}}{{p.MobileNumber}}
+
+
+ + + + +
+ + + +
+
+ + diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index f1e44992..b6c24f09 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -483,6 +483,13 @@ Lead Tracking Report + + +
  • + + New Registration + +
  • @@ -955,6 +962,13 @@ Lead Tracking Report + + +
  • + + New Registration + +