From d084108d5c012423495ded1f77dbf5a6ac3a45a0 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Sat, 25 Aug 2018 10:22:01 +0530 Subject: [PATCH] certificate status update changes : kdk --- .../controllers/StatusUpdation_Controller.php | 4 +++- .../application/models/StatusUpdation_model.php | 17 ++++++++++++----- .../js/controllers/certificateStatusCtrl.js | 15 +++++++++------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Apollo/api/application/controllers/StatusUpdation_Controller.php b/Apollo/api/application/controllers/StatusUpdation_Controller.php index 5c079ef0..056244b7 100755 --- a/Apollo/api/application/controllers/StatusUpdation_Controller.php +++ b/Apollo/api/application/controllers/StatusUpdation_Controller.php @@ -133,7 +133,9 @@ class StatusUpdation_Controller extends REST_Controller { // get certification type list public function getCertificateList_post() { $reqData = $this->post('data'); - $certificateList = $this->statusupdation_model->get_certificate_list($reqData['localBranchID']); // Check if the employee exist + $stuData = $this->post('studentID'); + $courseData = $this->post('courseID'); + $certificateList = $this->statusupdation_model->get_certificate_list($reqData['localBranchID'], $stuData, $courseData); // Check if the employee exist if ($certificateList) { $certificateList['status'] = REST_Controller::HTTP_OK; // Set the response and exit diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index 270f919f..8e71ebeb 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -153,12 +153,19 @@ class StatusUpdation_model extends CI_Model { } // get certificate list - public function get_certificate_list($branchId) { - $this->db->select('*'); + public function get_certificate_list($branchId, $sutendDetail, $courseDetails) { + // echo $sutendDetail, $courseDetails;exit(); + $this->db->select('CFR.*'); $this->db->order_by('CreatedOn', 'DESC'); - $this->db->from(CERTIFICATION); - $this->db->where('IsActive', 1); - $this->db->where('BranchCode', $branchId); + $this->db->from('T_Students_Fees_Status as SFS'); + // $this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = SFS.FeeType'); + // $this->db->join('T_Students_Fees_Status as SFS', 'SFS.StudentID = $sutendDetail'); + $this->db->join( '' . CERTIFICATION . ' as CFR', 'CFR.CertificateName = SFS.FeesType'); + $this->db->where('CFR.IsActive', 1); + $this->db->where('SFS.StudentID',$sutendDetail); + $this->db->where('SFS.CourseID',$courseDetails); + $this->db->where('CFR.BranchCode', $branchId); + $this->db->where('SFS.BranchCode', $branchId); $cerfDetails = $this->db->get(); $certificateDetails = $cerfDetails->result(); if (count($certificateDetails) > 0) { diff --git a/Apollo/assets/js/controllers/certificateStatusCtrl.js b/Apollo/assets/js/controllers/certificateStatusCtrl.js index 6dfa68e3..7ea95681 100644 --- a/Apollo/assets/js/controllers/certificateStatusCtrl.js +++ b/Apollo/assets/js/controllers/certificateStatusCtrl.js @@ -57,10 +57,10 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.localTypeSuperAdmin = true; $scope.getUniversityList(); $scope.getBranchList(); - getCertificateDetailsList(); + // getCertificateDetailsList(); } else { $scope.getUniversityList(); - getCertificateDetailsList(); + // getCertificateDetailsList(); } } else { } @@ -88,7 +88,7 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl } // get certificate or application list - var getCertificateDetailsList = function () { + var getCertificateDetailsList = function (stu, cour) { var getCerfreg = { method: 'POST', url: apiPoint.url + 'getCertificateList/', @@ -96,6 +96,8 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl 'Content-Type': 'application/json' }, data: { + studentID: stu, + courseID: cour, data: localDetails } }; @@ -245,7 +247,7 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl // Select one row in a table once $scope.setOneSelect = function (value) { - // alert(); + // alert(JSON.stringify(value)); angular.forEach($scope.searchResultDetails, function (item) { item.Selected = false; }); @@ -253,7 +255,7 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.statusUpdationId = value.UNI_ID; value.Selected = true; $scope.OpenWindowStatus = true; - $scope.openUpdateWind(); + $scope.openUpdateWind(value); } // unselect all the selected item @@ -267,7 +269,7 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl // open popup window onselct checkbox clicked or close popup window all the clicked items unchecked $scope.OpenWindowStatus = false; - $scope.openUpdateWind = function () { + $scope.openUpdateWind = function (s) { var ItemsSelected = $scope.searchResultDetails.filter(function (item) { if (item.Selected === true) { return true; } }); @@ -275,6 +277,7 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl const courseLocal = $scope.searchData.Course; $scope.getSemYearList(courseLocal); $scope.getStatusList(); + getCertificateDetailsList(s.StudentID, s.CourseID); $scope.OpenWindowStatus = true; $scope.myStatusModel = { 'semYear': '',