number of sem addition for regular,lateral

This commit is contained in:
venbatechnologies@gmail.com 2018-11-05 11:28:53 +05:30
parent 2a0a85e797
commit 2457da513e
4 changed files with 48 additions and 4 deletions

View File

@ -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;

View File

@ -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');

View File

@ -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 {

View File

@ -190,6 +190,29 @@
ng-if="Form.lateralFees.$error.maxlength || Form.lateralFees.$error.pattern">Enter a valid amount</span>
</div>
<div class="col-md-6 form-group" ng-class="{'has-error':Form.numberofsem.$dirty && Form.numberofsem.$invalid}">
<label>Number of Semesters</label>
<input type="text" placeholder="Enter Number of Semesters"
autofocus tabindex="8" class="form-control" name="numberofsem" id="numberofsem" ng-maxlength="8"
ng-model="p.semnumber" ng-pattern="/^[0-9]*$/"
ng-disabled="myModelSemYear.programName!='' || myModelSemYear.FeesAmount!='' || addMoreItems.length!=0" />
<span class="error text-small block"
ng-if="Form.numberofsem.$dirty && Form.numberofsem.$error.maxlength || Form.numberofsem.$error.pattern">Enter a valid number</span>
</div>
</div>