From 2182e5cedf4efba829ecc3afa9476b4c19154462 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 18 Dec 2017 11:35:46 +0530 Subject: [PATCH] course details changes done --- .../controllers/Fees_Status_Controller.php | 85 +++++++++++++++++-- 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/Apollo/api/application/controllers/Fees_Status_Controller.php b/Apollo/api/application/controllers/Fees_Status_Controller.php index 949e6bfb..7d8a998b 100755 --- a/Apollo/api/application/controllers/Fees_Status_Controller.php +++ b/Apollo/api/application/controllers/Fees_Status_Controller.php @@ -32,8 +32,10 @@ class Fees_Status_Controller extends REST_Controller { // Configure limits on our controller methods // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php $this->methods['getStudentList_get']['limit'] = 500; // 500 requests per hour per user/key - $this->methods['getStudentList_post']['limit'] = 1000; // 100 requests per hour per user/key + $this->methods['getStudentList_post']['limit'] = 1000; // 1000 requests per hour per user/key $this->methods['getStudentList_delete']['limit'] = 50; // 50 requests per hour per user/key + $this->methods['getFeesStructure_post']['limit'] = 1000; // 1000 requests per hour per user/key + $this->methods['updateFeesDetails_post']['limit'] = 1000; // 1000 requests per hour per user/key // load the model $this->load->model('Fees_status_model', 'Fees_model'); @@ -47,14 +49,13 @@ class Fees_Status_Controller extends REST_Controller { * */ public function getStudentList_post() { - $search['requestedBy'] = $this->post('createdBy'); - $search['StudentName'] = $this->post('studentName'); + $search['requestedBy'] = $this->post('requestedtBy'); + $search['Firstname'] = $this->post('studentName'); $search['MobileNumber'] = $this->post('mobileNumber'); $getStudentDetails = $this->Fees_model->getStudentList($search); - if ($getStudentDetails) { - $getTrackedDetails['status'] = REST_Controller::HTTP_OK; + $getStudentDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getStudentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } @@ -70,8 +71,82 @@ class Fees_Status_Controller extends REST_Controller { } + /* + * get student fees structure + * created by kms + * */ + public function getFeesStructure_post() + { + $student['ID'] = $this->post('ID'); + $student['requestedBy'] = $this->post('requestedtBy'); + $student['CourseID'] = $this->post('courseID'); + $student['StudentID'] = $this->post('studentID'); + $getStudentFeesDetails = $this->Fees_model->getStudentFeesStructure($student); + if ($getStudentFeesDetails) + { + $getStudentFeesDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getStudentFeesDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } + /* + * update fees details for student + * created by kms + * */ + + + public function updateFeesDetails_post() + { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $details['StudentID'] = $this->post('studID'); + $details['CourseID'] = $this->post('courseID'); + $details['FeesType'] = $this->post('feesID'); + $details['CourseFees'] = $this->post('courseAmount'); + $details['STFOrWR'] = $this->post('STFWR'); + $details['Waiver'] = $this->post('waiver'); + $details['Others'] = $this->post('other'); + $details['CreatedBy'] = $this->post('createdBy'); + $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); + $detailsChild['StudentID'] = $this->post('studID'); + $detailsChild['SessionID'] = $this->post('session'); + $detailsChild['BillNO'] = $this->post('billNO'); + $detailsChild['BillDate'] = $this->post('billDate'); + $detailsChild['BillAmount'] = $this->post('billAmount'); + $detailsChild['ModeOfPayment'] = $this->post('modeOfPayment'); + $detailsChild['CommentsForStudent'] = $this->post('commentsForStudent'); + $detailsChild['InternalComments'] = $this->post('internalComments'); + $detailsChild['CreatedBy'] = $this->post('createdBy'); + $detailsChild['CreatedOn'] = $now->format('Y-m-d H:i:s'); + $updateDetails = $this->Fees_model->updateFees($details,$detailsChild);// Check if the users data store contains users (in case the database result returns NULL) + if ($updateDetails) + { + $updateDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($updateDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'Something went wrong.please try again!', + '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