This commit is contained in:
resicovenba 2018-01-10 09:53:33 +05:30
commit 9cb5bfff45
4 changed files with 24 additions and 9 deletions

View File

@ -49,8 +49,12 @@ class Course_Controller extends REST_Controller {
$jsonLateralFeesData=$this->post('lateralFeesAmounts'); $jsonLateralFeesData=$this->post('lateralFeesAmounts');
$jsonSemFeesData=$this->post('semFeesAmounts'); $jsonSemFeesData=$this->post('semFeesAmounts');
// push regular,lateral fees into same array // push regular,lateral fees into same array
if($jsonRegularFeesData['FeesAmount'] != 0 AND $jsonRegularFeesData['FeesAmount'] != '' AND $jsonRegularFeesData['FeesAmount'] != 'undefined'){
array_push($jsonSemFeesData,$jsonRegularFeesData); array_push($jsonSemFeesData,$jsonRegularFeesData);
}
if($jsonLateralFeesData['FeesAmount'] != 0 AND $jsonLateralFeesData['FeesAmount'] != '' AND $jsonLateralFeesData['FeesAmount'] != 'undefined'){
array_push($jsonSemFeesData,$jsonLateralFeesData); 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) $courseDetails = $this->course_model->addCourse($details,$jsonSemFeesData);// Check if the users data store contains users (in case the database result returns NULL)
if ($courseDetails) if ($courseDetails)
{ {
@ -117,9 +121,15 @@ class Course_Controller extends REST_Controller {
$jsonLateralFeesData=$this->post('lateralFeesAmounts'); $jsonLateralFeesData=$this->post('lateralFeesAmounts');
$jsonSemFeesData=$this->post('semFeesAmounts'); $jsonSemFeesData=$this->post('semFeesAmounts');
// push regular,lateral fees into same array // push regular,lateral fees into same array
if($jsonRegularFeesData != '' AND $jsonRegularFeesData != null AND $jsonRegularFeesData != 'undefined'){
array_push($jsonSemFeesData,$jsonRegularFeesData); array_push($jsonSemFeesData,$jsonRegularFeesData);
}
if($jsonLateralFeesData != '' AND $jsonLateralFeesData != null AND $jsonLateralFeesData != 'undefined'){
array_push($jsonSemFeesData,$jsonLateralFeesData); 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) $updateDetails = $this->course_model->updateCourse($details,$jsonSemFeesData);// Check if the users data store contains users (in case the database result returns NULL)
if ($updateDetails) if ($updateDetails)
{ {

View File

@ -31,6 +31,8 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
$rootScope.updateMoreItems = []; $rootScope.updateMoreItems = [];
$scope.editId = -1; $scope.editId = -1;
$rootScope.setEditId = function (pid,p) { $rootScope.setEditId = function (pid,p) {
$rootScope.myModelRegular1="";
$rootScope.myModelLateral1="";
$rootScope.updateMoreItems=[]; $rootScope.updateMoreItems=[];
// find index for fees type drop down list // find index for fees type drop down list
@ -272,6 +274,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
$scope.emptyData=''; $scope.emptyData='';
$rootScope.init = function () { $rootScope.init = function () {
$scope.loader=''; $scope.loader='';
var getCourse = { var getCourse = {
method: 'POST', method: 'POST',
@ -305,6 +308,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
"FeesAmount":"", "FeesAmount":"",
}; };
// single sitting lateral course details in model // single sitting lateral course details in model
$scope.myModelLateral = { $scope.myModelLateral = {
@ -315,6 +319,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
"FeesAmount":"", "FeesAmount":"",
}; };
// single sitting Sem_Year course details in model // single sitting Sem_Year course details in model
$scope.myModelSemYear = { $scope.myModelSemYear = {

View File

@ -158,7 +158,7 @@
<input type="text" placeholder="Enter Course ID" <input type="text" placeholder="Enter Course ID"
tabindex="2" class="form-control" name="coursecode" ng-maxlength="20" tabindex="2" class="form-control" name="coursecode" ng-maxlength="20"
ng-model="myModel.courseCode" ng-pattern="/^[a-zA-Z0-9\s]*$/" required/> ng-model="myModel.courseCode" ng-pattern="/^[a-zA-Z0-9-\s]*$/" required/>
<span class="error text-small block" <span class="error text-small block"
ng-if="Form.coursecode.$dirty && Form.coursecode.$error.required">Course id is required</span> ng-if="Form.coursecode.$dirty && Form.coursecode.$error.required">Course id is required</span>
<span class="error text-small block" <span class="error text-small block"

View File

@ -17,7 +17,7 @@
<input type="text" placeholder="Enter Course ID" <input type="text" placeholder="Enter Course ID"
tabindex="1" class="form-control" name="coursecode" tabindex="1" class="form-control" name="coursecode"
ng-model="p.CourseID" ng-pattern="/^[a-zA-Z0-9\s]*$/" readonly required/> ng-model="p.CourseID" ng-pattern="/^[a-zA-Z0-9-\s]*$/" readonly required/>
<span class="error text-small block" <span class="error text-small block"
ng-if="Form.coursecode.$dirty && Form.coursecode.$error.required">Course id is required</span> ng-if="Form.coursecode.$dirty && Form.coursecode.$error.required">Course id is required</span>
<span class="error text-small block" <span class="error text-small block"
@ -99,10 +99,10 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<fieldset> <legend> {{myModelRegular1.FeesName}} </legend> <fieldset> <legend> Single </legend>
<div class="row"> <div class="row">
<div class="col-md-6 form-group" ng-class="{'has-error':Form.regularFees.$dirty && Form.regularFees.$invalid}"> <div class="col-md-6 form-group" ng-class="{'has-error':Form.regularFees.$dirty && Form.regularFees.$invalid}" ng-if="myModelRegular1.program=='P001'">
<label> <label>
{{myModelRegular1.programName}} Fees {{myModelRegular1.programName}} Fees
</label> </label>
@ -115,7 +115,7 @@
ng-if="Form.regularFees.$error.maxlength || Form.regularFees.$error.pattern">Enter a valid amount</span> ng-if="Form.regularFees.$error.maxlength || Form.regularFees.$error.pattern">Enter a valid amount</span>
</div> </div>
<div class="col-md-6 form-group" ng-class="{'has-error':Form.lateralFees.$dirty && Form.lateralFees.$invalid}"> <div class="col-md-6 form-group" ng-class="{'has-error':Form.lateralFees.$dirty && Form.lateralFees.$invalid}" ng-if="myModelLateral1.program=='P002'">
<label> <label>
{{myModelLateral1.programName}} Fees {{myModelLateral1.programName}} Fees
</label> </label>