diff --git a/Apollo/api/application/controllers/Course_Controller.php b/Apollo/api/application/controllers/Course_Controller.php index 8bf24541..99170bb3 100755 --- a/Apollo/api/application/controllers/Course_Controller.php +++ b/Apollo/api/application/controllers/Course_Controller.php @@ -49,8 +49,12 @@ class Course_Controller extends REST_Controller { $jsonLateralFeesData=$this->post('lateralFeesAmounts'); $jsonSemFeesData=$this->post('semFeesAmounts'); // push regular,lateral fees into same array - array_push($jsonSemFeesData,$jsonRegularFeesData); - array_push($jsonSemFeesData,$jsonLateralFeesData); + if($jsonRegularFeesData['FeesAmount'] != 0 AND $jsonRegularFeesData['FeesAmount'] != '' AND $jsonRegularFeesData['FeesAmount'] != 'undefined'){ + array_push($jsonSemFeesData,$jsonRegularFeesData); + } + if($jsonLateralFeesData['FeesAmount'] != 0 AND $jsonLateralFeesData['FeesAmount'] != '' AND $jsonLateralFeesData['FeesAmount'] != 'undefined'){ + 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) { @@ -117,8 +121,14 @@ class Course_Controller extends REST_Controller { $jsonLateralFeesData=$this->post('lateralFeesAmounts'); $jsonSemFeesData=$this->post('semFeesAmounts'); // push regular,lateral fees into same array - array_push($jsonSemFeesData,$jsonRegularFeesData); - array_push($jsonSemFeesData,$jsonLateralFeesData); + if($jsonRegularFeesData != '' AND $jsonRegularFeesData != null AND $jsonRegularFeesData != 'undefined'){ + array_push($jsonSemFeesData,$jsonRegularFeesData); + + } + if($jsonLateralFeesData != '' AND $jsonLateralFeesData != null AND $jsonLateralFeesData != 'undefined'){ + 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) diff --git a/Apollo/assets/js/controllers/courseCtrl.js b/Apollo/assets/js/controllers/courseCtrl.js index 79baf2e3..9cc99d85 100755 --- a/Apollo/assets/js/controllers/courseCtrl.js +++ b/Apollo/assets/js/controllers/courseCtrl.js @@ -31,6 +31,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab $rootScope.updateMoreItems = []; $scope.editId = -1; $rootScope.setEditId = function (pid,p) { + $rootScope.myModelRegular1=""; + $rootScope.myModelLateral1=""; $rootScope.updateMoreItems=[]; // find index for fees type drop down list @@ -272,6 +274,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab $scope.emptyData=''; $rootScope.init = function () { + $scope.loader=''; var getCourse = { method: 'POST', @@ -305,6 +308,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab "FeesAmount":"", }; + // single sitting lateral course details in model $scope.myModelLateral = { @@ -315,6 +319,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab "FeesAmount":"", }; + // single sitting Sem_Year course details in model $scope.myModelSemYear = { diff --git a/Apollo/assets/views/courseDetails.html b/Apollo/assets/views/courseDetails.html index bff82cb8..85af9f54 100755 --- a/Apollo/assets/views/courseDetails.html +++ b/Apollo/assets/views/courseDetails.html @@ -158,7 +158,7 @@ + ng-model="myModel.courseCode" ng-pattern="/^[a-zA-Z0-9-\s]*$/" required/> Course id is required + ng-model="p.CourseID" ng-pattern="/^[a-zA-Z0-9-\s]*$/" readonly required/> Course id is required - {{myModelRegular1.FeesName}} + Single - + {{myModelRegular1.programName}} Fees @@ -115,7 +115,7 @@ ng-if="Form.regularFees.$error.maxlength || Form.regularFees.$error.pattern">Enter a valid amount - + {{myModelLateral1.programName}} Fees