From b715749d8178a62fb73ffe1c4c8d4214ff1026ce Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Thu, 6 Sep 2018 17:49:48 +0530 Subject: [PATCH] formid details, fees details update record : kdk --- Apollo/api/application/config/routes.php | 3 +- ...Receive_Enrolment_Fees_Univ_Controller.php | 19 ++ .../Receive_Enrolment_Fees_Univ_model.php | 99 ++++++++-- .../studentUnivFormIdFeeDetailsCtrl.js | 48 ++++- Apollo/assets/views/partials/nav.html | 4 +- .../student/studentUnivFormIdFeeDetails.html | 187 +++++++++++++++++- 6 files changed, 328 insertions(+), 32 deletions(-) diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index ce09afb1..d00e7b67 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -366,4 +366,5 @@ $route['getExistStudentEnrolmentDetails'] = 'Receive_Enrolment_Fees_Univ_Control $route['addManualEnrolmentDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/addManualEnrolmentDetails'; $route['getForFormIdDraftDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getForFormIdDraftDetails'; $route['addForFormIdDraftDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/addForFormIdDraftDetails'; -$route['draftMovetoList'] = 'Receive_Enrolment_Fees_Univ_Controller/draftMovetoList'; \ No newline at end of file +$route['draftMovetoList'] = 'Receive_Enrolment_Fees_Univ_Controller/draftMovetoList'; +$route['editDraftFormIdFeesDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/editDraftFormIdFeesDetails'; \ No newline at end of file diff --git a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php index 1c22c772..1b50ad60 100644 --- a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php +++ b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php @@ -321,5 +321,24 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { } } + public function editDraftFormIdFeesDetails_post(){ + $reqBranch = $this->post('localDetails'); + $details = $this->post('details'); + $detailsID = $this->post('detailsID'); + + $details = $this->post('details'); + $editDraftFormIdFeesDetails = $this->receive_model->editDraftFormIdFeesDetails($reqBranch, $details, $detailsID); // Check if the employee exist + if ($editDraftFormIdFeesDetails) { + $editDraftFormIdFeesDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($editDraftFormIdFeesDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } else { + // Set the response and exit + $this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + } + } \ No newline at end of file diff --git a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php index 9d7fea9a..09189869 100644 --- a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php +++ b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php @@ -442,9 +442,9 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { if(count($queryDetails->result()) == 0){ $query = "INSERT INTO T_FormId_FeeDetails_Received_From_University - (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus) + (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus, EditStatus) VALUES - ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 0)"; + ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 0, 0)"; $queryDetails = $this->db->query($query); } else { echo 'else con'; @@ -876,9 +876,9 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { if(count($queryDetails->result()) == 0){ $query = "INSERT INTO T_FormId_FeeDetails_Received_From_University - (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus) + (FormID, FormType, CentreCode,Session,Year,Semester,Student_Name,Father_Name,CourseCode, ActualCourseFee, CourseFee, ExamFee, EnrollmentFee, ProspectusFee, ReRegFee, CreditTransferFee, LateralEntryFee, DualSpclFee, OtherFee, NRIFEE, ProvisionalFee, MigrationFee, UrgentResultDMCFee, AdditionalFee, Amount, CreatedBy, CreatedOn, BranchCode, DraftStatus, EditStatus) VALUES - ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 1)"; + ( '$formIds', '$formType', '$CentreCode','$Session','$Year','$Semester','$Student_Name','$Father_Name', '$CourseCode', '$ActualCourseFee', '$CourseFee', '$ExamFee', '$EnrollmentFee', '$ProspectusFee', '$ReRegFee', '$CreditTransferFee', '$LateralEntryFee', '$DualSpclFee', '$OtherFee', '$NRIFEE', '$ProvisionalFee', '$MigrationFee', '$UrgentResultDMCFee', '$AdditionalFee', '$Amount', '$localUserID', '$CreatedOn', '$localBranchID' , 1, 1)"; $queryDetails = $this->db->query($query); if($queryDetails){ @@ -899,11 +899,9 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { // print_r($details);exit(); foreach($detail as $row) { - // echo $row['ID'];exit(); - $data[] = array( - 'ID' => $row['ID'], - 'FormType'=> 'Hello' - ); + $ids = $row['ID']; + $updateQuery = 'UPDATE `T_FormId_FeeDetails_Received_From_University` SET `DraftStatus` = 0 WHERE `ID` = '.$ids; + $queryDetails = $this->db->query($updateQuery); } // $data = array( @@ -917,16 +915,81 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { // ) // ); // print_r($data);exit(); - $this->db->update_batch('T_FormId_FeeDetails_Received_From_University', $data, 'ID'); + // $this->db->update('T_FormId_FeeDetails_Received_From_University', $data, 'ID'); - $detailsList = $details->result(); - if($detailsList){ - $result['draftStatus'] = true; - $result['draftDetailsMessagae'] = "Updated Successfully."; - } else { - $result['draftStatus'] = false; - $result['draftDetailsMessagae'] = "Something went wrong."; - } + // $detailsList = $details->result(); + $result['draftStatus'] = true; + $result['draftDetailsMessagae'] = "Updated Successfully."; + return $result; + } + + public function editDraftFormIdFeesDetails($reqBranch, $details, $detailsID){ + $ids = $detailsID; + $formIds = $details['FormID']; + $formType = $details['FormType']; + $CentreCode = $details['CentreCode']; + $Session = $details['Session']; + $Year = $details['Year']; + $Semester = $details['Semester']; + $Student_Name = $details['Student_Name']; + $Father_Name = $details['Father_Name']; + $CourseCode = $details['CourseCode']; + $ActualCourseFee = $details['ActualCourseFee']; + $CourseFee = $details['CourseFee']; + $ExamFee = $details['ExamFee']; + $EnrollmentFee = $details['EnrollmentFee']; + $ProspectusFee = $details['ProspectusFee']; + $ReRegFee = $details['ReRegFee']; + $CreditTransferFee = $details['CreditTransferFee']; + $LateralEntryFee = $details['LateralEntryFee']; + $DualSpclFee = $details['DualSpclFee']; + $OtherFee = $details['OtherFee']; + $NRIFEE = $details['NRIFEE']; + $ProvisionalFee = $details['ProvisionalFee']; + $MigrationFee = $details['MigrationFee']; + $UrgentResultDMCFee = $details['UrgentResultDMCFee']; + $AdditionalFee = $details['AdditionalFee']; + $Amount = $details['Amount']; + + $data = array( + 'FormID' => $formIds , + 'FormType' => $formType , + 'CentreCode'=> $CentreCode, + 'Session' =>$Session, + 'Year' =>$Year, + 'Semester' =>$Semester, + 'Student_Name' =>$Student_Name , + 'Father_Name' =>$Father_Name, + 'CourseCode' =>$CourseCode, + 'ActualCourseFee' =>$ActualCourseFee, + 'CourseFee' =>$CourseFee, + 'ExamFee' =>$ExamFee, + 'EnrollmentFee' =>$EnrollmentFee, + 'ProspectusFee' =>$ProspectusFee, + 'ReRegFee'=>$ReRegFee, + 'CreditTransferFee' =>$CreditTransferFee, + 'LateralEntryFee' =>$LateralEntryFee, + 'DualSpclFee' =>$DualSpclFee, + 'OtherFee' =>$OtherFee, + 'NRIFEE' =>$NRIFEE , + 'ProvisionalFee' =>$ProvisionalFee, + 'MigrationFee' =>$MigrationFee, + 'UrgentResultDMCFee' =>$UrgentResultDMCFee, + 'AdditionalFee' =>$AdditionalFee, + 'Amount' => $Amount + ); + + $this->db->where('ID', $detailsID); + $this->db->update('T_FormId_FeeDetails_Received_From_University', $data); + // echo $this->db->affected_rows();exit(); + if($this->db->affected_rows() > 0){ +$result['updatedraftStatus'] = true; + $result['updatedraftDetailsMessagae'] = "Updated Successfully."; + }else{ +$result['updatedraftStatus'] = false; + $result['updatedraftDetailsMessagae'] = "Something went wrong."; + } + return $result; } } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js b/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js index dd1faef7..6bfdd424 100644 --- a/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js +++ b/Apollo/assets/js/controllers/studentUnivFormIdFeeDetailsCtrl.js @@ -482,19 +482,51 @@ $scope.draftManualEntryDetails = { }; $http(draftMoveToList).then(function (response) { if (response.data.draftStatus == true) { - // swal("", response.data.draftDetailsMessagae, "success"); - // getDraftFormIdDetails(); - // getEmptycall(); + // alert(); + swal("", response.data.draftDetailsMessagae, "success"); + getDraftFormIdDetails(); } else { - // swal("", response.data.draftDetailsMessagae, "warning"); - // getDraftFormIdDetails(); - // getEmptycall(); - } - }); + swal("", response.data.draftDetailsMessagae, "warning"); + + }}); } else { swal("Cancelled", "Your record not added to list :)", "error"); } }); } + $scope.editId = -1; + $scope.leader = {}; + $scope.editList = function(details, d){ + $scope.leader = {}; + angular.copy(d, $scope.leader); + $scope.editId = details; + } + + $scope.updateFeeIDDetails = function(id, p){ + var editDraftMoveToList = { + method: 'POST', + url: apiPoint.url + 'editDraftFormIdFeesDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localDetails: localDetail, + details : p, + detailsID: id + } + }; + $http(editDraftMoveToList).then(function (response) { + if (response.data.updatedraftStatus == true) { + // alert(); + swal("", response.data.updatedraftDetailsMessagae, "success"); + getDraftFormIdDetails(); + $scope.editId = -1; + $scope.leader = {}; + } else { + swal("", response.data.updatedraftDetailsMessagae, "warning"); + + }}); + } + }]); diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index 24e120eb..c5988d12 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -221,11 +221,11 @@ STUDENT UNIV FEE COMPARE DETAILS - +