diff --git a/Apollo/api/application/controllers/Course_Controller.php b/Apollo/api/application/controllers/Course_Controller.php index 12984233..8bf24541 100644 --- a/Apollo/api/application/controllers/Course_Controller.php +++ b/Apollo/api/application/controllers/Course_Controller.php @@ -36,7 +36,7 @@ class Course_Controller extends REST_Controller { $details['CourseID'] = $this->post('courseID'); $details['CourseName'] = $this->post('courseName'); $details['UniversityID'] = $this->post('universityName'); - $details['FeesType'] = $this->post('feesType'); + //$details['FeesType'] = $this->post('feesType'); $details['PC'] = $this->post('provFess'); $details['DC'] = $this->post('degreeAmount'); $details['TC'] = $this->post('transferAmount'); @@ -45,8 +45,13 @@ class Course_Controller extends REST_Controller { $details['CreatedBy'] = $this->post('createdBy'); $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); $details['IsActive'] = $this->post('status'); - $jsonFeesData=$this->post('feesAmounts'); - $courseDetails = $this->course_model->addCourse($details,$jsonFeesData);// Check if the users data store contains users (in case the database result returns NULL) + $jsonRegularFeesData=$this->post('regularFeesAmounts'); + $jsonLateralFeesData=$this->post('lateralFeesAmounts'); + $jsonSemFeesData=$this->post('semFeesAmounts'); + // push regular,lateral fees into same array + array_push($jsonSemFeesData,$jsonRegularFeesData); + array_push($jsonSemFeesData,$jsonLateralFeesData); + $courseDetails = $this->course_model->addCourse($details,$jsonSemFeesData);// Check if the users data store contains users (in case the database result returns NULL) if ($courseDetails) { $courseDetails['status'] = REST_Controller::HTTP_OK; @@ -108,8 +113,14 @@ class Course_Controller extends REST_Controller { $details['OtherFees'] = $this->post('otherAmount'); $details['UpdatedBy'] = $this->post('updatedBy'); $details['UpdatedOn'] = $now->format('Y-m-d H:i:s'); - $jsonFeesData=$this->post('feesAmounts'); - $updateDetails = $this->course_model->updateCourse($details,$jsonFeesData);// Check if the users data store contains users (in case the database result returns NULL) + $jsonRegularFeesData=$this->post('regularFeesAmounts'); + $jsonLateralFeesData=$this->post('lateralFeesAmounts'); + $jsonSemFeesData=$this->post('semFeesAmounts'); + // push regular,lateral fees into same array + array_push($jsonSemFeesData,$jsonRegularFeesData); + array_push($jsonSemFeesData,$jsonLateralFeesData); + + $updateDetails = $this->course_model->updateCourse($details,$jsonSemFeesData);// Check if the users data store contains users (in case the database result returns NULL) if ($updateDetails) { $updateDetails['status'] = REST_Controller::HTTP_OK;