course master , separate function api call , student add/edit super admin changes : kdk

This commit is contained in:
resicovenba 2018-01-16 13:14:50 +05:30
parent 36b2144fe7
commit 857771388b
6 changed files with 124 additions and 18 deletions

View File

@ -101,6 +101,7 @@ $route['updateUniversityDetail'] = 'University_Controller/updateUniversityDetail
$route['getCourseDetails'] = 'Course_Controller/getCourseDetails';
$route['addCourseDetails'] = 'Course_Controller/addCourseDetails';
$route['updateCourseDetails'] = 'Course_Controller/updateCourseDetails';
$route['getCourseUnivFeesDetails'] = 'Course_Controller/getCourseUnivFeesDetails';
// activity
$route['addActivityDetails'] = 'University_Controller/addActivityDetails';

View File

@ -16,8 +16,8 @@ class Course_Controller extends REST_Controller {
// Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php
$this->methods['addCourseDetails_get']['limit'] = 500; // 500 requests per hour per user/key
$this->methods['addCourseDetails_post']['limit'] = 100; // 100 requests per hour per user/key
$this->methods['addCourseDetails_delete']['limit'] = 50; // 50 requests per hour per user/key
$this->methods['getCourseDetails_post']['limit'] = 500; // 50 requests per hour per user/key
$this->methods['addCourseDetails_delete']['limit'] = 500; // 50 requests per hour per user/key
$this->methods['getCourseDetails_post']['limit'] = 1500; // 50 requests per hour per user/key
$this->methods['updateCourseDetails_post']['limit'] = 500;
// load the model
$this->load->model('Course_model', 'course_model');
@ -98,6 +98,27 @@ class Course_Controller extends REST_Controller {
}
}
public function getCourseUnivFeesDetails_post() {
$requestedBy = $this->post('requestedBy');
$getCourseUnivFee = $this->course_model->getCourseUnivFeesTypes($requestedBy);
if ($getCourseUnivFee)
{
$getCourseUnivFee['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getCourseUnivFee, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
/*
* update the course details

View File

@ -92,22 +92,29 @@ class Course_model extends CI_Model {
$fetchData['UniversityID']=$row->UniversityID;
$fetchData['UniversityName']=$row->UniversityName;
$fetchData['feesStructures'] = $this->getCourseFeesDetails($row->CourseID);
// print_r($fetchData);exit();
$storeCourseArray[]=$fetchData;
}
$result['details'] = $storeCourseArray;
// print_r($storeCourseArray);exit();
}
else {
$result['courseStatus'] = false;
$result['message'] = "No records found!";
}
$result['universityDetails'] = $this->getUniversityDetails();
$result['feesDetails'] = $this->getFeesDetails();
}
// print_r($result);exit();
return $result;
}
public function getCourseUnivFeesTypes() {
$result['universityDetails'] = $this->getUniversityDetails();
$result['feesDetails'] = $this->getFeesDetails();
$result['courseStatus'] = true;
return $result;
}
/*
* update course details
* created by kms
@ -173,11 +180,13 @@ class Course_model extends CI_Model {
* */
public function getFeesDetails()
{
$this->db->select('ListCode,ListName');
$this->db->order_by('ListCode','ASC');
$this->db->where('IsActive','1');
$this->db->where('ListGroup','3');
$feesDetails = $this->db->get(PICK_LIST_DETAILS);
if($feesDetails){
$result_fees = array();
foreach ($feesDetails->result() as $row)

View File

@ -274,7 +274,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
$scope.emptyData='';
$rootScope.init = function () {
getUniversity_FeesDetails();
$scope.loader='';
var getCourse = {
method: 'POST',
@ -292,6 +292,83 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
$scope.loader=true;
$scope.data = response.data.details;
// $scope.university=response.data.universityDetails;
// $scope.feesDetails=response.data.feesDetails;
// $scope.myModel.ListName=$scope.feesDetails[0];
// $scope.myModel.programListName=$scope.myModel.ListName.programType[0].ListCode;
// // single sitting regular course details in model
// $scope.myModelRegular = {
// "FeesType":$scope.feesDetails[0].ListCode,
// "FeesName":$scope.feesDetails[0].ListName,
// "program":$scope.feesDetails[0].programType[0].ListCode,
// "programName":$scope.feesDetails[0].programType[0].ListName,
// "FeesAmount":"",
// };
// // single sitting lateral course details in model
// $scope.myModelLateral = {
// "FeesType":$scope.feesDetails[0].ListCode,
// "FeesName":$scope.feesDetails[0].ListName,
// "program":$scope.feesDetails[0].programType[1].ListCode,
// "programName":$scope.feesDetails[0].programType[1].ListName,
// "FeesAmount":"",
// };
// // single sitting Sem_Year course details in model
// $scope.myModelSemYear = {
// "FeesType":$scope.feesDetails[1].ListCode,
// "FeesName":$scope.feesDetails[1].ListName,
// "program":$scope.feesDetails[1].programType[0].ListCode,
// "programName":"",
// "FeesAmount":"",
// };
// $rootScope.myModelSemYear1 = {
// "FeesType":$scope.feesDetails[1].ListCode,
// "FeesName":$scope.feesDetails[1].ListName,
// "program":$scope.feesDetails[1].programType[0].ListCode,
// "programName":"",
// "FeesAmount":"",
// };
} else {
$scope.emptyData=false;
$scope.loader=true;
// getUniversity_FeesDetails();
// $scope.university=response.data.universityDetails;
// $scope.feesDetails=response.data.feesDetails;
// $scope.myModel.ListName=$scope.feesDetails[0];
// $scope.myModel.programListName=$scope.myModel.ListName.programType[0].ListCode;
}
});
};
function getUniversity_FeesDetails() {
var getCourseUnivFee = {
method: 'POST',
url: apiPoint.url + 'getCourseUnivFeesDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
$http(getCourseUnivFee).then(function (response) {
if (response.data.status==200 && response.data.courseStatus) {
$scope.university=response.data.universityDetails;
$scope.feesDetails=response.data.feesDetails;
$scope.myModel.ListName=$scope.feesDetails[0];
@ -342,8 +419,6 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
} else {
$scope.emptyData=false;
$scope.loader=true;
$scope.university=response.data.universityDetails;
$scope.feesDetails=response.data.feesDetails;
$scope.myModel.ListName=$scope.feesDetails[0];
@ -351,7 +426,7 @@ app.controller('courseCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTab
}
});
};
}
/*
* get fees type drop down

View File

@ -1013,9 +1013,9 @@ $scope.myUnivSearch = "";
// }
$scope.getStudentList();
}
$scope.Searchloader = false;
$scope.getStudentList = function () {
$scope.loader = true;
$scope.Searchloader = true;
var empListreq = {
method: 'POST',
url: apiPoint.url + 'getStudentList/',
@ -1029,12 +1029,12 @@ $scope.myUnivSearch = "";
};
$http(empListreq).then(function (response) {
if (response.data.studentList) {
$scope.loader = false;
$scope.Searchloader = false;
$scope.studentData = true;
$scope.data = response.data.student_details;
} else {
$scope.loader = false;
$scope.Searchloader = false;
$scope.studentData = false;
}
});

View File

@ -120,7 +120,7 @@
</div>
</div>
<div ng-if="loader == true" class="col-md-12" align="center">
<div ng-if="Searchloader == true" class="col-md-12" align="center">
<!--<spinner name="html5spinner">
<div class="overlay"></div>
<div class="spinner">
@ -137,7 +137,7 @@
records found... </h3></strong></p>
</div>
<div class="col-md-12" ng-if="studentData == true">
<div class="row">
<!--<div class="row">
<div class="col-md-3">
<script>
$(function () {
@ -146,7 +146,7 @@
</script>
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search" /><br><br>
</div>
</div>
</div>-->
<div class="table-responsive">
<table class="table table-hover">
<thead>