From b0bfc317ab854d13b48841d834b9390effed3e07 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 28 Nov 2017 19:58:17 +0530 Subject: [PATCH] changes in course --- .../controllers/Course_Controller.php | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Apollo/api/application/controllers/Course_Controller.php b/Apollo/api/application/controllers/Course_Controller.php index 070dcb6b..12984233 100644 --- a/Apollo/api/application/controllers/Course_Controller.php +++ b/Apollo/api/application/controllers/Course_Controller.php @@ -31,13 +31,22 @@ class Course_Controller extends REST_Controller { public function addCourseDetails_post() { - + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); $details['CourseID'] = $this->post('courseID'); $details['CourseName'] = $this->post('courseName'); $details['UniversityID'] = $this->post('universityName'); + $details['FeesType'] = $this->post('feesType'); + $details['PC'] = $this->post('provFess'); + $details['DC'] = $this->post('degreeAmount'); + $details['TC'] = $this->post('transferAmount'); + $details['MC'] = $this->post('migrationAmount'); + $details['OtherFees'] = $this->post('otherAmount'); $details['CreatedBy'] = $this->post('createdBy'); + $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); $details['IsActive'] = $this->post('status'); - $courseDetails = $this->course_model->addCourse($details);// Check if the users data store contains users (in case the database result returns NULL) + $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) if ($courseDetails) { $courseDetails['status'] = REST_Controller::HTTP_OK; @@ -87,12 +96,20 @@ class Course_Controller extends REST_Controller { * */ public function updateCourseDetails_post() { + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); $details['CourseID'] = $this->post('courseCode'); $details['CourseName'] = $this->post('courseName'); $details['IsActive'] = $this->post('status'); + $details['PC'] = $this->post('provFess'); + $details['DC'] = $this->post('degreeAmount'); + $details['TC'] = $this->post('transferAmount'); + $details['MC'] = $this->post('migrationAmount'); + $details['OtherFees'] = $this->post('otherAmount'); $details['UpdatedBy'] = $this->post('updatedBy'); - $details['UpdatedOn'] = date("Y-m-d", time()); - $updateDetails = $this->course_model->updateCourse($details);// Check if the users data store contains users (in case the database result returns NULL) + $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) if ($updateDetails) { $updateDetails['status'] = REST_Controller::HTTP_OK;