From 8045995d1a99d0dcc1f67b9f1bd842ffe45ef8b6 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Sat, 18 Aug 2018 17:42:46 +0530 Subject: [PATCH] status updation new changes : kdk --- .../models/StatusUpdation_model.php | 2 +- Apollo/assets/i18n/en.json | 3 +- Apollo/assets/js/config.constant.js | 4 + Apollo/assets/js/config.router.js | 9 + .../js/controllers/applicationStatusCtrl.js | 610 +++++++++++++++ Apollo/assets/views/partials/nav.html | 5 + .../status-update/application_status.html | 693 ++++++++++++++++++ 7 files changed, 1324 insertions(+), 2 deletions(-) create mode 100644 Apollo/assets/js/controllers/applicationStatusCtrl.js create mode 100644 Apollo/assets/views/status-update/application_status.html diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index 9022663c..ec992a9b 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -222,7 +222,7 @@ class StatusUpdation_model extends CI_Model { $results['preStatusDetails'] = false; $results['message'] = 'No record found'; } - } else if ($reqDetailsFor == 'APPICATION_STATUS') { + } else if ($reqDetailsFor == 'CERTIFICATE_STATUS') { $searchFor = 'A001'; $searchTableFor = APPLICATION_STATUS; $this->db->select('t1.*, t4.Firstname, t5.ListName, t6.CertificateName'); diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index a36e505b..aad81771 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -105,7 +105,8 @@ "STUDYMATERIAL": "STUDY MATERIAL", "ANSWERBOOKLET": "ANSWER BOOKLET", "MARKCARD": "MARK CARD", - "CERTIFICATE" : "CERTIFICATE" + "CERTIFICATE" : "CERTIFICATE", + "APPLICATION": "APPLICATION" } }, "status": { diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index 5fbe55ab..22c0a514 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -157,6 +157,10 @@ app.constant('JS_REQUIRES', { * student Certification status updation * */ 'markcardStatusCtrl': 'assets/js/controllers/markcardStatusCtrl.js', + /* + * student Application status updation + * */ + 'applicationStatusCtrl': 'assets/js/controllers/applicationStatusCtrl.js', /* * student Certification status updation * */ diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index 0760db6b..e74f2e4e 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -333,6 +333,15 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com label: 'Certificate Status' }, // resolve: loadSequence('wizardCtrl') + }).state('app.student.status.application', { + url: '/application', + templateUrl: "assets/views/status-update/application_status.html", + title: 'Application Status', + resolve: loadSequence('ui.select','spin', 'ui.mask', 'spin', 'ladda', 'angular-ladda', 'ngTable', 'applicationStatusCtrl'), + ncyBreadcrumb: { + label: 'Application Status' + }, + // resolve: loadSequence('wizardCtrl') }).state('app.status.application', { url: '/application', templateUrl: "assets/views/form_elements.html", diff --git a/Apollo/assets/js/controllers/applicationStatusCtrl.js b/Apollo/assets/js/controllers/applicationStatusCtrl.js new file mode 100644 index 00000000..1a46e68a --- /dev/null +++ b/Apollo/assets/js/controllers/applicationStatusCtrl.js @@ -0,0 +1,610 @@ +'use strict'; +/*** controller for Wizard Form example***/ +app.controller('applicationStatusCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', 'dateListDescService', function ($scope, toaster, $filter, ngTableParams, apiPoint, $http, SweetAlert, $state, md5, ipCookie ,dateListDescService) { + + /** + * Application status update search / Document status update + * by : kdk + */ + + $scope.sort = function (keyname) { + $scope.sortKey = keyname; //set the sortKey to the param passed + $scope.reverse = !$scope.reverse; //if true make it false and vice versa + } + + $scope.editId = -1; + $scope.setEditId = function (P) { + // alert(P); + $scope.statusUpdationId = -1; + $scope.editId = P; + } + $scope.cancel = function () { + $scope.editId = -1; + } + + + + // get local client details + var localDetail = JSON.parse(localStorage.getItem('localObj')); + var localDetails = ipCookie('cookiechk'); + + const localUpdateStatus = 'APPLICATIONFORM_STATUS'; + $scope.localTypeSuperAdmin = false; + $scope.localBranchDetails = ''; + + $scope.init = function () { + + // var logcheck = JSON.parse(localStorage.getItem('localObj')); + + // const LOCALTYPE = logcheck.localType; + // if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' )) { + // 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'); + // } + // } + + if (localDetail != null) { + if (localDetails.localType === 'R004') { + $scope.localTypeSuperAdmin = true; + $scope.getUniversityList(); + $scope.getBranchList(); + getCertificateDetailsList(); + } else { + $scope.getUniversityList(); + getCertificateDetailsList(); + } + } else { + } + } + + $scope.getBranchList = function () { + $scope.loader = true; + var empListreq = { + method: 'POST', + url: apiPoint.url + 'getBranchListDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: localDetails + } + }; + $http(empListreq).then(function (response) { + if (response.data.branDetailstatus) { + $scope.loader = false; + $scope.branchList_data = response.data.branch_details; + } else { + } + }); + } + + + + $scope.searchData = { + 'University': '', + 'Course': '', + 'Batch': '', + 'Mobile': '', + 'Name': '' + } + + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '', + 'certificatetype': '', + 'certificateNumber': '' + } + + // get university list while page is loading + $scope.universityData = ''; + $scope.getUniversityList = function () { + var empListreq = { + method: 'POST', + url: apiPoint.url + 'getUniveCourseBratch/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: localDetails + } + }; + $http(empListreq).then(function (response) { + if (response.data.univList) { + $scope.universityData = response.data.university_details; + } else { + } + }); + }; + + $scope.getUniveId = function (univ) { + let name = JSON.parse(univ); + $scope.searchData.University = name.UniversityID; + $scope.searchData.Course = ''; + $scope.searchData.Batch = ''; + $scope.courseData = name.Course; + $scope.batchData = name.Batch; + //call service for array list in desc order based on date + angular.forEach($scope.batchData,function (values,key) { + var parts = values.BatchDate.split("-"); + values.givenDateObject=new Date(parts[2], parts[1] - 1, parts[0]); + }); + $scope.batchData=dateListDescService.getOrderByList($scope.batchData); + // end + $scope.OpenWindowStatus = false; + $scope.getSearch(); + }; + + $scope.getValueChange = function () { + $scope.getSearch(); + } + + $scope.searchResultDetails = ''; + $scope.searchLoading = false; + $scope.searchResultLength = 0; + // get student list From the searching data + $scope.getSearch = function () { + $scope.OpenWindowStatus = false; + $scope.searchLoading = true; + var getSearchDetails = { + method: 'POST', + url: apiPoint.url + 'getSearchAutoDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.searchData, + requestDetails: localDetails + } + }; + $http(getSearchDetails).then(function (response) { + if (response.data.searchResult) { + $scope.searchResultStatus = response.data.searchResult; + $scope.searchLoading = false; + let searchResultDetailsBef = response.data.search_result_details; + const filterAddSelect = searchResultDetailsBef.filter(val => { + val['Selected'] = false; + return val; + }); + $scope.searchResultDetails = filterAddSelect; + $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; + } else { + $scope.searchLoading = false; + } + }); + } + + // mobile number search functionlity + $scope.mySearchChangeFunc = function (val) { + // if (val > 0) { + // $scope.allSelectedHide = true; + // $scope.allSelected('undefined'); + // $scope.OpenWindowStatus = false; + // } else { + // $scope.allSelected('undefined'); + // $scope.allSelectedHide = false; + // } + } + // End: mobile number search functionlity + + // select all or individual functionality + + // var getAllSelected = function () { + // var selectedItems = $scope.searchResultDetails.filter(function (item) { + // return item.Selected; + // }); + + // return selectedItems.length === $scope.searchResultDetails.length; + // } + + // var setAllSelected = function (value) { + // angular.forEach($scope.searchResultDetails, function (item) { + // item.Selected = value; + // }); + // } + + // $scope.allSelected = function (value) { + // if (value !== undefined) { + // return setAllSelected(value); + // } else { + // return getAllSelected(); + // } + // } + + // End: select all or individual functionality + + // Select one row in a table once + $scope.setOneSelect = function (value) { + // alert(); + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.editId = -1; + $scope.statusUpdationId = value.UNI_ID; + value.Selected = true; + $scope.OpenWindowStatus = true; + $scope.openUpdateWind(value); + } + + // unselect all the selected item + $scope.unSelect = function () { + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + $scope.statusUpdationId = -1; + $scope.openUpdateWind(); + } + + // open popup window onselct checkbox clicked or close popup window all the clicked items unchecked + $scope.OpenWindowStatus = false; + $scope.openUpdateWind = function (p) { + alert(JSON.stringify(p)); + var details = { + studId: p.StudentID, + courseId: p.CourseID + } + alert(JSON.stringify(details)); + var ItemsSelected = $scope.searchResultDetails.filter(function (item) { + if (item.Selected === true) { return true; } + }); + if (ItemsSelected.length !== 0) { + const courseLocal = $scope.searchData.Course; + $scope.getApplicationFromDetails(courseLocal); + $scope.getStatusList(); + $scope.OpenWindowStatus = true; + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '', + 'certificatetype': '', + 'certificateNumber': '' + } + } else { + $scope.OpenWindowStatus = false; + } + } + + // get status list for this activity + $scope.getStatusList = function () { + var getStatusL = { + method: 'POST', + url: apiPoint.url + 'getStatusListForUpdate/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + statusFor: 'studyMaterial', + data: localUpdateStatus, + reqBranch: localDetails.localBranchID + } + }; + $http(getStatusL).then(function (response) { + if (response.data.statusList) { + $scope.statusDetailsList = response.data.statusList_details; + } else { + // $scope.searchLoading = false; + } + }); + } + + // get Sem/Year based on the course select + $scope.getSemYearList = function (courseID) { + $scope.semYearList = ''; + if (courseID !== '' && courseID !== undefined) { + var getSemYear = { + method: 'POST', + url: apiPoint.url + 'getSemYearForCourse/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: courseID + } + }; + $http(getSemYear).then(function (response) { + if (response.data.semYearResult) { + $scope.semYearList = response.data.semYear_result_details; + } else { + $scope.semYearList = ''; + } + }); + + } else { + + } + } + + $scope.statusUpdate = { + submit: function (form, myStatusModel, localBranchDetails) { + var firstError = null; + if (form.$invalid) { + var field = null, firstError = null; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$name; + } + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); + } else { + // alert(localDetail.localBranchID); + // alert(localBranchDetails); + localDetails.localBranchID = localBranchDetails !== '' ? localBranchDetails : localDetails.localBranchID ; + localDetail.localBranchID = localBranchDetails !== '' ? localBranchDetails : localDetail.localBranchID ; + // alert(localDetail.localBranchID); + $scope.disableButton = true; + var studentForUpdate = []; + let formate = "dd-MM-yyyy"; + $scope.myStatusModel.dateOn = $filter('date')(new Date($scope.myStatusModel.dateOn), formate); + var ItemsSelected = $scope.searchResultDetails.filter(function (item) { + if (item.Selected === true) { + let getStudentID = new getStudentForUpdateDetails(item.StudentID, item.CourseID, item.BranchCode); + studentForUpdate.push(getStudentID); + return true; + } + }); + function getStudentForUpdateDetails(id, courseId, dCode) { + this.StudentID = id; + this.CourseID = courseId; + this.BranchCode = dCode; + this.ListCode = $scope.myStatusModel.staus; + this.SDate = $scope.myStatusModel.dateOn; + this.Coursedetail = id; + this.Comments = $scope.myStatusModel.comment; + this.CertificateType = $scope.myStatusModel.certificatetype; + this.CertificateNumber = $scope.myStatusModel.certificateNumber; + } + var updateStudyMaterial = { + method: 'POST', + url: apiPoint.url + 'updateApplicationStatus/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: studentForUpdate, + requestDetails: localDetails + } + }; + $http(updateStudyMaterial).then(function (response) { + if (response.data.addStatus) { + swal(" ","Updated successfully.", "success"); + $scope.disableButton = false; + // for success state + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + // $scope.OpenWindowStatus = false; + $scope.OpenWindowStatus = false; + } else { + swal(" ", response.data.message, "error"); + $scope.disableButton = false; + // for success state + angular.forEach($scope.searchResultDetails, function (item) { + item.Selected = false; + }); + // $scope.OpenWindowStatus = false; + $scope.OpenWindowStatus = false; + } + }); + } + }, + reset: function (form) { + form.$setPristine(true); + $scope.myStatusModel = { + 'semYear': '', + 'staus': '', + 'dateOn': '', + 'comment': '', + 'certificatetype': '', + 'certificateNumber': '' + } + } + } + + + // check unchek for table values + $scope.prevStatusListForStudentCourse = ''; + // get previous status details for the student + $scope.getPrevStatus = function (p) { + // alert(JSON.stringify(p)); + $scope.prevStatusListForStudentCourseLoading = true; + $scope.prevStatusListForStudentCourseNoRecord = false; + $scope.prevStatusListForStudentCourse = ''; + var getPrevStatus = { + method: 'POST', + url: apiPoint.url + 'getPrevStatusDetailsForStu/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + statusFor: localUpdateStatus, + getDetailsFor: { "student": p.StudentID, "CourseID": p.CourseID }, + data: localDetail + } + }; + $http(getPrevStatus).then(function (response) { + if (response.data.preStatusDetails) { + $scope.prevStatusListForStudentCourseLoading = false; + $scope.prevStatusListForStudentCourse = response.data.preStatus_details_list; + $scope.prevNoRecordFound = false; + } else { + $scope.prevStatusListForStudentCourseLoading = false; + $scope.prevStatusListForStudentCourseNoRecord = true; + $scope.prevNoRecordFound = true; + } + }); + } +}]); +/*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.MobileNumber, + 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'); + }; + + +}]); +app.filter('unique', function() { + return function(collection, primaryKey, secondaryKey) { //optional secondary key + var output = [], + keys = []; + + angular.forEach(collection, function(item) { + var key; + secondaryKey === undefined ? key = item[primaryKey] : key = item[primaryKey][secondaryKey]; + + if(keys.indexOf(key) === -1) { + keys.push(key); + output.push(item); + } + }); + + return output; + }; +}); diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index b5a0d5e4..f1e44992 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -208,6 +208,11 @@ Certificate + diff --git a/Apollo/assets/views/status-update/application_status.html b/Apollo/assets/views/status-update/application_status.html new file mode 100644 index 00000000..5bc63532 --- /dev/null +++ b/Apollo/assets/views/status-update/application_status.html @@ -0,0 +1,693 @@ + +
+
+
+

{{ mainTitle }}

+ Update application status. +
+
+
+
+ + +
+
+
+ +
+ +
+
+ +
+ + + +
+ +
+ + + +
+ +
+
+
+ +
+ +
+ +
+
+
+ + + + +
+
+
+
+
+
+
+
+ + + +
+ +
+ +
+

fetching...

+
+ +
+ +
+
+

No + records found...

+
+ +
+
+

No + records found...

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

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + First Name + + Last Name + + MobileNumber + + Email ID + + Course + +
+ + {{p.Firstname}}{{p.Lastname}}{{p.MobileNumber}}{{p.EmailID}}{{p.CourseName}}({{p.CourseCode}}) + +
+ +
+
+

Fetching ...

+
+
+
+ + + + + + + + + + + + + + + + +
StatusCommentsDocument NameDateUpdated By
{{s.ListName}}{{s.Comments}}{{s.CertificateName}}{{s.AppDate}}{{s.Firstname}}
+
+
+

No + Status Details Exist ...

+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ + Update Status + +
+ + + +
+
+
+ + + + Certificate Type is Required + +
+
+ + + Certificate Number is Required +
+
+
+
+ + + + Status is Required + +
+
+
+ + + Date is required. + Enter a Valid Date +
+
+
+
+
+ + +