diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index 10a7536b..6e7135a6 100644 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -134,6 +134,7 @@ class Student_Controller extends REST_Controller { $req['DOJ'] = $data['DOJ']; $req['IsActive'] = $data['IsActive']; $req['BranchID'] = $data['BranchID']; + $req['EnrollmentID'] = $data['EnrollmentID']; $req['UpdatedBy'] = $updatedBy; $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; @@ -262,6 +263,7 @@ class Student_Controller extends REST_Controller { $reqCourse['CourseID'] = $coursedata['course']; $reqCourse['BatchCode'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; + $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = '1'; $reqCourse['CreatedBy'] = $createdBy; @@ -329,22 +331,20 @@ class Student_Controller extends REST_Controller { $reqCourse['CourseID'] = $coursedata['course']; $reqCourse['BatchCode'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; - $reqCourse['BranchID'] = $createdBranch; + $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; + $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $reqCourse['CreatedOn'] = $date; $studentAdd = $this->student_model->add_student( $req , $reqCourse);// Check if the employee exist - if ($studentAdd) - { + if ($studentAdd) { $studentAdd['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentAdd, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code - } - else - { + } else { // Set the response and exit $this->response([ 'message' => 'No users were found', diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index e31e1b6b..5a7f4995 100644 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -422,6 +422,7 @@ 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 { + $scope.disableButton = true; 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); @@ -442,8 +443,10 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $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"); } }); diff --git a/Apollo/assets/views/student/editStudentCourseDetails.html b/Apollo/assets/views/student/editStudentCourseDetails.html index 14fb0db2..e000d672 100644 --- a/Apollo/assets/views/student/editStudentCourseDetails.html +++ b/Apollo/assets/views/student/editStudentCourseDetails.html @@ -21,7 +21,7 @@ Batch - Date of Join + Date of Joining @@ -117,6 +117,16 @@ Date of Joining is required + +
+ + + Enrollment ID required +
+