From d4fef937cdb27d21ea3f3a05606bd95e94f21eb5 Mon Sep 17 00:00:00 2001 From: resicovenba Date: Wed, 10 Jan 2018 09:53:05 +0530 Subject: [PATCH] daybook updation, Super admin edit/add sudent enabled : kdk --- Apollo/api/application/config/routes.php | 3 +- .../controllers/Student_Controller.php | 20 + .../api/application/models/Student_model.php | 30 +- Apollo/assets/i18n/en.json | 1 + Apollo/assets/js/config.router.js | 8 + Apollo/assets/js/controllers/daybookCtrl.js | 11 +- .../assets/js/controllers/daybookadminCtrl.js | 37 +- .../js/controllers/daybooksuperadminCtrl.js | 46 +- Apollo/assets/js/controllers/studentCtrl.js | 1011 +++++++++++++++-- Apollo/assets/views/daybook/daybookadmin.html | 14 +- .../views/daybook/daybooksuperadmin.html | 18 +- Apollo/assets/views/partials/nav.html | 63 +- .../student/editStudentCourseDetails.html | 4 +- .../assets/views/student/student_details.html | 26 +- .../student/student_details_SuperAdmin.html | 651 +++++++++++ 15 files changed, 1806 insertions(+), 137 deletions(-) create mode 100644 Apollo/assets/views/student/student_details_SuperAdmin.html diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index c6f97b05..150fcbaf 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -123,8 +123,9 @@ $route['updateStudentCourseDetail'] = 'Student_Controller/updateStudentCourseDet $route['insertStudentCourse'] = 'Student_Controller/insertStudentCourse'; $route['insertStudentImg'] = 'Student_Controller/insertStudentImg'; $route['updateStudentImgDetails'] = 'Student_Controller/updateStudentImgDetails'; +$route['getBranchListDetails'] = 'Student_Controller/getBranchListDetails'; -//batch +//batch $route['addBatchDetails'] = 'Batch_Controller/addBatchDetails'; $route['updateBatchDetails'] = 'Batch_Controller/updateBatchDetails'; $route['getBatchDetails'] = 'Batch_Controller/getBatchDetails'; diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index e43813e6..c42b5a76 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -36,6 +36,26 @@ class Student_Controller extends REST_Controller { $this->load->model('Student_model', 'student_model'); } + + // list of branch for admin student add screen + public function getBranchListDetails_post() { + $reqData = $this->post('data'); + $branchListDetails = $this->student_model->get_branch_list();// Get Branch list + if ($branchListDetails) + { + $branchListDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($branchListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No users were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } public function getStudentList_post() { $reqData = $this->post('data'); diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index be657c73..32212c4b 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -14,12 +14,40 @@ class Student_model extends CI_Model * created by kdk * */ + public function get_branch_list() { + $this->db->select('t1.BranchCode,t1.BranchName'); + $this->db->from('' . BRANCH . ' as t1'); + $this->db->where('t1.IsActive', 1); + $branchDetails = $this->db->get(); + $checkArr = $branchDetails->result(); + if (count($checkArr) > 0) { + $result['branDetailstatus'] = true; + $result['branch_details'] = $branchDetails->result(); + } else { + $result['branDetailstatus'] = false; + } + return $result; + } + + // get student list based on login user public function get_student_list($loginUserId, $loginUserBranchId, $loginUserType) { // echo $loginUserId, $loginUserBranchId, $loginUserType; exit(); if ($loginUserType == SUPER_ADMIN) { - // list for super admin + // list for super admin based on branch + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->order_by('CreatedOn', 'DESC'); + $this->db->where('BranchCode', $loginUserBranchId); + $stuDetails = $this->db->get(); + $checkArr = $stuDetails->result(); + if (count($checkArr) > 0) { + $results['studentList'] = true; + $results['student_details'] = $stuDetails->result(); + } else { + $results['studentList'] = false; + } // if ($loginUserBranchId == 'All') { // // for getting all branch details // $staffId = $this->selfGetEmpId($loginUserId); diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index d9d226db..da6279f8 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -76,6 +76,7 @@ "LISTING": "STUDENTS LISTING", "ENROLLMENT": "STUDENT ENROLLMENT", "STUDENTDETAILS": "STUDENT DETAILS", + "STUDENTDETAILSADDEDIT": "ADD/EDIT STUDENT DETAILS", "status" : { "MAIN": "STATUS UPDATE", "STUDYMATERIAL": "STUDY MATERIAL", diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index 060b0d4a..4ef7aadb 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -221,6 +221,14 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com ncyBreadcrumb: { label: 'Student Details' } + }).state('app.student.studentDetailsSuperAdmin', { + url: '/studentDetailsAddEdit', + templateUrl: "assets/views/student/student_details_SuperAdmin.html", + resolve: loadSequence('ui.select','spin', 'ui.mask', 'ladda', 'angular-ladda', 'studentCtrl', 'ngTable'), + title: 'Add/Edit Student Details', + ncyBreadcrumb: { + label: 'Add/Edit Student Details' + } }).state('app.student.status', { url: '/status', template: '
STUDENT STATUS UPDATE
', diff --git a/Apollo/assets/js/controllers/daybookCtrl.js b/Apollo/assets/js/controllers/daybookCtrl.js index 1c13b98f..4d0fe31b 100755 --- a/Apollo/assets/js/controllers/daybookCtrl.js +++ b/Apollo/assets/js/controllers/daybookCtrl.js @@ -3,7 +3,7 @@ * daybook details capturing * */ -app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie) { +app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window) { // get local client details var localDetail = JSON.parse(localStorage.getItem('localObj')); @@ -16,12 +16,21 @@ app.controller('daybookCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ng // get the data while page loading functions goes here $scope.init = function () { + const LOCALTYPE = localDetail.localType; + if(LOCALTYPE === 'R002') { $scope.currentDate = new Date(); var formate = "dd-MM-yyyy"; $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); $scope.getDayBookList(); $scope.getIncomeExpenseType_Status(); + }else { + ipCookie.remove('cookiechk'); + $window.localStorage.clear(); + $state.go('login.signin'); + } + + } // change from date, update and call search functionality diff --git a/Apollo/assets/js/controllers/daybookadminCtrl.js b/Apollo/assets/js/controllers/daybookadminCtrl.js index e8d9ba65..92a7c034 100755 --- a/Apollo/assets/js/controllers/daybookadminCtrl.js +++ b/Apollo/assets/js/controllers/daybookadminCtrl.js @@ -3,7 +3,7 @@ * daybook details capturing * */ -app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie) { +app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window) { // get local client details var localDetail = JSON.parse(localStorage.getItem('localObj')); @@ -28,16 +28,19 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); $scope.getIncomeExpenseType_Status(); $scope.getDayBookList(); - } else if(LOCALTYPE === 'R004') { - $scope.localTypeViewSuperAdmin = true; - $scope.showTheRefValue = 'I001'; - $scope.localTypeViewAdmin = true; - $scope.currentDate = new Date(); - var formate = "dd-MM-yyyy"; - $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); - $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); - $scope.getIncomeExpenseType_Status(); - $scope.getDayBookList(); + } else { + ipCookie.remove('cookiechk'); + $window.localStorage.clear(); + $state.go('login.signin'); + // $scope.localTypeViewSuperAdmin = true; + // $scope.showTheRefValue = 'I001'; + // $scope.localTypeViewAdmin = true; + // $scope.currentDate = new Date(); + // var formate = "dd-MM-yyyy"; + // $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); + // $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); + // $scope.getIncomeExpenseType_Status(); + // $scope.getDayBookList(); } } @@ -93,11 +96,15 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" }); } + $scope.loadingsearch = false; $scope.noRecordFound = true; + $scope.noRecordFoundSearch = false; $scope.dataLengthIncome = 0; $scope.dataLengthExpense = 0; // day book entry list $scope.getDayBookList = function () { + $scope.loadingsearch = true; + $scope.noRecordFoundSearch = false; var getDatBookListDetails = { method: 'POST', url: apiPoint.url + 'getDayBookDetails/', @@ -111,8 +118,14 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" }; $http(getDatBookListDetails).then(function (response) { if (response.data.dayBookListStatus) { + $scope.loadingsearch = false; // $scope.data = response.data.dayBookListDetails; let datas = response.data.dayBookListDetails; + if (datas.length <= 0) { + $scope.noRecordFoundSearch = true; + } else { + $scope.noRecordFoundSearch = false; + } let searchResultDetailsBef = datas.filter(val => { return val.Name == 'I001' ? 1 : 0; }); @@ -138,7 +151,7 @@ app.controller('daybookadminCtrl', ["$scope", "$rootScope", "toaster", "$filter" // alert(JSON.stringify($scope.data)); // $scope.incomeExpenseType = response.data.typeNameList; } else { - + $scope.loadingsearch = false; } }); } diff --git a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js index 3ebba6cd..03f1bda6 100755 --- a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js +++ b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js @@ -3,7 +3,7 @@ * daybook details capturing * */ -app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie) { +app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", 'ipCookie', '$window', function ($scope, $rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state, ipCookie, $window) { // get local client details var localDetail = JSON.parse(localStorage.getItem('localObj')); @@ -19,7 +19,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi // get details functionality when page get loaded $scope.init = function () { const LOCALTYPE = localDetail.localType; - if(LOCALTYPE === 'R004') { + if (LOCALTYPE === 'R004') { $scope.localTypeViewSuperAdmin = true; $scope.showTheRefValue = 'I001'; $scope.localTypeViewAdmin = true; @@ -28,15 +28,18 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi $scope.searchData.date = $filter('date')(new Date($scope.currentDate), formate); $scope.searchData.dateTo = $filter('date')(new Date($scope.currentDate), formate); $scope.getIncomeExpenseType_Status(); - $scope.getDayBookList(); + $scope.getDayBookList(); } else { - + ipCookie.remove('cookiechk'); + $window.localStorage.clear(); + $state.go('login.signin'); + } } // change from date, update and call search functionality $scope.changeDate = function () { - if($scope.searchData.date !== undefined) { + if ($scope.searchData.date !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.date = $filter('date')(new Date($scope.searchData.date), formate); $scope.getDayBookList(); @@ -48,7 +51,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi // change to date, update and call search functionality $scope.changeToDate = function () { - if($scope.searchData.dateTo !== undefined) { + if ($scope.searchData.dateTo !== undefined) { var formate = "dd-MM-yyyy"; $scope.searchData.dateTo = $filter('date')(new Date($scope.searchData.dateTo), formate); $scope.getDayBookList(); @@ -58,7 +61,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } } - // sorting function for table params + // sorting function for table params $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 @@ -86,13 +89,15 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } - + $scope.loadingsearch = false; $scope.noRecordFound = true; - $scope.dataLengthIncome = 0; - $scope.dataLengthExpense = 0; - // day book entry list + $scope.noRecordFoundSearch = false; + $scope.dataLengthIncome = 0; + $scope.dataLengthExpense = 0; + // day book entry list $scope.getDayBookList = function () { - + $scope.loadingsearch = true; + $scope.noRecordFoundSearch = false; var getDatBookListDetails = { method: 'POST', url: apiPoint.url + 'getDayBookDetailsSuperAdmin/', @@ -106,22 +111,27 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi }; $http(getDatBookListDetails).then(function (response) { if (response.data.dayBookListStatus) { - + $scope.loadingsearch = false; // $scope.data = response.data.dayBookListDetails; let datas = response.data.dayBookListDetails; + if (datas.length <= 0) { + $scope.noRecordFoundSearch = true; + } else { + $scope.noRecordFoundSearch = false; + } let searchResultDetailsBef = datas.filter(val => { return val.Name == 'I001' ? 1 : 0; }); $scope.IncomeData = datas.filter(val => { return val.Name == 'I002' ? 1 : 0; }); - $scope.dataLengthIncome = $scope.IncomeData.length; + $scope.dataLengthIncome = $scope.IncomeData.length; const filterAddSelect = searchResultDetailsBef.filter(val => { val['Selected'] = false; return val; }); $scope.searchResultDetails = filterAddSelect; - $scope.dataLengthExpense = $scope.searchResultDetails.length; + $scope.dataLengthExpense = $scope.searchResultDetails.length; // alert(JSON.stringify($scope.searchResultDetails)); $scope.searchResultLength = Object.keys($scope.searchResultDetails).length; @@ -135,7 +145,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi // alert(JSON.stringify($scope.data)); // $scope.incomeExpenseType = response.data.typeNameList; } else { - + $scope.loadingsearch = false; } }); } @@ -191,7 +201,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi } } - // update the status details + // update the status details $scope.statusUpdate = { submit: function (form, myStatusModel) { var firstError = null; @@ -388,7 +398,7 @@ app.controller('daybooksuperadminCtrl', ["$scope", "$rootScope", "toaster", "$fi "description": p.description } } - + // delete the entry row from the daybook list $scope.deleEditEntry = function (id) { swal({ diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index e76892ce..b8e0c7c9 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -4,7 +4,7 @@ * Simple table with sorting and filtering on AngularJS */ -app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory) { +app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", "$interval", function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory, $interval) { /** * student details capture * by : kdk @@ -82,14 +82,21 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // load when html page load $scope.init = function () { + $scope.todayDate = new Date(); var nowInMS = new Date().getTime(), sixteenYearsInMS = 1000 * 60 * 60 * 24 * 365 * 16, sixteenYearsBeforeNow = new Date(nowInMS - sixteenYearsInMS); if (localDetail != null) { - $scope.currentDate = new Date(sixteenYearsBeforeNow); - $scope.getStudentList(); - $scope.getUniversityList(); - $scope.myModel.dateofbirth=$filter('date')($scope.currentDate, 'dd-MM-yyyy'); + if (localDetails.localType === 'R003' || localDetails.localType === 'R002') { + $scope.currentDate = new Date(sixteenYearsBeforeNow); + $scope.getStudentList(); + $scope.getUniversityList(); + $scope.myModel.dateofbirth = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); + } else { + ipCookie.remove('cookiechk'); + $window.localStorage.clear(); + $state.go('login.signin'); + } } else { } } @@ -267,7 +274,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } // update sutdent course details - $scope.updateStudentCourseDetails = function (form, datas, hidedoj) { + $scope.updateStudentCourseDetails = function (form, datas, hidedoj) { if (form.$invalid) { var field = null, firstError = null; for (field in form) { @@ -467,7 +474,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // $scope.stepsModel.push(e.target.result); $scope.stepsModel[0] = e.target.result; }); - } + } //an array of files selected $scope.files = []; @@ -480,16 +487,16 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); }); - // reset image + // reset image $scope.resetImage = function () { $scope.files.length = 0; $scope.stepsModel.length = 0; } - $scope.getChangeDate = function() { - var formate = "dd-MM-yyyy"; - $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); - + $scope.getChangeDate = function () { + var formate = "dd-MM-yyyy"; + $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); + } // add student @@ -510,13 +517,13 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } 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 { + } else { $scope.disableButton = true; var formate = "dd-MM-yyyy"; $scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0; - $scope.myModelCourseAdd.dateofjoining = $filter('date')(new Date($scope.myModelCourseAdd.dateofjoining), formate); + $scope.myModelCourseAdd.dateofjoining = $filter('date')(new Date($scope.myModelCourseAdd.dateofjoining), formate); var idStuProof = $scope.files[0]; - + if (idStuProof !== undefined) { var formData = new FormData(); var idProof = $scope.files[0]; @@ -541,29 +548,29 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } }); } else { - var req = { - method: 'POST', - url: apiPoint.url + 'insertStudent/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: $scope.myModel, - coursedata: $scope.myModelCourseAdd, - loginBranch: localDetails.localBranchID, - createdBy: localDetails.localUserID, - } - }; - $http(req).then(function (response) { - if (response.data.addStudentStatus == true) { - swal("Success!", response.data.message, "success"); - $scope.disableButton = false; - $state.go($state.current, {}, { reload: true }); - } else { - $scope.disableButton = false; - swal("Failed!", response.data.message, "error"); - } - }); + var req = { + method: 'POST', + url: apiPoint.url + 'insertStudent/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.myModel, + coursedata: $scope.myModelCourseAdd, + loginBranch: localDetails.localBranchID, + createdBy: localDetails.localUserID, + } + }; + $http(req).then(function (response) { + if (response.data.addStudentStatus == true) { + swal("Success!", response.data.message, "success"); + $scope.disableButton = false; + $state.go($state.current, {}, { reload: true }); + } else { + $scope.disableButton = false; + swal("Failed!", response.data.message, "error"); + } + }); } } }, @@ -655,7 +662,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } - + $scope.stepsModelEdit = []; $scope.imageUploadEdit = function (event) { var files = event.target.files; //FileList object @@ -673,7 +680,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // $scope.stepsModel.push(e.target.result); $scope.stepsModelEdit[0] = e.target.result; }); - } + } //an array of files selected $scope.filesEdit = []; @@ -691,9 +698,9 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.filesEdit.length = 0; $scope.stepsModelEdit.length = 0; } - + // update student details - $scope.updateStuDetails = function (form, p ,hidedob) { + $scope.updateStuDetails = function (form, p, hidedob) { var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -712,24 +719,24 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } else { // alert(p.DOB); var idProof = $scope.filesEdit[0]; - + var formate = "dd-MM-yyyy"; var checkDOB = $filter('date')(new Date(p.DOB), formate); p.IsActive = p.IsActive === true ? 1 : 0; p.DOB = p.DOB == hidedob ? p.DOB : $filter('date')(new Date(p.DOB), formate); - - if(idProof == undefined) { + + if (idProof == undefined) { // alert(idProof); var req = { - method: 'POST', - url: apiPoint.url + 'updateStudentExistDetail/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: p, - updatedBy: localDetails.localUserID, - } + method: 'POST', + url: apiPoint.url + 'updateStudentExistDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: p, + updatedBy: localDetails.localUserID, + } }; $http(req).then(function (response) { if (response.data.updateStuStatus = true) { @@ -742,26 +749,902 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } }); } else { - var formData = new FormData(); - var idStuUpProof = $scope.filesEdit[0]; - // alert(idProof); - formData.append("data", JSON.stringify(p)); - formData.append("updatedBy", localDetails.localUserID); - formData.append('idStuUpProof', idStuUpProof); + var formData = new FormData(); + var idStuUpProof = $scope.filesEdit[0]; + // alert(idProof); + formData.append("data", JSON.stringify(p)); + formData.append("updatedBy", localDetails.localUserID); + formData.append('idStuUpProof', idStuUpProof); - $http.post(apiPoint.url + 'updateStudentImgDetails/', formData, { + $http.post(apiPoint.url + 'updateStudentImgDetails/', formData, { + transformRequest: angular.identity, + headers: { 'Content-Type': undefined, 'Process-Data': false }, + }).success(function (data) { + if (data.updateStuStatus == true) { + swal("Success!", data.message, "success"); + $scope.getStudentList(); + $scope.editId = -1; + } else { + // $scope.ldloading1[loading.replace('-', '_')] = false; + swal("Failed!", data.message, "error"); + } + }); + } + } + } + +}]); + +// Student datails for super admin : Start +app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory) { + /** + * student details capture + * by : kdk + */ + + + // get local client details + var localDetail = JSON.parse(localStorage.getItem('localObj')); + var localDetails = ipCookie('cookiechk'); + $scope.localBranchDetails = ""; + $scope.loader = false; + + $scope.viewStudentDetailsPage = false; + // load when html page load + $scope.init = function () { + if (localDetail != null) { + if (localDetails.localType === 'R004') { + $scope.getBranchList(); + } else { + ipCookie.remove('cookiechk'); + $window.localStorage.clear(); + $state.go('login.signin'); + } + } 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.changeBranch = function () { + $scope.viewStudentDetailsPage = false; + localDetails.localBranchID = $scope.localBranchDetails; + localDetail.localBranchID = $scope.localBranchDetails; + getDetails() + } + + function getDetails() { + $scope.todayDate = new Date(); + var nowInMS = new Date().getTime(), + sixteenYearsInMS = 1000 * 60 * 60 * 24 * 365 * 16, + sixteenYearsBeforeNow = new Date(nowInMS - sixteenYearsInMS); + $scope.currentDate = new Date(sixteenYearsBeforeNow); + $scope.getStudentList(); + $scope.getUniversityList(); + $scope.myModel.dateofbirth = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); + $scope.viewStudentDetailsPage = true; + } + + $scope.myModel = { + 'primaryPhone': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'caste': '', + 'category': '', + 'religion': '', + 'nationality': '', + 'prequalification': '', + 'occupation': '', + 'designation': '', + 'companyname': '', + 'referredby': '', + 'referredmobilenumber': '', + 'switchsetting': true, + 'DeactiveComments': '', + 'Comments': '' + }; + + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + + $scope.myModelCourseAdd = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + + $scope.addStudentView = function () { + // $scope.myModelCourseAdd = { + // 'university': '', + // 'course': '', + // 'batch': '', + // 'dateofjoining': '', + // 'enrollmentid': '' + // }; + // $scope.courseDataAdd = ''; + // $scope.batchDataAdd = ''; + } + + + + // 2017-11-23T00:00:00+0530 + // sorting function for table params + $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.getStudentList = function () { + $scope.loader = true; + var empListreq = { + method: 'POST', + url: apiPoint.url + 'getStudentList/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: localDetails + } + }; + $http(empListreq).then(function (response) { + if (response.data.studentList) { + $scope.loader = false; + $scope.studentData = true; + $scope.data = response.data.student_details; + + } else { + $scope.loader = false; + $scope.studentData = false; + } + }); + } + + $scope.editId = -1; + $scope.editCourseId = -1; + $scope.setEditId = function (id) { + $scope.editId = id; + $scope.editCourseId = -1; + } + + $scope.setEditCourseId = function (id) { + $scope.list = false; + $scope.getStudentCourseList(id); + $scope.currentStudentId = id; + // $scope.getStudentCourseDetails(id); + $scope.editCourseId = id; + $scope.editId = -1; + $scope.courseEditLoading = true; + } + + $scope.cancel = function () { + $scope.getStudentList(); + $scope.editId = -1; + $scope.editCourseId = -1; + } + + $scope.cancelCourseDetails = function () { + $scope.getStudentCourseList($scope.currentStudentId); + // $scope.editId = -1; + // $scope.editCourseId = -1; + } + + $scope.addStudentCourse = function () { + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + $scope.list = false; + $scope.courseEdit = false; + $scope.courseAdd = true; + } + + // add student course + $scope.addCourseFORM = { + + submit: function (form, myModelCourse, p) { + // alert(); + 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(JSON.stringify(p.StudentID)); + var formate = "dd-MM-yyyy"; + // $scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0; + // $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); + $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); + var req = { + method: 'POST', + url: apiPoint.url + 'insertStudentCourse/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + addStudent: p.StudentID, + coursedata: $scope.myModelCourse, + loginBranch: localDetails.localBranchID, + createdBy: localDetails.localUserID, + } + }; + $http(req).then(function (response) { + if (response.data.addStuCourseStatus == true) { + swal("Success!", response.data.message, "success"); + $scope.getStudentCourseList($scope.currentStudentId); + } else { + swal("Failed!", response.data.message, "error"); + $scope.getStudentCourseList($scope.currentStudentId); + } + }); + } + } + } + + // get Student Course List + $scope.getStudentCourseList = function (studentId) { + $scope.courseEditLoading = true; + $scope.list = true; + $scope.courseEdit = false; + $scope.courseAdd = false; + var req = { + method: 'POST', + url: apiPoint.url + 'getStudentCourseList/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + studentID: studentId + } + }; + $http(req).then(function (response) { + if (response.data.stuCourseDetails) { + $scope.courseEditLoading = false; + $scope.studentCourseList = response.data.course_details; + // $scope.stucour = $scope.studentCourse[0]; + } else { + } + }); + } + + // get student particular course details : params : studentCourseID + $scope.getStudentCourseDetails = function (studentcourseID) { + $scope.courseEditLoading = true; + $scope.stucour = ''; + $scope.list = false; + $scope.courseAdd = false; + $scope.courseEdit = true; + var req = { + method: 'POST', + url: apiPoint.url + 'getStudentCourseDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + studentcourseId: studentcourseID + } + }; + $http(req).then(function (response) { + if (response.data.stuCourseDetails) { + $scope.courseEditLoading = false; + $scope.studentCourse = response.data.course_details; + $scope.stucour = $scope.studentCourse[0]; + } else { + } + }); + } + + // update sutdent course details + $scope.updateStudentCourseDetails = function (form, datas, hidedoj) { + 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(datas.DOJ); + var formate = "dd-MM-yyyy"; + var checkDOJ = $filter('date')(new Date(datas.DOJ), formate); + datas.IsActive = datas.IsActive === true ? 1 : 0; + datas.DOJ = datas.DOJ == hidedoj ? datas.DOJ : $filter('date')(new Date(datas.DOJ), formate); + // alert(datas.DOJ); + var req = { + method: 'POST', + url: apiPoint.url + 'updateStudentCourseDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: datas, + updatedBy: localDetails.localUserID, + } + }; + $http(req).then(function (response) { + if (response.data.updateStuCourseStatus) { + swal("Success!", response.data.message, "success"); + $scope.getStudentCourseList($scope.currentStudentId); + // $scope.editCourseId = false; + } else { + // $scope.ldloading1[loading.replace('-', '_')] = false; + swal("Failed!", response.data.message, "error"); + $scope.getStudentCourseList($scope.currentStudentId); + } + }); + } + } + + + $scope.universityData = ''; + $scope.getUniversityList = function () { + var empListreq = { + method: 'POST', + url: apiPoint.url + 'getStudentUniversity/', + 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.onSlecetUnivEdit = function (id) { + $scope.myModelCourse.university = id; + $scope.onSlecetUniv(); + } + + $scope.onChangeSlecetUnivEdit = function (id) { + $scope.myModelCourse.university = id; + $scope.onSlecetUniv(); + $scope.stucour.CourseID = ''; + $scope.stucour.BatchCode = ''; + } + $scope.courseLoading = false; + $scope.onSlecetUniv = function () { + $scope.courseData = ''; + $scope.batchData = ''; + $scope.myModelCourse.course = ''; + $scope.myModelCourse.batch = ''; + $scope.courseLoading = true; + var univListreq = { + method: 'POST', + url: apiPoint.url + 'getCourseBatchForUniv/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.myModelCourse.university + } + }; + $http(univListreq).then(function (response) { + if (response.data.courseStatus) { + $scope.courseLoading = false; + $scope.courseData = response.data.course_details; + $scope.batchData = response.data.batch_details; + } else { + $scope.courseLoading = false; + } + }); + } + + + $scope.onSlecetUnivAdd = function () { + $scope.courseDataAdd = ''; + $scope.batchDataAdd = ''; + $scope.myModelCourseAdd.course = ''; + $scope.myModelCourseAdd.batch = ''; + $scope.courseLoading = true; + var univListreq = { + method: 'POST', + url: apiPoint.url + 'getCourseBatchForUniv/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.myModelCourseAdd.university + } + }; + $http(univListreq).then(function (response) { + if (response.data.courseStatus) { + $scope.courseLoading = false; + $scope.courseDataAdd = response.data.course_details; + $scope.batchDataAdd = response.data.batch_details; + } else { + $scope.courseLoading = false; + } + }); + } + + // check mobile number existing + $scope.checkMobileExist = function () { + var checkReq = { + method: 'POST', + url: apiPoint.url + 'chkStudentExistDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.myModel.primaryPhone, + check: 'mobileNumber' + } + }; + $http(checkReq).then(function (response) { + if (response.data.existMobile == true) { + swal("Warning!", response.data.message, "warning"); + $scope.myModel.primaryPhone = ''; + } else { + } + }); + } + + // check emailId existing + $scope.checkEmailExist = function () { + var checkReq = { + method: 'POST', + url: apiPoint.url + 'chkStudentExistDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.myModel.emailId, + check: 'emailId' + } + }; + $http(checkReq).then(function (response) { + if (response.data.existEmailId == true) { + swal("Warning!", response.data.message, "warning"); + $scope.myModel.emailId = ''; + } else { + } + }); + } + + //--------------------------------------------------------------> + // getting for image to show + //--------------------------------------------------------------> + + $scope.stepsModel = []; + $scope.imageUpload = function (event) { + var files = event.target.files; //FileList object + + for (var i = 0; i < files.length; i++) { + var file = files[i]; + var reader = new FileReader(); + reader.onload = $scope.imageIsLoaded; + reader.readAsDataURL(file); + } + } + + $scope.imageIsLoaded = function (e) { + $scope.$apply(function () { + // $scope.stepsModel.push(e.target.result); + $scope.stepsModel[0] = e.target.result; + }); + } + + //an array of files selected + $scope.files = []; + + //listen for the file selected event + $scope.$on("fileSelected", function (event, args) { + $scope.$apply(function () { + //add the file object to the scope's files collection + $scope.files[0] = args.file; + }); + }); + + // reset image + $scope.resetImage = function () { + $scope.files.length = 0; + $scope.stepsModel.length = 0; + } + + $scope.getChangeDate = function () { + var formate = "dd-MM-yyyy"; + $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); + + } + + $scope.tabactive1 = false; + $scope.tabactive2 = false; + $scope.tabActive = function (val) { + if (val === 'tabactive1') { + $scope.tabactive1 = true; + $scope.tabactive2 = false; + } else if (val === 'tabactive2') { + $scope.tabactive2 = true; + $scope.tabactive1 = false; + } + } + + $scope.myActivateDiv = function() { + $scope.viewStudentDetailsPage = false; + $scope.myModel = { + 'employeeId': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'primaryPhone': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'qualificaion': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'homeBranch': '', + 'dateofjoining': '', + 'dateofjoining': '', + 'role': '', + 'switchsetting': true, + 'DeactiveComments': '', + 'Comments': '' + }; + $scope.myModelCourseAdd = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + $timeout(function(){ + getDetails(); + },1000); + } + + // add student + $scope.studentFORM = { + submit: function (form, myModel, myModelCourseAdd) { + 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 { + $scope.disableButton = true; + var formate = "dd-MM-yyyy"; + $scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0; + $scope.myModelCourseAdd.dateofjoining = $filter('date')(new Date($scope.myModelCourseAdd.dateofjoining), formate); + var idStuProof = $scope.files[0]; + + if (idStuProof !== undefined) { + var formData = new FormData(); + var idProof = $scope.files[0]; + // alert(idProof); + formData.append("data", JSON.stringify($scope.myModel)); + formData.append("coursedata", JSON.stringify($scope.myModelCourseAdd)); + formData.append("createdBy", localDetails.localUserID); + formData.append("loginBranch", localDetails.localBranchID); + formData.append('idStuProof', idStuProof); + + $http.post(apiPoint.url + 'insertStudentImg/', formData, { transformRequest: angular.identity, headers: { 'Content-Type': undefined, 'Process-Data': false }, }).success(function (data) { - if (data.updateStuStatus == true) { + if (data.addStudentStatus == true) { swal("Success!", data.message, "success"); - $scope.getStudentList(); - $scope.editId = -1; + $scope.disableButton = false; + $scope.viewStudentDetailsPage = false; + // $state.go($state.current, {}, { reload: true }); + $scope.myActivateDiv(); + // $scope.tabactive2 = false; + // $scope.viewStudentDetailsPage = false; + // $scope.tabActive('tabactive1'); } else { // $scope.ldloading1[loading.replace('-', '_')] = false; swal("Failed!", data.message, "error"); } }); + } else { + var req = { + method: 'POST', + url: apiPoint.url + 'insertStudent/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.myModel, + coursedata: $scope.myModelCourseAdd, + loginBranch: localDetails.localBranchID, + createdBy: localDetails.localUserID, + } + }; + $http(req).then(function (response) { + if (response.data.addStudentStatus == true) { + swal("Success!", response.data.message, "success"); + $scope.disableButton = false; + $scope.viewStudentDetailsPage = false; + // $state.go($state.current, {}, { reload: true }); + $scope.myActivateDiv(); + // $scope.tabactive1 = true; + // $scope.tabactive2 = false; + + // $scope.tabActive('tabactive1'); + } else { + $scope.disableButton = false; + swal("Failed!", response.data.message, "error"); + } + }); + } + } + }, + reset: function (form) { + // $scope.myModel = angular.copy($scope.master); + form.$setPristine(true); + $scope.myModel = { + 'employeeId': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'primaryPhone': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'qualificaion': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'homeBranch': '', + 'dateofjoining': '', + 'dateofjoining': '', + 'role': '', + 'switchsetting': true, + 'DeactiveComments': '', + 'Comments': '' + }; + }, resetCourse: function (form) { + form.$setPristine(true); + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + } + } + + + // update check mobile exist + $scope.updateCheckMobileExist = function (p) { + var checkReq = { + method: 'POST', + url: apiPoint.url + 'chkUpdateStuExistDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + exceptId: p.StudentID, + datas: p.MobileNumber, + check: 'mobileNumber' + } + }; + $http(checkReq).then(function (response) { + if (response.data.existMobile == true) { + swal("Warning!", response.data.message, "warning"); + p.MobileNumber = response.data.resetValue.MobileNumber; + } else { + } + }); + } + + // update check email id exist + $scope.updateCheckEmailExist = function (p) { + var checkReq = { + method: 'POST', + url: apiPoint.url + 'chkUpdateStuExistDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + exceptId: p.StudentID, + datas: p.EmailID, + check: 'emailId' + } + }; + $http(checkReq).then(function (response) { + if (response.data.existEmailId == true) { + swal("Warning!", response.data.message, "warning"); + p.EmailID = response.data.resetValue.EmailID; + } else { + } + }); + } + + + + $scope.stepsModelEdit = []; + $scope.imageUploadEdit = function (event) { + var files = event.target.files; //FileList object + + for (var i = 0; i < files.length; i++) { + var file = files[i]; + var reader = new FileReader(); + reader.onload = $scope.imageIsLoadedEdit; + reader.readAsDataURL(file); + } + } + + $scope.imageIsLoadedEdit = function (e) { + $scope.$apply(function () { + // $scope.stepsModel.push(e.target.result); + $scope.stepsModelEdit[0] = e.target.result; + }); + } + + //an array of files selected + $scope.filesEdit = []; + //listen for the file selected event + $scope.$on("fileSelectedEdit", function (event, args) { + $scope.$apply(function () { + //add the file object to the scope's files collection + $scope.filesEdit[0] = args.file; + }); + }); + + + // reset image for Edit + $scope.resetImageEdit = function () { + $scope.filesEdit.length = 0; + $scope.stepsModelEdit.length = 0; + } + + // update student details + $scope.updateStuDetails = function (form, p, hidedob) { + 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(p.DOB); + var idProof = $scope.filesEdit[0]; + + var formate = "dd-MM-yyyy"; + var checkDOB = $filter('date')(new Date(p.DOB), formate); + p.IsActive = p.IsActive === true ? 1 : 0; + p.DOB = p.DOB == hidedob ? p.DOB : $filter('date')(new Date(p.DOB), formate); + + if (idProof == undefined) { + // alert(idProof); + var req = { + method: 'POST', + url: apiPoint.url + 'updateStudentExistDetail/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: p, + updatedBy: localDetails.localUserID, + } + }; + $http(req).then(function (response) { + if (response.data.updateStuStatus = true) { + swal("Success!", response.data.message, "success"); + $scope.getStudentList(); + $scope.editId = -1; + } else { + // $scope.ldloading1[loading.replace('-', '_')] = false; + swal("Failed!", response.data.message, "error"); + } + }); + } else { + var formData = new FormData(); + var idStuUpProof = $scope.filesEdit[0]; + // alert(idProof); + formData.append("data", JSON.stringify(p)); + formData.append("updatedBy", localDetails.localUserID); + formData.append('idStuUpProof', idStuUpProof); + + $http.post(apiPoint.url + 'updateStudentImgDetails/', formData, { + transformRequest: angular.identity, + headers: { 'Content-Type': undefined, 'Process-Data': false }, + }).success(function (data) { + if (data.updateStuStatus == true) { + swal("Success!", data.message, "success"); + $scope.getStudentList(); + $scope.editId = -1; + } else { + // $scope.ldloading1[loading.replace('-', '_')] = false; + swal("Failed!", data.message, "error"); + } + }); } } } diff --git a/Apollo/assets/views/daybook/daybookadmin.html b/Apollo/assets/views/daybook/daybookadmin.html index 692af822..bc340191 100755 --- a/Apollo/assets/views/daybook/daybookadmin.html +++ b/Apollo/assets/views/daybook/daybookadmin.html @@ -104,6 +104,16 @@ --> +
+
+ Loading... +
+
+
+

No + records found...

+
-
+
@@ -215,7 +225,7 @@
-
+
+ Loading... +
+
+
+

No + records found...

+
-
+
@@ -130,7 +140,11 @@
+ + +
+ @@ -216,7 +230,7 @@ } -
+
diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index ebd0fff6..c14a5fa1 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -1,7 +1,6 @@ - - +
@@ -96,12 +95,12 @@
- + - +
@@ -248,7 +248,7 @@ + max-date="todayDate"/> Date of Joining required
diff --git a/Apollo/assets/views/student/student_details.html b/Apollo/assets/views/student/student_details.html index 9a4f9bde..a8e2ef49 100755 --- a/Apollo/assets/views/student/student_details.html +++ b/Apollo/assets/views/student/student_details.html @@ -10,6 +10,28 @@
+
@@ -72,7 +94,7 @@
- +
{{p.Fathername}} ACTIVE DEACTIVE{{p.Comments}}
{{p.Comments}}
@@ -563,7 +585,7 @@ + max-date="todayDate"/> Date of Joining required diff --git a/Apollo/assets/views/student/student_details_SuperAdmin.html b/Apollo/assets/views/student/student_details_SuperAdmin.html new file mode 100644 index 00000000..957ccaa4 --- /dev/null +++ b/Apollo/assets/views/student/student_details_SuperAdmin.html @@ -0,0 +1,651 @@ + +
+
+
+

{{ mainTitle }}

+
+
+
+
+ + +
+ + +
+
+
+
+
+ + + + +
+ + Loading... +
+
+
+
+ +
+ + + +
+
+
+ +
+
+
+
+
+
Please Wait...
+
+
+ +
+

No + records found...

+
+ +
+
+
+ +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
MobileNumber + + Student Name + + Father Name + + Status + + Comments + + Details +
{{p.MobileNumber}}{{p.Firstname}} {{p.Lastname}}{{p.Fathername}}ACTIVE + DEACTIVE
{{p.Comments}}
+ + +
+ + + +
+ +
+
+
+
+ + + + + + +
+ +
+
+
+
+ + Personal Details + +
+
+
+
+ +
+
+
+
+
+
Profile Picture
+
+
+
+ + + + + +
+
+
+
+
+ + +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+ + + Mobile Number is required. + Enter a Valid Phone Number +
+
+ + + First Name required + Invalid First Name +
+
+ + + Last Name required + Invalid Last Name +
+
+
+
+ + + Father Name required + Invalid Father Name +
+
+ + + + Mother Name required + Invalid Last Name +
+
+ + + Email is required. + Please, enter a valid email address. +
+
+
+
+ + + Alternate Mobile Number is required. + Enter a Valid Phone Number +
+ +
+
+ + + + + Date of Birth is required. + Enter a Valid Date of Birth +
+
+
+ +
+ + + + + Gender is required. + +
+
+ +
+
+
+ + + Permanent Address is required +
+
+ + + Current Address is required +
+
+ + + Aadhar Number is required. + Enter a Valid Aadhar Number +
+
+ + + +
+ +
+
+
+ + + Aadhar Number is required. + Enter a Valid Details +
+
+ + + Aadhar Number is required. + Enter a Valid Details +
+
+
+
+ + + + Invalid Caste Name +
+
+ + + + Invalid Category Name +
+
+
+ +
+ + + + Invalid Religion Name +
+
+ + + + Invalid Nationality Name +
+
+ + + + Enter a Valid Qualification +
+
+
+ +
+ + + + Invalid Occupation +
+
+ + + + Invalid Designation +
+
+ + + + Invalid Company +
+
+
+
+ + + + Invalid Referred By +
+
+ + + Refer's Mobile Number is required. + Enter a Valid Phone Number +
+
+ + + Comments Should be Less than 100 Characters. + +
+
+
+
+ + +
+
+ +
+
+ +
+
+ +
+
+
+
+ + + Comments Should be Less than 100 Characters. + De-Active Comments is required +
+
+ + +
+
+ + Course Details + +
+
+ + + + University is Required +
+ +
+ + +
+ fetching... +
+
+ +
+ Course is required + +
+ +
+ + +
+ fetching... +
+
+ +
+ Batch is required + +
+
+
+
+ + + Enrollment ID required +
+ +
+ + + + + Date of Joining required +
+
+
+
+
+ + +
+
+
+
+ + +
+
+ +
+
+
+
+
+
+ + \ No newline at end of file