diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index fd919b92..dfa60676 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -200,6 +200,8 @@ class Student_Controller extends REST_Controller { $req['IsActive'] = $data['IsActive']; $req['BranchID'] = $data['BranchID']; $req['EnrollmentID'] = $data['EnrollmentID']; + $req['Specilization1'] = $data['Specilization1']; + $req['Specilization2'] = $data['Specilization2']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '': $data['DeactiveComments']; $req['UpdatedBy'] = $updatedBy; $date = date('Y-m-d H:i:s'); @@ -590,6 +592,10 @@ class Student_Controller extends REST_Controller { $reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; + + $reqCourse['Specilization1'] = $coursedata['specilization1']; + $reqCourse['Specilization2'] = $coursedata['specilization2']; + $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = '1'; $reqCourse['CreatedBy'] = $createdBy; @@ -668,6 +674,10 @@ class Student_Controller extends REST_Controller { $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; + + $reqCourse['Specilization1'] = $coursedata['specilization1']; + $reqCourse['Specilization2'] = $coursedata['specilization2']; + $reqCourse['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $reqCourse['CreatedOn'] = $date; @@ -740,6 +750,10 @@ class Student_Controller extends REST_Controller { $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; + + $reqCourse['Specilization1'] = $coursedata['specilization1']; + $reqCourse['Specilization2'] = $coursedata['specilization2']; + $reqCourse['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $reqCourse['CreatedOn'] = $date; diff --git a/Apollo/api/application/models/Broadcast_model.php b/Apollo/api/application/models/Broadcast_model.php index 7cec67fa..d7bad9c3 100644 --- a/Apollo/api/application/models/Broadcast_model.php +++ b/Apollo/api/application/models/Broadcast_model.php @@ -318,7 +318,7 @@ class Broadcast_model extends CI_Model curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $output =curl_exec($ch); - +// print_r($output);exit(); curl_close($ch); $arrss = explode('
', $output); @@ -336,7 +336,7 @@ class Broadcast_model extends CI_Model $c = count($arrss); for($i=0 ; $i < $c; $i++){ // echo $arrss[$i];exit(); - if( end($arrss)) { + if( $i == $c-1) { break; } else { $a = explode('|', $arrss[$i]); @@ -346,7 +346,7 @@ class Broadcast_model extends CI_Model $delvOn = $a[3]; $qury1 = "SELECT * FROM T_BroadcastDeliveryCron WHERE MsgId = '$msgId'"; $choe = $this->db->query($qury1)->first_row(); - // print_r($choe);exit(); + if($this->db->query($qury1)->first_row()){ $qury2 = "UPDATE T_BroadcastDeliveryCron SET DeliveredStatus = '$delvStatus', DeliveredOn = '$delvOn' WHERE MsgId = '$msgId'"; diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index 373eb0fa..170694c1 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -452,7 +452,7 @@ class Student_model extends CI_Model // echo $req['localBranchID'];exit(); - $this->db->select('t1.*,t2.UniversityName,t3.CourseName,t3.CourseCode,t3.Specilization1,t3.Specilization2,t4.SessionName'); + $this->db->select('t1.*,t2.UniversityName,t3.CourseName,t3.CourseCode,t4.SessionName'); $this->db->from('' . STUDENTCOURSE . ' as t1'); $this->db->join('' . UNIVERSITY . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); $this->db->join('' . COURSE . ' as t3', 't3.CourseID = t1.CourseID', 'LEFT'); diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index dc8f6755..5f7b8494 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -252,8 +252,8 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com } }).state('app.student.studentDetails', { url: '/studentDetails', - templateUrl: "assets/views/student/student_details.html", - resolve: loadSequence('ui.select','spin', 'ui.mask', 'ladda', 'angular-ladda', 'studentCtrl', 'ngTable'), + templateUrl: "assets/views/student/student_details.html", + resolve: loadSequence('ui.select', 'spin', 'ui.mask', 'monospaced.elastic', 'ladda', 'touchspin-plugin', 'angular-ladda', 'studentCtrl', 'ngTable'), title: 'Manage Student Details', ncyBreadcrumb: { label: 'Manage Student Details' @@ -261,7 +261,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com }).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'), + resolve: loadSequence('ui.select', 'spin', 'ui.mask', 'monospaced.elastic', 'ladda', 'touchspin-plugin', 'angular-ladda', 'studentCtrl', 'ngTable'), title: 'Manage Details', ncyBreadcrumb: { label: 'Manage Details' diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 349de841..e2599faa 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -9,52 +9,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", * student details capture * by : kdk */ - $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': '' - }; + // Inactive Branch Check $scope.inActiveBranchStatus = false; $scope.addStudentView = function () { // check the local branch is active for add a new student for this branch @@ -80,21 +36,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } else { } }); - - - // $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) { @@ -114,11 +57,13 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", sixteenYearsBeforeNow = new Date(nowInMS - sixteenYearsInMS); if (localDetail != null) { if (localDetails.localType === 'R003' || localDetails.localType === 'R002') { - $scope.currentDate = new Date(sixteenYearsBeforeNow); + // $scope.currentDate = new Date(sixteenYearsBeforeNow); + $scope.currentDate = new Date(); $scope.getStudentList(); $scope.getUniversityList(); $scope.getUniversitySearchList(); - // $scope.myModel.dateofbirth = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); + $scope.myModelCourseAdd.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); + $scope.myModelCourse.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); } else { ipCookie.remove('cookiechk'); $window.localStorage.clear(); @@ -215,6 +160,510 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); } + + //======================================= Student Entrollment ======================================================= + $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': '', + 'specilization1': '', + 'specilization2': '' + }; + + $scope.myModelCourseAdd = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' + }; + + //=======================================================================> + /* + * Existing Student Entroll Course Details + * + */ + + $scope.existingStudentView = false; + $scope.existingStudentId = ''; + // 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) { + if (response.data.details.type === 'R001') { + $scope.myModel.primaryPhone = ''; + SweetAlert.swal({ + title: "Warning!", + text: "Student exist with this same number." + "\n Do you want to enroll new course!", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#007aff", + confirmButtonText: "Yes!" + }, function (res) { + if (res === true) { + $scope.existingStudentView = true; + $scope.existingStudentId = response.data.details.studentId; + } + }); + + } else if (response.data.details.type === 'R002' || response.data.details.type === 'R003') { + swal("Warning!", response.data.message, "warning"); + $scope.myModel.primaryPhone = ''; + } else { + swal("Warning!", response.data.message, "warning"); + $scope.myModel.primaryPhone = ''; + } + } else { + } + }); + } + + $scope.stuExistingDetailsShowLoading = false; + + $scope.getExistStudentDetails = function () { + // alert($scope.existingStudentId); + $scope.stuExistingDetailsShowLoading = true; + var checkExisReq = { + method: 'POST', + url: apiPoint.url + 'getExistingStudentDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: $scope.existingStudentId, + reqDetails: localDetails + } + }; + $http(checkExisReq).then(function (response) { + if (response.data.existingStudentDetailsStatus == true) { + $scope.existingStuPersonalDetails = response.data.personalDetails[0]; + $scope.existingStuCourseDetails = response.data.courseDetails; + $scope.stuExistingDetailsShowLoading = false; + } else { + $scope.stuExistingDetailsShowLoading = false; + } + }); + } + + $scope.cancelExisStudentView = function () { + $scope.existingStudentView = false; + } + + $scope.existStuCourseDetailsCheck = function (myModelCourseObjExitStu) { + $scope.myModelCourse.course = myModelCourseObjExitStu.selected.CourseID; + $scope.myModelCourse.specilization1 = myModelCourseObjExitStu.selected.Specilization1; + $scope.myModelCourse.specilization2 = myModelCourseObjExitStu.selected.Specilization2; + } + + $scope.getDOJchangesOnExistingStudentView = function () { + // alert(); + try { + var formate = "dd-MM-yyyy"; + $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); + } + catch(e) { + } + } + + + // add student course for existing student + $scope.addCourseExistingStudent = { + submit: function (form, myModelCourse, p) { + 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(); + } else { + var formate = "dd-MM-yyyy"; + // $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(" ", "Student course added successfully. ", "success"); + $state.go($state.current, {}, { reload: true }); + } else { + swal(" ", response.data.message, "error"); + $scope.myModelCourse.dateofjoining = ''; + } + }); + } + }, + cancel: function () { + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' + }; + } + + } + //=====================================================================> + + + + $scope.myModelCourseObjExitStu = {}; + $scope.myModelCourseObjStu = {}; + $scope.courseLoading = false; + $scope.onSlecetUniv = function () { + $scope.courseData = []; + $scope.batchData = ''; + $scope.myModelCourse.course = ''; + $scope.myModelCourse.batch = ''; + $scope.myModelCourse.specilization1 = ''; + $scope.myModelCourse.specilization2 = ''; + $scope.myModelCourseObjExitStu.selected = undefined; + $scope.myModelCourseObjStu.selected = undefined; + $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.myModelCourseObj = {}; + $scope.onSlecetUnivAdd = function () { + $scope.courseDataAdd = []; + $scope.batchDataAdd = ''; + $scope.myModelCourseAdd.course = ''; + $scope.myModelCourseAdd.batch = ''; + $scope.myModelCourseAdd.specilization1 = ''; + $scope.myModelCourseAdd.specilization2 = ''; + $scope.myModelCourseObj.selected = undefined; + $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; + $scope.courseDataAdd = []; + } + }); + } + + $scope.courseChange = function (myModelCourseObj) { + // let myCourseDetails = myModelCourseObj.CourseID; + $scope.myModelCourseAdd.course = myModelCourseObj.selected.CourseID; + $scope.myModelCourseAdd.specilization1 = myModelCourseObj.selected.Specilization1; + $scope.myModelCourseAdd.specilization2 = myModelCourseObj.selected.Specilization2; + } + + + + // 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 () { + // alert(); + try { + var formate = "dd-MM-yyyy"; + $scope.myModelCourseAdd.dateofjoining = $filter('date')(new Date($scope.myModelCourseAdd.dateofjoining), formate); + // alert($scope.myModel.dateofbirth); + // var myDate = new Date($scope.myModel.dateofbirth); + // alert(myDate); + // if(typeof myDate === 'function') { + // alert("true") + // } else { + // alert("error") + // } + } + catch(e) { + // alert('error'); + // alert(err); + } + } + + // 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.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); + $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]; + // alert(JSON.stringify($scope.myModel)); + 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.addStudentStatus == true) { + swal(" ", "Student added successfully.", "success"); + $scope.disableButton = false; + $state.go($state.current, {}, { reload: true }); + } else { + // $scope.ldloading1[loading.replace('-', '_')] = false; + swal(" ", data.message, "error"); + // $scope.disableButton = false; + } + }); + } 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(" ", "Student added successfully.", "success"); + $scope.disableButton = false; + $state.go($state.current, {}, { reload: true }); + } else { + // $scope.disableButton = false; + swal(" ", response.data.message, "error"); + } + }); + } + } + }, + reset: function (form) { + form.$setPristine(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.myModelCourseAdd = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' + }; + }, resetCourse: function (form) { + form.$setPristine(true); + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' + }; + } + } + + + //======================================================================> + $scope.editId = -1; $scope.editCourseId = -1; $scope.setEditId = function (id) { @@ -227,7 +676,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.list = false; $scope.getStudentCourseList(id); $scope.currentStudentId = id; - // $scope.getStudentCourseDetails(id); $scope.editCourseId = id; $scope.editId = -1; $scope.courseEditLoading = true; @@ -252,13 +700,35 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; + $scope.currentDate = new Date(); + $scope.myModelCourse.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); $scope.list = false; $scope.courseEdit = false; $scope.courseAdd = true; } + $scope.addStudentCourseDetailsChanges = function (objCourseDetails) { + $scope.myModelCourse.course = objCourseDetails.selected.CourseID; + $scope.myModelCourse.specilization1 = objCourseDetails.selected.Specilization1; + $scope.myModelCourse.specilization2 = objCourseDetails.selected.Specilization2; + } + + $scope.stuAddNewCourseDateChange = function () { + // alert(); + try { + var formate = "dd-MM-yyyy"; + $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); + + } + catch(e) { + } + } + + // add student course $scope.addCourseFORM = { @@ -284,7 +754,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 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); + // $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); var req = { method: 'POST', url: apiPoint.url + 'insertStudentCourse/', @@ -413,7 +883,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } } - $scope.universityData = ''; $scope.getUniversityList = function () { var empListreq = { @@ -434,23 +903,27 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); } - $scope.onSlecetUnivEdit = function (id) { - $scope.myModelCourse.university = id; - $scope.onSlecetUniv(); + $scope.stuCourseEditDetailsObj = {}; + $scope.onSlecetUnivEdit = function (univid, coursid) { + let UniversityId = univid; + $scope.onSlecetUnivEditCourse(UniversityId, coursid); } - $scope.onChangeSlecetUnivEdit = function (id) { - $scope.myModelCourse.university = id; - $scope.onSlecetUniv(); + $scope.onChangeSlecetUnivEdit = function (univid) { + let UniversityId = univid; + $scope.onSlecetUnivEditCourse(UniversityId); $scope.stucour.CourseID = ''; $scope.stucour.BatchCode = ''; + $scope.stucour.Specilization1 = ''; + $scope.stucour.Specilization2 = ''; } + $scope.courseLoading = false; - $scope.onSlecetUniv = function () { - $scope.courseData = ''; - $scope.batchData = ''; - $scope.myModelCourse.course = ''; - $scope.myModelCourse.batch = ''; + $scope.onSlecetUnivEditCourse = function (UniversityId, CourseId = null) { + $scope.courseDataEditScrn = []; + // Object.keys($scope.stuCourseEditDetailsObj).length = 0; + $scope.stuCourseEditDetailsObj.selected = undefined; + // alert(JSON.stringify($scope.stuCourseEditDetailsObj)); $scope.courseLoading = true; var univListreq = { method: 'POST', @@ -459,405 +932,37 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'Content-Type': 'application/json' }, data: { - data: $scope.myModelCourse.university + data: UniversityId } }; $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; - } - }); - } - - $scope.existingStudentView = false; - $scope.existingStudentId = ''; - // 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) { - if (response.data.details.type === 'R001') { - // swal("Warning!", response.data.message, "warning"); - $scope.myModel.primaryPhone = ''; - // student registration find student previously exist - // $scope.existingStudentView = true; - // $scope.existingStudentId = response.data.details.studentId; - SweetAlert.swal({ - title: "Warning!", - text: "Student exist with this same number." + "\n Do you want to enroll new course!", - type: "warning", - showCancelButton: true, - confirmButtonColor: "#007aff", - confirmButtonText: "Yes!" - }, function (res) { - if (res === true) { - $scope.existingStudentView = true; - $scope.existingStudentId = response.data.details.studentId; - } - }); - - } else if (response.data.details.type === 'R002' || response.data.details.type === 'R003') { - swal("Warning!", response.data.message, "warning"); - $scope.myModel.primaryPhone = ''; + $scope.courseDataEditScrn = response.data.course_details; + if (CourseId !== null) { + let courseData = $scope.courseDataEditScrn; + let details = courseData.filter(x => x.CourseID === CourseId); + $scope.stuCourseEditDetailsObj.selected = details[0]; } else { - swal("Warning!", response.data.message, "warning"); - $scope.myModel.primaryPhone = ''; + $scope.stuCourseEditDetailsObj.selected = undefined; } } else { + $scope.courseLoading = false; } }); } - $scope.stuExistingDetailsShowLoading = false; - - $scope.getExistStudentDetails = function () { - // alert($scope.existingStudentId); - $scope.stuExistingDetailsShowLoading = true; - var checkExisReq = { - method: 'POST', - url: apiPoint.url + 'getExistingStudentDetails/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: $scope.existingStudentId, - reqDetails: localDetails - } - }; - $http(checkExisReq).then(function (response) { - if (response.data.existingStudentDetailsStatus == true) { - $scope.existingStuPersonalDetails = response.data.personalDetails[0]; - $scope.existingStuCourseDetails = response.data.courseDetails; - $scope.stuExistingDetailsShowLoading = false; - } else { - $scope.stuExistingDetailsShowLoading = false; - } - }); + $scope.editStudentCourseDetailsChanges = function (obj) { + let stuCourseEditDetailsObj = obj.selected; + $scope.stucour.CourseID = stuCourseEditDetailsObj.CourseID; + $scope.stucour.Specilization1 = stuCourseEditDetailsObj.Specilization1; + $scope.stucour.Specilization2 = stuCourseEditDetailsObj.Specilization2; } - $scope.cancelExisStudentView = function () { - $scope.existingStudentView = false; - } - - - // add student course for existing student - $scope.addCourseExistingStudent = { - - submit: function (form, myModelCourse, p) { - 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)); - // alert(JSON.stringify(myModelCourse)); - var formate = "dd-MM-yyyy"; - $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(" ", "Student course added successfully. ", "success"); - $state.go($state.current, {}, { reload: true }); - // $scope.getStudentCourseList($scope.currentStudentId); - } else { - swal(" ", response.data.message, "error"); - // $scope.getStudentCourseList($scope.currentStudentId); - $scope.myModelCourse.dateofjoining = ''; - } - }); - } - }, - cancel: function () { - $scope.myModelCourse = { - 'university': '', - 'course': '', - 'batch': '', - 'dateofjoining': '', - 'enrollmentid': '' - }; - } - - } - - - - // 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 () { - // // alert(); - // try { - // var formate = "dd-MM-yyyy"; - // $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); - // // alert($scope.myModel.dateofbirth); - // // var myDate = new Date($scope.myModel.dateofbirth); - // // alert(myDate); - // // if(typeof myDate === 'function') { - // // alert("true") - // // } else { - // // alert("error") - // // } - // } - // catch(e) { - // // alert('error'); - // // alert(err); - // } + // $scope.getStudentCourseEditObj = function() { + // let studentCourseData = $scope.courseData; + // alert(JSON.stringify(studentCourseData)); // } - - // 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.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); - $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]; - // alert(JSON.stringify($scope.myModel)); - 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.addStudentStatus == true) { - swal(" ", "Student added successfully.", "success"); - $scope.disableButton = false; - $state.go($state.current, {}, { reload: true }); - } else { - // $scope.ldloading1[loading.replace('-', '_')] = false; - swal(" ", data.message, "error"); - // $scope.disableButton = false; - } - }); - } 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(" ", "Student added successfully.", "success"); - $scope.disableButton = false; - $state.go($state.current, {}, { reload: true }); - } else { - // $scope.disableButton = false; - swal(" ", response.data.message, "error"); - } - }); - } - } - }, - reset: function (form) { - // $scope.myModel = angular.copy($scope.master); - form.$setPristine(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.myModelCourseAdd = { - 'university': '', - 'course': '', - 'batch': '', - 'dateofjoining': '', - 'enrollmentid': '' - }; - }, resetCourse: function (form) { - form.$setPristine(true); - $scope.myModelCourse = { - 'university': '', - 'course': '', - 'batch': '', - 'dateofjoining': '', - 'enrollmentid': '' - }; - } - } - - // update check mobile exist $scope.updateCheckMobileExist = function (p) { var checkReq = { @@ -904,9 +1009,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); } - // start : entrollment document upload ============================= - $scope.studentDocumentsList = ''; // get Student Document Details $scope.getStuEntrollDocDetails = function (stuId) { @@ -991,7 +1094,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.documentAddDetailsLoading = false; $scope.studentEntrollDocFORM = { submit: function (form, myModelAddDocuments, stuID) { - var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -1008,7 +1110,6 @@ 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 { - if ($scope.filesDocuments[0] == undefined || $scope.filesDocuments[0] == null || $scope.filesDocuments.length === 0) { swal("Warning!", "Choose the File.", "warning"); } else { @@ -1059,9 +1160,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // $scope.PendingDocNotFound = false; // student pending document details - $scope.getStudentPendingEntrolDocDetails = function(stuId) { + $scope.getStudentPendingEntrolDocDetails = function (stuId) { // $scope.studentDocumentsList = ''; - var getStudentPendingDocDetails = { method: 'POST', url: apiPoint.url + 'getListofStuPendingDocDetails/', @@ -1083,14 +1183,12 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); } - $scope.myModelAddPendingDocDetails = { "documentDetails": "", "checkTracking": false } - $scope.documentTrackAddDetailsLoading = false; - + $scope.studentEntrollPendingDocFORM = { submit: function (form, myModelAddPendingDocDetails, stuID) { $scope.documentTrackAddDetailsLoading = true; @@ -1110,11 +1208,11 @@ 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 { - var ModelDetails = { - "student" : stuID, - "doc_Details": myModelAddPendingDocDetails.documentDetails, - "checkTracking": myModelAddPendingDocDetails.checkTracking - }; + var ModelDetails = { + "student": stuID, + "doc_Details": myModelAddPendingDocDetails.documentDetails, + "checkTracking": myModelAddPendingDocDetails.checkTracking + }; var updateStudentPendingDocDetails = { method: 'POST', url: apiPoint.url + 'addStudentEnrollPendingDocDetails/', @@ -1128,31 +1226,30 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }; $http(updateStudentPendingDocDetails).then(function (response) { if (response.data.AddStuPendingDocStatus == true) { - $scope.getStudentPendingEntrolDocDetails(stuID); - $scope.documentTrackAddDetailsLoading = false; - $scope.myModelAddPendingDocDetails = { - "documentDetails": "", - "checkTracking": false - } + $scope.getStudentPendingEntrolDocDetails(stuID); + $scope.documentTrackAddDetailsLoading = false; + $scope.myModelAddPendingDocDetails = { + "documentDetails": "", + "checkTracking": false + } } else { swal(" ", res.data.message, "error"); - $scope.documentTrackAddDetailsLoading = false; + $scope.documentTrackAddDetailsLoading = false; } }); } }, reset: function (form) { - $scope.myModelAddPendingDocDetails = { - "documentDetails": "", - "checkTracking": false - } + $scope.myModelAddPendingDocDetails = { + "documentDetails": "", + "checkTracking": false + } } } - $scope.deletePendingDocDetails = function(details, StuID, Url) { -// alert(JSON.stringify(details)); - - SweetAlert.swal({ + $scope.deletePendingDocDetails = function (details, StuID, Url) { + // alert(JSON.stringify(details)); + SweetAlert.swal({ title: "Warning!", text: "Want to Delete this Entry ?", type: "warning", @@ -1161,7 +1258,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", confirmButtonText: "Yes!" }, function (res) { if (res === true) { - $scope.documentTrackAddDetailsLoading = true; + $scope.documentTrackAddDetailsLoading = true; var deleteDocEntry = { method: 'POST', url: apiPoint.url + 'deleteDocPendingDetails/', @@ -1176,21 +1273,19 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $http(deleteDocEntry).then(function (response) { if (response.data.deleteStatus == true) { // swal("Success!", response.data.message, "success"); - $scope.documentTrackAddDetailsLoading = false; + $scope.documentTrackAddDetailsLoading = false; // $scope.studentDocumentsList = ''; $scope.getStudentPendingEntrolDocDetails(StuID); } else { swal(" ", res.data.message, "error"); - $scope.documentTrackAddDetailsLoading = false; + $scope.documentTrackAddDetailsLoading = false; } }); } }); } - // end : entrollment document upload ==================================== - $scope.stepsModelEdit = []; $scope.imageUploadEdit = function (event) { var files = event.target.files; //FileList object @@ -1220,7 +1315,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }); }); - // reset image for Edit $scope.resetImageEdit = function () { $scope.filesEdit.length = 0; @@ -1249,7 +1343,6 @@ 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; @@ -1288,7 +1381,6 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 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 }, @@ -1308,10 +1400,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } } } - - }]); + + + // Student datails for super admin : Start app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', '$timeout', '$window', "flowFactory", "SweetAlert", function ($scope, toaster, $filter, ngTableParams, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, $timeout, $window, flowFactory, SweetAlert) { /** @@ -1375,11 +1468,13 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl var nowInMS = new Date().getTime(), sixteenYearsInMS = 1000 * 60 * 60 * 24 * 365 * 16, sixteenYearsBeforeNow = new Date(nowInMS - sixteenYearsInMS); - $scope.currentDate = new Date(sixteenYearsBeforeNow); + $scope.currentDate = new Date(); $scope.getStudentList(); $scope.getUniversityList(); $scope.getUniversitySearchList(); // $scope.myModel.dateofbirth = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); + $scope.myModelCourseAdd.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); + $scope.myModelCourse.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); $scope.viewStudentDetailsPage = true; } @@ -1413,12 +1508,14 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'Comments': '' }; - $scope.myModelCourse = { + $scope.myModelCourse = { 'university': '', 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; $scope.myModelCourseAdd = { @@ -1426,7 +1523,9 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; $scope.inActiveBranchStatus = false; @@ -1477,8 +1576,6 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.reverse = !$scope.reverse; //if true make it false and vice versa } - - // get University List $scope.universitySearchData = ''; $scope.getUniversitySearchList = function () { @@ -1592,13 +1689,35 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; + $scope.currentDate = new Date(); + $scope.myModelCourse.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); + $scope.list = false; $scope.courseEdit = false; $scope.courseAdd = true; } + $scope.addStudentCourseDetailsChanges = function (objCourseDetails) { + $scope.myModelCourse.course = objCourseDetails.selected.CourseID; + $scope.myModelCourse.specilization1 = objCourseDetails.selected.Specilization1; + $scope.myModelCourse.specilization2 = objCourseDetails.selected.Specilization2; + } + + $scope.stuAddNewCourseDateChange = function () { + // alert(); + try { + var formate = "dd-MM-yyyy"; + $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); + + } + catch(e) { + } + } + // add student course $scope.addCourseFORM = { @@ -1624,7 +1743,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 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); + // $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); var req = { method: 'POST', url: apiPoint.url + 'insertStudentCourse/', @@ -1706,6 +1825,65 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl }); } + + $scope.stuCourseEditDetailsObj = {}; + $scope.onSlecetUnivEdit = function (univid, coursid) { + let UniversityId = univid; + $scope.onSlecetUnivEditCourse(UniversityId, coursid); + } + + $scope.onChangeSlecetUnivEdit = function (univid) { + let UniversityId = univid; + $scope.onSlecetUnivEditCourse(UniversityId); + $scope.stucour.CourseID = ''; + $scope.stucour.BatchCode = ''; + $scope.stucour.Specilization1 = ''; + $scope.stucour.Specilization2 = ''; + } + + $scope.courseLoading = false; + $scope.onSlecetUnivEditCourse = function (UniversityId, CourseId = null) { + $scope.courseDataEditScrn = []; + // Object.keys($scope.stuCourseEditDetailsObj).length = 0; + $scope.stuCourseEditDetailsObj.selected = undefined; + // alert(JSON.stringify($scope.stuCourseEditDetailsObj)); + $scope.courseLoading = true; + var univListreq = { + method: 'POST', + url: apiPoint.url + 'getCourseBatchForUniv/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: UniversityId + } + }; + $http(univListreq).then(function (response) { + if (response.data.courseStatus) { + $scope.courseLoading = false; + $scope.courseDataEditScrn = response.data.course_details; + if (CourseId !== null) { + let courseData = $scope.courseDataEditScrn; + let details = courseData.filter(x => x.CourseID === CourseId); + $scope.stuCourseEditDetailsObj.selected = details[0]; + } else { + $scope.stuCourseEditDetailsObj.selected = undefined; + } + } else { + $scope.courseLoading = false; + } + }); + } + + + $scope.editStudentCourseDetailsChanges = function (obj) { + let stuCourseEditDetailsObj = obj.selected; + $scope.stucour.CourseID = stuCourseEditDetailsObj.CourseID; + $scope.stucour.Specilization1 = stuCourseEditDetailsObj.Specilization1; + $scope.stucour.Specilization2 = stuCourseEditDetailsObj.Specilization2; + } + + // update sutdent course details $scope.updateStudentCourseDetails = function (form, datas, hidedoj) { if (form.$invalid) { @@ -1775,24 +1953,19 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl }); } - $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.myModelCourseObjExitStu = {}; + $scope.myModelCourseObjStu = {}; $scope.onSlecetUniv = function () { - $scope.courseData = ''; + $scope.courseData = []; $scope.batchData = ''; $scope.myModelCourse.course = ''; $scope.myModelCourse.batch = ''; + $scope.myModelCourse.specilization1 = ''; + $scope.myModelCourse.specilization2 = ''; $scope.courseLoading = true; + $scope.myModelCourseObjExitStu.selected = undefined; + $scope.myModelCourseObjStu.selected = undefined; var univListreq = { method: 'POST', url: apiPoint.url + 'getCourseBatchForUniv/', @@ -1814,12 +1987,16 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl }); } - + $scope.myModelCourseObj={}; $scope.onSlecetUnivAdd = function () { - $scope.courseDataAdd = ''; + $scope.courseDataAdd = []; $scope.batchDataAdd = ''; $scope.myModelCourseAdd.course = ''; $scope.myModelCourseAdd.batch = ''; + $scope.myModelCourseAdd.specilization1 = ''; + $scope.myModelCourseAdd.specilization2 = ''; + $scope.myModelCourseObj.selected = undefined; + $scope.courseLoading = true; var univListreq = { method: 'POST', @@ -1928,6 +2105,22 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.existingStudentView = false; } + $scope.existStuCourseDetailsCheck = function (myModelCourseObjExitStu) { + $scope.myModelCourse.course = myModelCourseObjExitStu.selected.CourseID; + $scope.myModelCourse.specilization1 = myModelCourseObjExitStu.selected.Specilization1; + $scope.myModelCourse.specilization2 = myModelCourseObjExitStu.selected.Specilization2; + } + + $scope.getDOJchangesOnExistingStudentView = function () { + // alert(); + try { + var formate = "dd-MM-yyyy"; + $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); + } + catch(e) { + } + } + // add student course for existing student $scope.addCourseExistingStudent = { @@ -1951,7 +2144,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl // alert(JSON.stringify(p.StudentID)); // alert(JSON.stringify(myModelCourse)); var formate = "dd-MM-yyyy"; - $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); + // $scope.myModelCourse.dateofjoining = $filter('date')(new Date($scope.myModelCourse.dateofjoining), formate); var req = { method: 'POST', url: apiPoint.url + 'insertStudentCourse/', @@ -1987,12 +2180,23 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; } - } + + $scope.courseChange = function (myModelCourseObj) { + // let myCourseDetails = myModelCourseObj.CourseID; + $scope.myModelCourseAdd.course = myModelCourseObj.selected.CourseID; + $scope.myModelCourseAdd.specilization1 = myModelCourseObj.selected.Specilization1; + $scope.myModelCourseAdd.specilization2 = myModelCourseObj.selected.Specilization2; + } + + + // check emailId existing $scope.checkEmailExist = function () { var checkReq = { @@ -2109,13 +2313,35 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; $timeout(function () { getDetails(); }, 1000); } + $scope.getChangeDate = function () { + // alert(); + try { + var formate = "dd-MM-yyyy"; + $scope.myModelCourseAdd.dateofjoining = $filter('date')(new Date($scope.myModelCourseAdd.dateofjoining), formate); + // alert($scope.myModel.dateofbirth); + // var myDate = new Date($scope.myModel.dateofbirth); + // alert(myDate); + // if(typeof myDate === 'function') { + // alert("true") + // } else { + // alert("error") + // } + } + catch(e) { + // alert('error'); + // alert(err); + + } + } // add student $scope.studentFORM = { submit: function (form, myModel, myModelCourseAdd) { @@ -2140,7 +2366,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl var formate = "dd-MM-yyyy"; $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); myModel.switchsetting = myModel.switchsetting === true ? 1 : 0; - myModelCourseAdd.dateofjoining = $filter('date')(new Date(myModelCourseAdd.dateofjoining), formate); + // myModelCourseAdd.dateofjoining = $filter('date')(new Date(myModelCourseAdd.dateofjoining), formate); var idStuProof = $scope.files[0]; if (idStuProof !== undefined) { @@ -2158,7 +2384,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl headers: { 'Content-Type': undefined, 'Process-Data': false }, }).success(function (data) { if (data.addStudentStatus == true) { - swal(" ", "Student picture added successfully.", "success"); + swal(" ", "Student added successfully.", "success"); $scope.disableButton = false; $scope.viewStudentDetailsPage = false; // $state.go($state.current, {}, { reload: true }); @@ -2242,7 +2468,9 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; }, resetCourse: function (form) { form.$setPristine(true); @@ -2251,7 +2479,9 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'course': '', 'batch': '', 'dateofjoining': '', - 'enrollmentid': '' + 'enrollmentid': '', + 'specilization1': '', + 'specilization2': '' }; } } diff --git a/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js b/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js index a28330d3..742c07fe 100755 --- a/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js +++ b/Apollo/assets/js/controllers/studyMaterialStatusCtrl.js @@ -289,6 +289,20 @@ app.controller('studyMaterialStatusCtrl', ["$scope", "toaster", "$filter", "ngTa } } + $scope.maxDateForStatusUpdt = ''; + $scope.statusCheck = function(sts){ + let stas = JSON.parse(sts); + $scope.myStatusModel.staus = stas.ListCode; + let str = stas.ListName; + $scope.myStatusModel.dateOn = ''; + if(str.toLowerCase() == "issued" || str.toLowerCase() == "received") { + $scope.maxDateForStatusUpdt = new Date(); + }else { + $scope.maxDateForStatusUpdt = ''; + } + } + + $scope.showSingleLateralSemType = false; // sem year show when REGULAR or LATER ENTRY diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html index a47bf991..4481ab00 100755 --- a/Apollo/assets/views/daybook/daybook.html +++ b/Apollo/assets/views/daybook/daybook.html @@ -148,7 +148,7 @@ - + diff --git a/Apollo/assets/views/status-update/study_material_status.html b/Apollo/assets/views/status-update/study_material_status.html index 678d9fd4..9678de9a 100755 --- a/Apollo/assets/views/status-update/study_material_status.html +++ b/Apollo/assets/views/status-update/study_material_status.html @@ -284,11 +284,15 @@ - - + + Status is Required @@ -311,7 +315,7 @@

Fetching ...

@@ -46,10 +51,10 @@
- -
@@ -66,7 +71,7 @@ - - - + Invalid Specilization 1 - - -
+
- -
- -
- - - - - Invalid Specilization 1 - - -
-
- - - - - Invalid Specilization 2 - - -
-
- -
-
+
-
- Invalid Specilization 1 - - -
-
-
+
+ - - - - Invalid Specilization 2 - - -
-
- -
- -
- - - - - Invalid Specilization 1 - - -
-
- - - - - Invalid Specilization 2 - - -
-
-
-
+
+ - - Enrollment ID is required -
+ + Enrollment ID is required +
@@ -407,7 +325,7 @@ + max-date="todayDate" ng-change="stuAddNewCourseDateChange()"/> Date of Joining is required
diff --git a/Apollo/assets/views/student/editStudentDetails.html b/Apollo/assets/views/student/editStudentDetails.html index 3f73f03d..2777b1d4 100755 --- a/Apollo/assets/views/student/editStudentDetails.html +++ b/Apollo/assets/views/student/editStudentDetails.html @@ -1,4 +1,20 @@ +
@@ -16,6 +32,7 @@
+