diff --git a/Apollo/api/application/controllers/Course_Controller.php b/Apollo/api/application/controllers/Course_Controller.php index f5ddac64..5d4ec5a3 100755 --- a/Apollo/api/application/controllers/Course_Controller.php +++ b/Apollo/api/application/controllers/Course_Controller.php @@ -160,6 +160,8 @@ class Course_Controller extends REST_Controller { $jsonRegularFeesData=$this->post('regularFeesAmounts'); $jsonLateralFeesData=$this->post('lateralFeesAmounts'); $jsonSemFeesData=$this->post('semFeesAmounts'); + + $coursedetails = $this->post('sem_number'); // push regular,lateral fees into same array if($jsonRegularFeesData != '' AND $jsonRegularFeesData != null AND $jsonRegularFeesData != 'undefined'){ array_push($jsonSemFeesData,$jsonRegularFeesData); @@ -178,7 +180,7 @@ class Course_Controller extends REST_Controller { $subjectDetails['UpdatedOn'] = $now->format('Y-m-d H:i:s');*/ - $updateDetails = $this->course_model->updateCourse($details,$jsonSemFeesData);// $subjectDetails Check if the users data store contains users (in case the database result returns NULL) + $updateDetails = $this->course_model->updateCourse($details,$jsonSemFeesData,$coursedetails);// $subjectDetails Check if the users data store contains users (in case the database result returns NULL) if ($updateDetails) { $updateDetails['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/Course_model.php b/Apollo/api/application/models/Course_model.php index 84f77f1f..f57fa055 100755 --- a/Apollo/api/application/models/Course_model.php +++ b/Apollo/api/application/models/Course_model.php @@ -77,14 +77,19 @@ class Course_model extends CI_Model { public function getCourse($requestedBy,$branchCode) { - $this->db->select('CU.CourseID,CU.CourseCode,CU.CourseName,CU.FeesType,CU.Specilization1,CU.Specilization2,CU.PC,CU.DC,CU.TC,CU.MC,CU.OtherFees,CU.IsActive,US.UniversityID,US.UniversityName'); + $this->db->select('CU.CourseID,CU.CourseCode,CU.CourseName,CU.FeesType,CU.Specilization1,CU.Specilization2,CU.PC,CU.DC,CU.TC,CU.MC,CU.OtherFees,CU.IsActive,US.UniversityID,US.UniversityName,cfs.semnumber'); $this->db->from(COURSE.' as CU'); $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = CU.UniversityID'); + $this->db->join('T_Course_Fees_Details as cfs','cfs.CourseID=CU.CourseID'); $this->db->where('CU.BranchCode',$branchCode); $this->db->where('US.BranchCode',$branchCode); + $this->db->group_by('CU.CourseID'); $this->db->order_by('CU.CourseID','DESC'); $courseDetails = $this->db->get(); + + // print_r($this->db->last_query()); + if($courseDetails->result()){ $result['courseStatus'] = true; @@ -104,6 +109,7 @@ class Course_model extends CI_Model { $fetchData['IsActive']=$row->IsActive; $fetchData['UniversityID']=$row->UniversityID; $fetchData['UniversityName']=$row->UniversityName; + $fetchData['semnumber'] = $row->semnumber; $fetchData['feesStructures'] = $this->getCourseFeesDetails($row->CourseID); // $fetchData['existSubjects'] = $this->getExistCourseSubjectDetails($row->CourseID); $storeCourseArray[]=$fetchData; @@ -131,8 +137,11 @@ class Course_model extends CI_Model { * update course details * created by kms * */ - public function updateCourse($arrayDetails=null,$jsonData=null) //$subjectDetails=null + public function updateCourse($arrayDetails=null,$jsonData=null,$coursedetails=null) //$subjectDetails=null { + + + //echo $coursedetails;die(); $this->db->select('CourseCode'); $this->db->where('CourseCode', $arrayDetails['CourseCode']); $this->db->where('UniversityID', $arrayDetails['UniversityID']); @@ -158,6 +167,9 @@ class Course_model extends CI_Model { $updateFeesArray['UpdatedOn'] = $arrayDetails['UpdatedOn']; $updateFeesArray['UpdatedBy'] = $arrayDetails['UpdatedBy']; + + $updateFeesArray['semnumber'] =$coursedetails; + $updateFeesArray['ProgramType'] =$row['program']; $updateFeesArray['FeesType'] =$row['FeesType']; if($feesID!='' OR $feesID!=null){ @@ -169,6 +181,8 @@ class Course_model extends CI_Model { } } + + // print_r($this->db->last_query());die(); // update course subject details // $this->updateCourseSubjcetDetails($subjectDetails); @@ -262,7 +276,7 @@ class Course_model extends CI_Model { public function getCourseFeesDetails($courseID=null){ - $this->db->select('ID,CourseID,ProgramType,FeesAmount,Sem_Year,PLD.ListName as programName'); + $this->db->select('ID,CourseID,ProgramType,FeesAmount,Sem_Year,PLD.ListName as programName,semnumber'); $this->db->order_by('ID','ASC'); $this->db->where('CourseID',$courseID); $this->db->from(COURSE_FEES.' as CF'); diff --git a/Apollo/assets/js/controllers/courseCtrl.js b/Apollo/assets/js/controllers/courseCtrl.js index 8a6ee0ee..63b7dd0e 100755 --- a/Apollo/assets/js/controllers/courseCtrl.js +++ b/Apollo/assets/js/controllers/courseCtrl.js @@ -303,6 +303,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab * created by kms * */ $scope.updateCourse = function (myModel, form,regular,lateral,semYear, loading,subjects) { + + var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -373,6 +375,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab specilization1:myModel.Specilization1, specilization2:myModel.Specilization2, existCourseID:myModel.CourseID, + sem_number:myModel.semnumber, // subjects:subjects.list, branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID @@ -429,6 +432,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab $scope.data = response.data.details; + console.log($scope.data); + } else { diff --git a/Apollo/assets/views/editCourseDetails.html b/Apollo/assets/views/editCourseDetails.html index 61ac2103..ea465f3b 100755 --- a/Apollo/assets/views/editCourseDetails.html +++ b/Apollo/assets/views/editCourseDetails.html @@ -190,6 +190,29 @@ ng-if="Form.lateralFees.$error.maxlength || Form.lateralFees.$error.pattern">Enter a valid amount + + + + + + + +