From 57bd4b9fb0e39e3a2746f747438edaf458da2394 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Tue, 24 Apr 2018 09:23:36 +0530 Subject: [PATCH] Income Expense & certificate type master changes: kdk --- .../controllers/Certificate_Controller.php | 3 +- .../controllers/DayBookMaster_Controller.php | 4 +- .../controllers/StatusUpdation_Controller.php | 2 +- .../controllers/Student_Controller.php | 6 +- .../application/models/Certificate_model.php | 3 +- .../models/DaybookMaster_model.php | 16 ++-- .../models/StatusUpdation_model.php | 7 +- .../api/application/models/Student_model.php | 6 +- .../assets/js/controllers/certificateCtrl.js | 3 +- .../js/controllers/dayBookMasterCtrl.js | 6 +- Apollo/assets/js/controllers/studentCtrl.js | 74 ++++++++++--------- .../student/student_details_SuperAdmin.html | 11 ++- 12 files changed, 77 insertions(+), 64 deletions(-) diff --git a/Apollo/api/application/controllers/Certificate_Controller.php b/Apollo/api/application/controllers/Certificate_Controller.php index 6aae62c2..0d923612 100755 --- a/Apollo/api/application/controllers/Certificate_Controller.php +++ b/Apollo/api/application/controllers/Certificate_Controller.php @@ -83,7 +83,8 @@ class Certificate_Controller extends REST_Controller { public function getCertificateDetails_post() { $requestedBy = $this->post('requestedBy'); - $getCertificate = $this->certificate_model->getCertificate($requestedBy); + $requestedBranch = $this->post('reqBrach'); + $getCertificate = $this->certificate_model->getCertificate($requestedBy, $requestedBranch); if ($getCertificate) { diff --git a/Apollo/api/application/controllers/DayBookMaster_Controller.php b/Apollo/api/application/controllers/DayBookMaster_Controller.php index 5704dc8a..29050469 100755 --- a/Apollo/api/application/controllers/DayBookMaster_Controller.php +++ b/Apollo/api/application/controllers/DayBookMaster_Controller.php @@ -49,6 +49,7 @@ class DayBookMaster_Controller extends REST_Controller { $details['IsActive'] = $this->post('status'); $details['CreatedBy'] = $this->post('createdBy'); $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); + $details['BranchCode'] = $this->post('requestedBranch'); $addDetails = $this->daybookmaster_model->addDetails($details);// Check if the users data store contains users (in case the database result returns NULL) if ($addDetails) { @@ -74,7 +75,8 @@ class DayBookMaster_Controller extends REST_Controller { public function getDayBookMasterDetails_post() { $requestedBy = $this->post('requestedBy'); - $getdetails = $this->daybookmaster_model->getDayBookDetails($requestedBy); + $requestedBranch = $this->post('requestedBranch'); + $getdetails = $this->daybookmaster_model->getDayBookDetails($requestedBy, $requestedBranch); if ($getdetails) { diff --git a/Apollo/api/application/controllers/StatusUpdation_Controller.php b/Apollo/api/application/controllers/StatusUpdation_Controller.php index d4b31b5a..d36ec258 100755 --- a/Apollo/api/application/controllers/StatusUpdation_Controller.php +++ b/Apollo/api/application/controllers/StatusUpdation_Controller.php @@ -40,7 +40,7 @@ class StatusUpdation_Controller extends REST_Controller { $loginUserId = $reqData['localUserID']; $loginUserBranchId = $reqData['localBranchID']; $loginUserType = $reqData['localType']; - $getUniversityListDetails = $this->statusupdation_model->get_university_course_batch();// Check if the employee exist + $getUniversityListDetails = $this->statusupdation_model->get_university_course_batch($loginUserBranchId);// Check if the employee exist if ($getUniversityListDetails) { $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index 207f2a15..5ec6577b 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -109,7 +109,7 @@ class Student_Controller extends REST_Controller { $loginUserId = $reqData['localUserID']; $loginUserBranchId = $reqData['localBranchID']; $loginUserType = $reqData['localType']; - $getUniversityListDetails = $this->student_model->get_university_list();// Check if the employee exist + $getUniversityListDetails = $this->student_model->get_university_list($loginUserBranchId);// Check if the employee exist if ($getUniversityListDetails) { $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; @@ -524,7 +524,9 @@ class Student_Controller extends REST_Controller { public function getCourseBatch_post() { $data = $this->post('data'); - $getCourseBatchListDetails = $this->student_model->get_courseBatch_list($data);// Check if the employee exist + $reqDetails = $this->post('reqDetails'); + + $getCourseBatchListDetails = $this->student_model->get_courseBatch_list($data, $reqDetails['localBranchID']);// Check if the employee exist if ($getCourseBatchListDetails) { $getCourseBatchListDetails['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/Certificate_model.php b/Apollo/api/application/models/Certificate_model.php index 807e15ca..59782713 100755 --- a/Apollo/api/application/models/Certificate_model.php +++ b/Apollo/api/application/models/Certificate_model.php @@ -47,9 +47,10 @@ class Certificate_model extends CI_Model { * parama id * created by Surendiran * */ - public function getCertificate() + public function getCertificate($reqBy, $reqBranch) { $this->db->select('CertificationID,CertificateName,CreatedOn,IsActive'); + $this->db->where('BranchCode', $reqBranch); $this->db->order_by('CertificationID','DESC'); $certificateDetails = $this->db->get(CERTIFICATION_MASTER); if($certificateDetails->result()){ diff --git a/Apollo/api/application/models/DaybookMaster_model.php b/Apollo/api/application/models/DaybookMaster_model.php index 5f178166..a2736119 100755 --- a/Apollo/api/application/models/DaybookMaster_model.php +++ b/Apollo/api/application/models/DaybookMaster_model.php @@ -19,6 +19,7 @@ class DaybookMaster_model extends CI_Model { $this->db->select('TypeName'); $this->db->where('TypeName', $arrayDetails['TypeName']); $this->db->where('TypeID', $arrayDetails['TypeID']); + $this->db->where('BranchCode', $arrayDetails['BranchCode']); if($this->db->get(INCOMEOUTCOMEMASTER)->first_row()){ $result['addStatus'] = false; $result['message'] = "Name is already exist!"; @@ -34,10 +35,6 @@ class DaybookMaster_model extends CI_Model { } } - - - - return $result; } @@ -49,15 +46,16 @@ class DaybookMaster_model extends CI_Model { * created by kms * */ - public function getDayBookDetails($requestedBy=null) + public function getDayBookDetails($requestedBy=null, $requestedBranch = null) { $this->db->select('IOM.ID,IOM.TypeName,IOM.TypeID,IOM.IsActive,PLD.ListName'); - + $this->db->from(INCOMEOUTCOMEMASTER .' as IOM'); $this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = IOM.TypeID'); + $this->db->where('IOM.BranchCode', $requestedBranch); $this->db->order_by('IOM.ID','DESC'); $details = $this->db->get(); - if($details->result()){ + if($details->result()){ $result['daybookStatus'] = true; $result['details'] = $details->result(); @@ -106,11 +104,7 @@ class DaybookMaster_model extends CI_Model { $result['updateStatus'] = false; $result['message'] = "Something went wrong.please try again"; } - } - return $result; - } - } \ No newline at end of file diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index 6076a7d3..622f79f1 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -495,10 +495,11 @@ class StatusUpdation_model extends CI_Model } // get list of universities, course, batch - public function get_university_course_batch() { + public function get_university_course_batch($branch) { $this->db->select('t1.UniversityID, t1.UniversityName'); $this->db->order_by('CreatedOn', 'DESC'); $this->db->from(''.UNIVERSITY. ' as t1'); + $this->db->where('BranchCode', $branch); $this->db->where('IsActive', 1); // $this->db->join('' . COURSE . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); $univDetails = $this->db->get(); @@ -513,6 +514,7 @@ class StatusUpdation_model extends CI_Model $this->db->from(''.COURSE. ' as t2'); $this->db->where('t2.UniversityID', $clip->UniversityID); $this->db->where('t2.IsActive', 1); + $this->db->where('BranchCode', $branch); $courDetails = $this->db->get(); $courseDetails = $courDetails->result(); $resultArr['Course'] =$courseDetails; @@ -521,7 +523,8 @@ class StatusUpdation_model extends CI_Model $this->db->from(''.BATCH. ' as t3'); $this->db->where('t3.UniversityID', $clip->UniversityID); $this->db->where('t3.IsActive', 1); - + $this->db->where('BranchCode', $branch); + //Session Details // $this->db->select('B.SessionID, B.SessionName'); // $this->db->from(SESSIONMASTER . ' as B'); diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index d484991a..f75e52dd 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -496,12 +496,13 @@ class Student_model extends CI_Model // get university list - public function get_university_list() + public function get_university_list($branch) { $this->db->select('*'); $this->db->order_by('CreatedOn', 'DESC'); $this->db->from(UNIVERSITY); $this->db->where('IsActive', 1); + $this->db->where('BranchCode', $branch); $univDetails = $this->db->get(); $universityDetails = $univDetails->result(); if (count($universityDetails) > 0) { @@ -518,12 +519,13 @@ class Student_model extends CI_Model // get course, batch for university - public function get_courseBatch_list($univId) + public function get_courseBatch_list($univId, $branch) { $this->db->select('C.CourseID, C.CourseName,C.Specilization1,C.Specilization2, C.CourseCode'); $this->db->from(COURSE . ' as C'); $this->db->where('UniversityID', $univId); $this->db->where('IsActive', 1); + $this->db->where('BranchCode', $branch); $courseDetails = $this->db->get(); if ($courseDetails->result()) { $this->db->select('B.SessionID, B.SessionName'); diff --git a/Apollo/assets/js/controllers/certificateCtrl.js b/Apollo/assets/js/controllers/certificateCtrl.js index 5901ecf0..da03c61c 100755 --- a/Apollo/assets/js/controllers/certificateCtrl.js +++ b/Apollo/assets/js/controllers/certificateCtrl.js @@ -118,7 +118,8 @@ $scope.certificateForm = { 'Content-Type': 'application/json' }, data: { - requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + reqBrach: JSON.parse(localStorage.getItem('localObj')).localBranchID } }; diff --git a/Apollo/assets/js/controllers/dayBookMasterCtrl.js b/Apollo/assets/js/controllers/dayBookMasterCtrl.js index b3ee320a..8d43f328 100755 --- a/Apollo/assets/js/controllers/dayBookMasterCtrl.js +++ b/Apollo/assets/js/controllers/dayBookMasterCtrl.js @@ -75,7 +75,8 @@ app.controller("dayBookMasterCtrl", ["$scope", "toaster", "$filter", "API_POINTS name: myModel.name, type: myModel.type, status: myModel.switchsetting, - createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID + createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + requestedBranch: JSON.parse(localStorage.getItem('localObj')).localBranchID } }; @@ -125,7 +126,8 @@ app.controller("dayBookMasterCtrl", ["$scope", "toaster", "$filter", "API_POINTS 'Content-Type': 'application/json' }, data: { - requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID + requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + requestedBranch: JSON.parse(localStorage.getItem('localObj')).localBranchID } }; diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 27a36b31..8835098d 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -393,7 +393,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'Content-Type': 'application/json' }, data: { - data: $scope.myModelCourse.university + data: $scope.myModelCourse.university, + reqDetails: localDetails } }; $http(univListreq).then(function (response) { @@ -424,7 +425,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'Content-Type': 'application/json' }, data: { - data: $scope.myModelCourseAdd.university + data: $scope.myModelCourseAdd.university, + reqDetails: localDetails } }; $http(univListreq).then(function (response) { @@ -933,7 +935,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'Content-Type': 'application/json' }, data: { - data: UniversityId + data: UniversityId, + reqDetails: localDetails } }; $http(univListreq).then(function (response) { @@ -1427,7 +1430,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.localUserType = localDetails.localType; if (localDetail != null) { if (localDetails.localType === 'R004') { - $scope.getBranchList(); + getDetails(); } else { ipCookie.remove('cookiechk'); $window.localStorage.clear(); @@ -1438,33 +1441,33 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl } - $scope.getBranchList = function () { - $scope.loader = true; - var empListreq = { - method: 'POST', - url: apiPoint.url + 'getBranchListDetails/', - headers: { - 'Content-Type': 'application/json' - }, - data: { - data: localDetails - } - }; - $http(empListreq).then(function (response) { - if (response.data.branDetailstatus) { - $scope.loader = false; - $scope.branchList_data = response.data.branch_details; - } else { - } - }); - } + // $scope.getBranchList = function () { + // $scope.loader = true; + // var empListreq = { + // method: 'POST', + // url: apiPoint.url + 'getBranchListDetails/', + // headers: { + // 'Content-Type': 'application/json' + // }, + // data: { + // data: localDetails + // } + // }; + // $http(empListreq).then(function (response) { + // if (response.data.branDetailstatus) { + // $scope.loader = false; + // $scope.branchList_data = response.data.branch_details; + // } else { + // } + // }); + // } - $scope.changeBranch = function () { - $scope.viewStudentDetailsPage = false; - localDetails.localBranchID = $scope.localBranchDetails; - localDetail.localBranchID = $scope.localBranchDetails; - getDetails() - } + // $scope.changeBranch = function () { + // $scope.viewStudentDetailsPage = false; + // localDetails.localBranchID = $scope.localBranchDetails; + // localDetail.localBranchID = $scope.localBranchDetails; + // getDetails() + // } function getDetails() { $scope.todayDate = new Date(); @@ -1478,7 +1481,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl // $scope.myModel.dateofbirth = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); $scope.myModelCourseAdd.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); $scope.myModelCourse.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); - $scope.viewStudentDetailsPage = true; + // $scope.viewStudentDetailsPage = true; } $scope.myModel = { @@ -1858,7 +1861,8 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'Content-Type': 'application/json' }, data: { - data: UniversityId + data: UniversityId, + reqDetails: localDetails } }; $http(univListreq).then(function (response) { @@ -1976,7 +1980,8 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'Content-Type': 'application/json' }, data: { - data: $scope.myModelCourse.university + data: $scope.myModelCourse.university, + reqDetails: localDetails } }; $http(univListreq).then(function (response) { @@ -2008,7 +2013,8 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl 'Content-Type': 'application/json' }, data: { - data: $scope.myModelCourseAdd.university + data: $scope.myModelCourseAdd.university, + reqDetails: localDetails } }; $http(univListreq).then(function (response) { diff --git a/Apollo/assets/views/student/student_details_SuperAdmin.html b/Apollo/assets/views/student/student_details_SuperAdmin.html index 5a1543c0..45857257 100755 --- a/Apollo/assets/views/student/student_details_SuperAdmin.html +++ b/Apollo/assets/views/student/student_details_SuperAdmin.html @@ -53,8 +53,8 @@ text-align: center; } -
-
+
+ Loading...
-
+
-->
-
+
- +