diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 2e6d85fe..f5064396 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -134,6 +134,7 @@ $route['getListofStuDocDetails'] = 'Student_Controller/getListofStuDocDetails'; $route['deleteStuDocDetails'] = 'Student_Controller/deleteStuDocDetails'; $route['getListofStuPendingDocDetails'] = 'Student_Controller/getListofStuPendingDocDetails'; $route['addStudentEnrollPendingDocDetails'] = 'Student_Controller/addStudentEnrollPendingDocDetails'; +$route['deleteDocPendingDetails'] = 'Student_Controller/deleteDocPendingDetails'; //batch $route['addBatchDetails'] = 'Batch_Controller/addBatchDetails'; diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index 9584ddc0..d13a913b 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -366,6 +366,29 @@ class Student_Controller extends REST_Controller { } } + // delete pending enrollment document details + public function deleteDocPendingDetails_post() { + $expID = $this->post('exceptId'); + $localData = $this->post('localData'); + // echo $expID; + // print_r($localData);exit(); + $stuEnrollPendingDocDeleteDetails = $this->student_model->deleteStu_entrollPending_doc_details($expID); + if ($stuEnrollPendingDocDeleteDetails) + { + $stuEnrollPendingDocDeleteDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($stuEnrollPendingDocDeleteDetails, 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 updateStudentImgDetails_post() { $imagename = $_FILES['idStuUpProof']['name']; @@ -640,7 +663,7 @@ class Student_Controller extends REST_Controller { $reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['CourseID'] = $coursedata['course']; - $reqCourse['BatchCode'] = $coursedata['batch']; + $reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; @@ -712,7 +735,7 @@ class Student_Controller extends REST_Controller { $reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['CourseID'] = $coursedata['course']; - $reqCourse['BatchCode'] = $coursedata['batch']; + $reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index 3b840baf..39acc183 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -1030,6 +1030,20 @@ class Student_model extends CI_Model return $results; } + public function deleteStu_entrollPending_doc_details($id) { + // echo $id;exit(); + $sql = "DELETE FROM ".STUDENTDOCUMENTTRACKDETAILS." WHERE ID = '" . $id . "'"; + if ($this->db->query($sql)) { + $results['deleteStatus'] = true; + $results['message'] = 'Document pending track details deleted.'; + } else { + $results['deleteStatus'] = false; + $results['message'] = 'Something went wrong.please try again'; + } + return $results; + } + + // update student personal details public function update_student($empArr, $updateFor, $imagename, $imageSource, $size) diff --git a/Apollo/assets/js/controllers/daybookCtrl.js b/Apollo/assets/js/controllers/daybookCtrl.js index 192113f9..e3a7a5fc 100755 --- a/Apollo/assets/js/controllers/daybookCtrl.js +++ b/Apollo/assets/js/controllers/daybookCtrl.js @@ -180,7 +180,7 @@ $scope.dayBookApprovalAccess = ''; "description": "", "paidTo": "", "description_paid": "", - "voucherNumber": "" + "voucherNumber": "" } } diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 1b8ec2b4..64a1bdb1 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -709,9 +709,23 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } $scope.getChangeDate = function () { - var formate = "dd-MM-yyyy"; - $scope.myModel.dateofbirth = $filter('date')(new Date($scope.myModel.dateofbirth), formate); - + // 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); + } } // add student @@ -736,10 +750,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } 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]; @@ -1042,7 +1057,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } } - $scope.PendingDocNotFound = false; + // $scope.PendingDocNotFound = false; // student pending document details $scope.getStudentPendingEntrolDocDetails = function(stuId) { // $scope.studentDocumentsList = ''; @@ -1060,10 +1075,10 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }; $http(getStudentPendingDocDetails).then(function (response) { if (response.data.PendingDocListStatus == true) { - $scope.PendingDocNotFound = false; + // $scope.PendingDocNotFound = false; $scope.studentPendingDocumentsDetails = response.data.student_pending_doc_details; } else { - $scope.PendingDocNotFound = true; + // $scope.PendingDocNotFound = true; } }); } @@ -1073,10 +1088,12 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", "documentDetails": "", "checkTracking": false } + + $scope.documentTrackAddDetailsLoading = false; $scope.studentEntrollPendingDocFORM = { submit: function (form, myModelAddPendingDocDetails, stuID) { - + $scope.documentTrackAddDetailsLoading = true; var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -1112,12 +1129,14 @@ 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 } } else { swal(" ", res.data.message, "error"); + $scope.documentTrackAddDetailsLoading = false; } }); } @@ -1130,27 +1149,45 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } } + $scope.deletePendingDocDetails = function(details, StuID, Url) { +// alert(JSON.stringify(details)); - $scope.printPdf = function (file_Uid){ - alert(file_Uid); - $http({ - url : 'http://localhost/apollo_New_Update_20_02_2018/apollodec/Apollo/images/'+ file_Uid, - method : 'GET', - headers : { - 'Content-type' : 'application/pdf' - }, - responseType : 'arraybuffer' - }).success(function(data, status, headers, config) { - var pdfFile = new Blob([ data ], { - type : 'application/pdf' - }); - var pdfUrl = URL.createObjectURL(pdfFile); - var printwWindow = $window.open(pdfUrl); - // printwWindow.print(); - }).error(function(data, status, headers, config) { - alert('Sorry, something went wrong') + SweetAlert.swal({ + title: "Warning!", + text: "Want to Delete this Entry ?", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#007aff", + confirmButtonText: "Yes!" + }, function (res) { + if (res === true) { + $scope.documentTrackAddDetailsLoading = true; + var deleteDocEntry = { + method: 'POST', + url: apiPoint.url + 'deleteDocPendingDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + exceptId: details.ID, + localData: localDetail + } + }; + $http(deleteDocEntry).then(function (response) { + if (response.data.deleteStatus == true) { + // swal("Success!", response.data.message, "success"); + $scope.documentTrackAddDetailsLoading = false; + $scope.studentDocumentsList = ''; + $scope.getStudentPendingEntrolDocDetails(StuID); + } else { + swal(" ", res.data.message, "error"); + $scope.documentTrackAddDetailsLoading = false; + } + }); + } }); - }; + } + // end : entrollment document upload ==================================== diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html index b5c46286..43067976 100755 --- a/Apollo/assets/views/daybook/daybook.html +++ b/Apollo/assets/views/daybook/daybook.html @@ -147,7 +147,9 @@