diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 5476a093..220dd6c4 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -64,12 +64,12 @@ left join (SELECT StudentID as sid,UniversityID as uid,CourseID as cid,Enrollmen } public function filters($br){ - $sql = "SELECT distinct BatchCode as batchcode,BatchName as batch FROM T_BatchMaster + $sql = "SELECT distinct BatchCode as batchcode,BatchName as batch,BatchDate FROM T_BatchMaster where BranchCode = '".$br."'"; $b=$this->db->query($sql); $batch = $b->result(); if (count($batch) > 0) { - $results['batchlist'] = true; + $results['batchlist'] = true; $results['batch'] = $batch; } else { $results['batchlist'] = false; diff --git a/Apollo/assets/js/controllers/feesStatusCtrl.js b/Apollo/assets/js/controllers/feesStatusCtrl.js index de8fd070..7b8099f4 100755 --- a/Apollo/assets/js/controllers/feesStatusCtrl.js +++ b/Apollo/assets/js/controllers/feesStatusCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /** * controllers for ng-table - * Simple table with sorting and filtering on AngularJS + * Simple table with sorting and filtering on AngularJS */ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", "installmentService", "SweetAlert", "dateListDescService", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state,installmentService,SweetAlert,dateListDescService) { $scope.myModel = { @@ -830,7 +830,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n $scope.setModel = { "feesType": $scope.feesStructureInfo[0], }; - angular.forEach($scope.feesStructureInfo[0].batchDetails,function (values,key) { + angular.forEach($scope.feesStructureInfo[0].batchDetails,function (values,key) { var parts = values.BatchDate.split("-"); $scope.BatchDetails.push({ "BatchCode":values.BatchCode, diff --git a/Apollo/assets/js/controllers/report_ans_bookletCtrl.js b/Apollo/assets/js/controllers/report_ans_bookletCtrl.js index 9b7e6c97..be7fe687 100755 --- a/Apollo/assets/js/controllers/report_ans_bookletCtrl.js +++ b/Apollo/assets/js/controllers/report_ans_bookletCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_ans_bookletCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_ans_bookletCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -29,9 +29,21 @@ app.controller('report_ans_bookletCtrl', ["$scope", "API_POINTS", "$http", "Swee }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_app_pendingCtrl.js b/Apollo/assets/js/controllers/report_app_pendingCtrl.js index 9de3b30d..eda6de19 100755 --- a/Apollo/assets/js/controllers/report_app_pendingCtrl.js +++ b/Apollo/assets/js/controllers/report_app_pendingCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_app_pendingCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_app_pendingCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -29,9 +29,21 @@ app.controller('report_app_pendingCtrl', ["$scope", "API_POINTS", "$http", "Swee }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_balfeeCtrl.js b/Apollo/assets/js/controllers/report_balfeeCtrl.js index e3de5fc5..b99bb118 100755 --- a/Apollo/assets/js/controllers/report_balfeeCtrl.js +++ b/Apollo/assets/js/controllers/report_balfeeCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_balfeeCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_balfeeCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // to generate serial number $scope.currentPage=1; @@ -37,9 +37,21 @@ app.controller('report_balfeeCtrl', ["$scope", "API_POINTS", "$http", "SweetAler }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_certificateCtrl.js b/Apollo/assets/js/controllers/report_certificateCtrl.js index 1574c896..339dc187 100755 --- a/Apollo/assets/js/controllers/report_certificateCtrl.js +++ b/Apollo/assets/js/controllers/report_certificateCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_certificateCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_certificateCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -28,9 +28,21 @@ app.controller('report_certificateCtrl', ["$scope", "API_POINTS", "$http", "Swee }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_doc_pendingCtrl.js b/Apollo/assets/js/controllers/report_doc_pendingCtrl.js index 0a6b8432..9db00007 100755 --- a/Apollo/assets/js/controllers/report_doc_pendingCtrl.js +++ b/Apollo/assets/js/controllers/report_doc_pendingCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_doc_pendingCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_doc_pendingCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -29,9 +29,21 @@ app.controller('report_doc_pendingCtrl', ["$scope", "API_POINTS", "$http", "Swee }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_examfeeCtrl.js b/Apollo/assets/js/controllers/report_examfeeCtrl.js index 6e62c641..24ceab9a 100755 --- a/Apollo/assets/js/controllers/report_examfeeCtrl.js +++ b/Apollo/assets/js/controllers/report_examfeeCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_examfeeCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_examfeeCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -29,9 +29,21 @@ app.controller('report_examfeeCtrl', ["$scope", "API_POINTS", "$http", "SweetAle }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_expenseCtrl.js b/Apollo/assets/js/controllers/report_expenseCtrl.js index 50712a5f..d0194ab2 100755 --- a/Apollo/assets/js/controllers/report_expenseCtrl.js +++ b/Apollo/assets/js/controllers/report_expenseCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -28,9 +28,21 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_markcard_certificateCtrl.js b/Apollo/assets/js/controllers/report_markcard_certificateCtrl.js index a0332d04..4f7a0b2f 100755 --- a/Apollo/assets/js/controllers/report_markcard_certificateCtrl.js +++ b/Apollo/assets/js/controllers/report_markcard_certificateCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_markcard_certificateCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_markcard_certificateCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -30,9 +30,21 @@ app.controller('report_markcard_certificateCtrl', ["$scope", "API_POINTS", "$htt }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/js/controllers/report_markcard_statusCtrl.js b/Apollo/assets/js/controllers/report_markcard_statusCtrl.js index ee39251a..13e6354d 100755 --- a/Apollo/assets/js/controllers/report_markcard_statusCtrl.js +++ b/Apollo/assets/js/controllers/report_markcard_statusCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_markcard_statusCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_markcard_statusCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -28,10 +28,23 @@ app.controller('report_markcard_statusCtrl', ["$scope", "API_POINTS", "$http", " }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $scope.batch=[]; + $scope.batchlist = response.data.batch; $scope.university = response.data.university; - //console.log($scope.branch); + //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(response.data.batch); + console.log($scope.batch); } else { } }); diff --git a/Apollo/assets/js/controllers/report_study_material_statusCtrl.js b/Apollo/assets/js/controllers/report_study_material_statusCtrl.js index 27d449d0..7876b529 100755 --- a/Apollo/assets/js/controllers/report_study_material_statusCtrl.js +++ b/Apollo/assets/js/controllers/report_study_material_statusCtrl.js @@ -1,11 +1,11 @@ 'use strict'; /*** controller***/ -app.controller('report_study_material_statusCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope,apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, DTOptionsBuilder, DTColumnBuilder) { +app.controller('report_study_material_statusCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope,apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options - + $scope.filters = { "branch": "", "university": "", @@ -13,7 +13,7 @@ app.controller('report_study_material_statusCtrl', ["$scope", "API_POINTS", "$ht }; - $scope.filters = function () { + $scope.filters = function () { var filterlist = { method: 'POST', url: apiPoint.url + 'report_filters/', @@ -26,12 +26,25 @@ app.controller('report_study_material_statusCtrl', ["$scope", "API_POINTS", "$ht } }; - $http(filterlist).then(function (response) { + $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $scope.batch=[]; + $scope.batchlist = response.data.batch; $scope.university = response.data.university; - //console.log($scope.branch); + //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(response.data.batch); + // console.log($scope.batch); } else { } }); diff --git a/Apollo/assets/js/controllers/report_waiver_referalCtrl.js b/Apollo/assets/js/controllers/report_waiver_referalCtrl.js index 45206748..f414d730 100755 --- a/Apollo/assets/js/controllers/report_waiver_referalCtrl.js +++ b/Apollo/assets/js/controllers/report_waiver_referalCtrl.js @@ -1,7 +1,7 @@ 'use strict'; /*** controller***/ -app.controller('report_waiver_referalCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', - function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { +app.controller('report_waiver_referalCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window',"dateListDescService", + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window, dateListDescService) { // DataTables configurable options @@ -29,9 +29,21 @@ app.controller('report_waiver_referalCtrl', ["$scope", "API_POINTS", "$http", "S }; $http(filterlist).then(function (response) { if (response.data) { - $scope.batch = response.data.batch; - $scope.branch = response.data.branch; + $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 { } diff --git a/Apollo/assets/views/report_studymaterialstatus.html b/Apollo/assets/views/report_studymaterialstatus.html index 6277cf0c..05363b0a 100755 --- a/Apollo/assets/views/report_studymaterialstatus.html +++ b/Apollo/assets/views/report_studymaterialstatus.html @@ -42,7 +42,7 @@