course details changes done

This commit is contained in:
gandhimathi 2017-12-23 18:44:31 +05:30
parent 80411772fa
commit 99e4edee5e

View File

@ -37,6 +37,10 @@ class Fees_Status_Controller extends REST_Controller {
$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
$this->methods['getUniversityCourseForFees_post']['limit'] = 1000; // 1000 requests per hour per user/key
$this->methods['getFeesStructureAssign_post']['limit'] = 1000; // 1000 requests per hour per user/key
$this->methods['setFeesForStudent_post']['limit'] = 1000; // 1000 requests per hour per user/key
// load the model
$this->load->model('Fees_status_model', 'Fees_model');
@ -136,7 +140,7 @@ class Fees_Status_Controller extends REST_Controller {
/*track array end*/
$detailsChild['StudentID'] = $this->post('studID');
$detailsChild['SessionID'] = $this->post('session');
$detailsChild['FeesId'] = $this->post('feesID');
$detailsChild['BillNO'] = $this->post('billNO');
$detailsChild['BillDate'] = $this->post('billDate');
$detailsChild['BillAmount'] = $this->post('billAmount');
@ -190,6 +194,77 @@ class Fees_Status_Controller extends REST_Controller {
}
/*
* get student set fees details
* created by kms
* */
/*
* get student fees structure
* created by kms
* */
public function getFeesStructureAssign_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->getFeesStructureAssign($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
}
}
/*
* set fees for student
* created by kms
* */
public function setFeesForStudent_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['SessionName'] = $this->post('session');
$details['RollNo'] = $this->post('rollNo');
$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');
$updateDetails = $this->Fees_model->setFees($details);// 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
}
}