diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index a72c044d..74942f98 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -348,4 +348,5 @@ $route['receiveEnrolmentFromUniv'] = 'Receive_Enrolment_Fees_Univ_Controller/rec $route['insertFormIdUnivFeeDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/insertFormIdUnivFeeDetails'; $route['getStudentUnivFeeCompareDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getStudentUnivFeeCompareDetails'; $route['formIDFeeCompareDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/formIDFeeCompareDetails'; -$route['getUnmatchedRecordDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUnmatchedRecordDetails'; \ No newline at end of file +$route['getUnmatchedRecordDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUnmatchedRecordDetails'; +$route['getUniversitySessionDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUniversitySessionDetails'; \ No newline at end of file diff --git a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php index 972ac103..527680d4 100644 --- a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php +++ b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php @@ -33,6 +33,8 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php $this->methods['receiveEnrolmentFromUniv_post']['limit'] = 500; // 500 requests per hour per user/key $this->methods['formIDFeeCompareDetails_post']['limit'] = 500; + $this->methods['getUniversitySessionDetails_post']['limit'] = 500; + // load the model $this->load->model('Receive_Enrolment_Fees_Univ_model', 'receive_model'); @@ -103,9 +105,9 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { $searchData = $this->post('search'); $univID = $searchData['University']; - $courseID = $searchData['Course']; + $sessionID = $searchData['Session']; - $getUnivStudentFeeCompare = $this->receive_model->getStudentUnivFeeCompareDetails($univID,$courseID);// Check if the users data store contains users (in case the database result returns NULL) + $getUnivStudentFeeCompare = $this->receive_model->getStudentUnivFeeCompareDetails($univID,$sessionID);// Check if the users data store contains users (in case the database result returns NULL) if ($getUnivStudentFeeCompare) { $getUnivStudentFeeCompare['status'] = REST_Controller::HTTP_OK; @@ -170,5 +172,27 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } + public function getUniversitySessionDetails_post(){ + $reqData = $this->post('data'); + $loginUserId = $reqData['localUserID']; + $loginUserBranchId = $reqData['localBranchID']; + $loginUserType = $reqData['localType']; + $getUniversityListDetails = $this->receive_model->getUniversitySessionList($loginUserBranchId); // Check if the employee exist + if ($getUniversityListDetails['status']) { + // $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else if($getUniversityListDetails['status']==false){ + $this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + else { + // Set the response and exit + $this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + } } \ No newline at end of file diff --git a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php index 59597ce0..5b45a840 100644 --- a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php +++ b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php @@ -453,15 +453,16 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { return $results; } - public function getStudentUnivFeeCompareDetails($univCode=null,$courseCode=null){ + public function getStudentUnivFeeCompareDetails($univCode=null,$session=null){ $this->db->select('t1.FormID, t1.FormType, t1.SemesterYear, t1.EnrolmentNo,t1.CourseName,t1.RollNo, t4.*,t5.UniversityID, t5.UniversityName,t3.CourseID,t2.Amount as UniversityPaidAmount'); $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as t1'); $this->db->join(STUDENTCOURSE.' as t3', 't3.EnrollmentID = t1.EnrolmentNo'); $this->db->join(STUDENTS.' as t4', 't4.StudentID = t3.StudentID'); $this->db->join(UNIVERSITY.' as t5', 't5.UniversityID = t3.UniversityID'); $this->db->join(FORMFEESRECEIVEDFROMUNIV.' as t2', 't2.FormID = t1.FormID','left'); - $this->db->where('t1.CourseCode', $courseCode); + //$this->db->where('t1.CourseCode', $courseCode); $this->db->where('t1.UniversityCode', $univCode); + $details = $this->db->get(); $detailsList = $details->result(); if($detailsList){ @@ -714,5 +715,45 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { return $resultArr; } + /* + * get university session details for filter + * created by kms + * */ + public function getUniversitySessionList($branchID=null){ + $this->db->select('UniversityID,UniversityName'); + $this->db->order_by('UniversityID','DESC'); + $this->db->where('IsActive','1'); + // $this->db->where('BranchCode',$branchID); + $universityDetails = $this->db->get(UNIVERSITY); + $universityResult=array(); + if($universityDetails->result()){ + $universityResult['status']=true; + foreach ($universityDetails->result() as $row){ + $this->db->select('SM.SessionID,SM.SessionName'); + $this->db->order_by('SM.SessionID','DESC'); + $this->db->where('SM.IsActive','1'); + // $this->db->where('SM.BranchCode',$branchID); + $this->db->where('SD.UniversityID',$row->UniversityID); + $this->db->from(SESSIONMASTER.' as SM'); + $this->db->join(SESSIONDETAILS.' as SD', 'SD.SessionID = SM.SessionID'); + $sessionDetails = $this->db->get(); + $fetchArray['UniversityID']=$row->UniversityID; + $fetchArray['UniversityName']=$row->UniversityName; + if($sessionDetails->result()){ + $fetchArray['SessionDetails']=$sessionDetails->result(); + } + else{ + $fetchArray['SessionDetails']=""; + } + $getResult[]=$fetchArray; + } + $universityResult['details']=$getResult; + } + else{ + $universityResult['status']=false; + $universityResult['details']=""; + } + return $universityResult; + } } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/student_university_fee_compare.js b/Apollo/assets/js/controllers/student_university_fee_compare.js index 07189033..71357c3f 100644 --- a/Apollo/assets/js/controllers/student_university_fee_compare.js +++ b/Apollo/assets/js/controllers/student_university_fee_compare.js @@ -34,7 +34,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil if (localDetail != null) { if (localDetails.localType === 'R004') { - $scope.getUniversityList(); + // $scope.getUniversityList(); $scope.getUniversitySearchList(); } else { ipCookie.remove('cookiechk'); @@ -45,8 +45,8 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil } } - - $scope.universityData = ''; + + /*$scope.universityData = ''; $scope.getUniversityList = function () { var empListreq = { method: 'POST', @@ -64,13 +64,13 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil } else { } }); - } + }*/ // get University List $scope.universitySearchData = ''; $scope.getUniversitySearchList = function () { var empListreq = { method: 'POST', - url: apiPoint.url + 'getUniveCourseBratch/', + url: apiPoint.url + 'getUniversitySessionDetails/', headers: { 'Content-Type': 'application/json' }, @@ -79,10 +79,10 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil } }; $http(empListreq).then(function (response) { - if (response.data.univList) { - $scope.universitySearchData = response.data.university_details; - // alert() + if (response.data.status) { + $scope.universitySearchData = response.data.details; } else { + $scope.universitySearchData=""; } }); }; @@ -90,30 +90,49 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil $scope.searchData = { "University": "", - "Course": "", + "Session": "", "Status": "" } $scope.myUnivSearch = ""; + $scope.sessionData=""; $scope.getUniveId = function (univ) { + $scope.sessionData=""; if (univ === '') { $scope.myUnivSearch = ""; $scope.searchData.University = ''; - $scope.searchData.Course = ''; - $scope.searchData.Batch = ''; - $scope.courseData = name.Course; - $scope.batchData = name.Batch; + // $scope.searchData.Course = ''; + // $scope.searchData.Batch = ''; + // $scope.courseData = name.Course; + // $scope.batchData = name.Batch; + $scope.searchData.Session = ''; + $scope.OpenWindowStatus = false; } else { let name = JSON.parse(univ); $scope.searchData.University = name.UniversityID; - $scope.searchData.Course = ''; - $scope.searchData.Batch = ''; - $scope.courseData = name.Course; - $scope.batchData = name.Batch; + // $scope.searchData.Course = ''; + // $scope.searchData.Batch = ''; + // $scope.courseData = name.Course; + // $scope.batchData = name.Batch; + $scope.searchData.Session = ''; + $scope.sessionData = name.SessionDetails; $scope.OpenWindowStatus = false; } }; + //For session dropdown + $scope.filterSessionDetails=""; + $scope.$watch('searchData.University', function (newValue,oldValue) { + if(newValue==undefined || newValue==''){ + $scope.filterSessionDetails=""; + } + else{ + if(angular.isString(newValue)){ + $scope.filterSessionDetails=angular.fromJson(newValue); + } + } + + }); $scope.Searchloader = false; @@ -121,7 +140,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil $scope.onSubmit = function(){ $scope.Searchloader = true; - if($scope.searchData.University !== '' && $scope.searchData.Course !==''){ + if($scope.searchData.University !== '' && $scope.searchData.Session !==''){ $scope.Searchloader = true; var empListreq = { method: 'POST', @@ -131,7 +150,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil }, data: { data: localDetails, - search: $scope.searchData + search: $scope.searchData, } }; $http(empListreq).then(function (response) { diff --git a/Apollo/assets/views/student/studentUnivFeeCompareDetails.html b/Apollo/assets/views/student/studentUnivFeeCompareDetails.html index e6548e12..a9a9d3f0 100644 --- a/Apollo/assets/views/student/studentUnivFeeCompareDetails.html +++ b/Apollo/assets/views/student/studentUnivFeeCompareDetails.html @@ -69,20 +69,19 @@
- + +
- @@ -119,7 +118,9 @@ Enrolment ID - Action + University Paid + + Student Paid @@ -142,11 +143,13 @@ {{p.CourseName}} {{p.SemesterYear}} {{p.EnrolmentNo}} - + {{p.UniversityPaidAmount}} + {{p.StudentPaidAmount}} + - +