From d43efd8bec5ea988984a6290ddc4f087770448ef Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Thu, 7 Jun 2018 12:30:50 +0530 Subject: [PATCH] student admitted employee details capturing while student entrollment : kdk --- Apollo/api/application/config/routes.php | 1 + .../controllers/Student_Controller.php | 20 +++++++++++++ .../api/application/models/Student_model.php | 25 ++++++++++++++++ Apollo/assets/js/controllers/studentCtrl.js | 30 +++++++++++++++++-- .../views/student/editStudentDetails.html | 13 ++++++++ .../assets/views/student/student_details.html | 15 +++++++++- 6 files changed, 100 insertions(+), 4 deletions(-) diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 2326a961..d771ddd3 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -135,6 +135,7 @@ $route['deleteStuDocDetails'] = 'Student_Controller/deleteStuDocDetails'; $route['getListofStuPendingDocDetails'] = 'Student_Controller/getListofStuPendingDocDetails'; $route['addStudentEnrollPendingDocDetails'] = 'Student_Controller/addStudentEnrollPendingDocDetails'; $route['deleteDocPendingDetails'] = 'Student_Controller/deleteDocPendingDetails'; +$route['getEmployeeDetailsBranch'] = 'Student_Controller/getEmployeeDetailsBranch'; //batch $route['addBatchDetails'] = 'Batch_Controller/addBatchDetails'; diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index 7740cbcb..2c923a71 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -393,6 +393,7 @@ class Student_Controller extends REST_Controller { $req['ReferersMobileNumber'] = $data['ReferersMobileNumber']; $req['ProfilePicPath'] = $data['ProfilePicPath']; $req['Comments'] = $data['Comments']; + $req['AdmittedBy'] = $data['AdmittedBy']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '' : $data['DeactiveComments']; $req['IsActive'] = $data['IsActive'] == 1 ? "1" : "0"; $req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0"; @@ -528,6 +529,7 @@ class Student_Controller extends REST_Controller { $req['PreQualification'] = $data['prequalification']; $req['IsActive'] = $data['switchsetting']; $req['Comments'] = $data['Comments']; + $req['AdmittedBy'] = $data['admittedBy']; $req['BranchCode'] = $createdBranch; $req['DeactiveComments'] = $data['switchsetting'] == 1 ? '' : $data['DeactiveComments']; $req['CreatedBy'] = $createdBy; @@ -593,6 +595,7 @@ class Student_Controller extends REST_Controller { $req['PreQualification'] = $data['prequalification']; $req['IsActive'] = $data['switchsetting']; $req['Comments'] = $data['Comments']; + $req['AdmittedBy'] = $data['admittedBy']; $req['BranchCode'] = $createdBranch; $req['DeactiveComments'] = $data['switchsetting'] == 1 ? '' : $data['DeactiveComments']; $req['CreatedBy'] = $createdBy; @@ -622,4 +625,21 @@ class Student_Controller extends REST_Controller { } } + + public function getEmployeeDetailsBranch_post() { + $data = $this->post('data'); + $loginUserId = $data['localUserID']; + $loginBranchId = $data['localBranchID']; + $loginUserType = $data['localType']; + + $getLoginBranchEmpList = $this->student_model->get_login_branch_Emp_list($loginUserId, $loginBranchId, $loginUserType); // Check if the employee exist + if ($getLoginBranchEmpList) { + $getLoginBranchEmpList['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getLoginBranchEmpList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } else { + // Set the response and exit + $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], 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/Student_model.php b/Apollo/api/application/models/Student_model.php index 131b131d..f03ca971 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -999,6 +999,28 @@ class Student_model extends CI_Model { return $result; } + //get login branch employee list + public function get_login_branch_Emp_list($loginUserId, $loginBranchId, $loginUserType){ + $this->db->select('t2.StaffID, t2.Firstname, t2.Lastname'); + $this->db->from('' . STAFF_BRANCH . ' as t1'); + $this->db->join('' . STAFF . ' as t2', 't2.StaffID = t1.StaffID', 'LEFT'); + + $this->db->group_by('t1.StaffID'); + $this->db->where('t1.BranchCode', $loginBranchId); + // $this->db->where('t1.ListCode', EMPLOYEE); + $this->db->order_by('t1.CreatedOn', 'DESC'); + $empDetails = $this->db->get(); + $checkArr = $empDetails->result(); + if (count($checkArr) > 0) { + $results['employeeList'] = true; + $results['employees_details'] = $empDetails->result(); + } else { + $results['employeeList'] = false; + $results['message'] = 'No record found'; + } + return $results; + } + // image upload in taget path public function upload_image($imageSource, $size, $target) { $key2 = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 12); @@ -1013,6 +1035,8 @@ class Student_model extends CI_Model { return $result; } } + + /* * update followup details for application status in call tracking @@ -1145,4 +1169,5 @@ class Student_model extends CI_Model { curl_close($ch); return $output; } + } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 34946de2..29e5a630 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -63,6 +63,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.getStudentList(); $scope.getUniversityList(); $scope.getUniversitySearchList(); + $scope.getEmployeeList(); $scope.myModelCourseAdd.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); $scope.myModelCourse.dateofjoining = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); } else { @@ -73,6 +74,27 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } else { } } + + $scope.employeeList = ''; + $scope.getEmployeeList = function() { + var getEmpListBranch = { + method: 'POST', + url: apiPoint.url + 'getEmployeeDetailsBranch/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + data: localDetails + } + }; + $http(getEmpListBranch).then(function (response) { + if (response.data.employeeList) { + $scope.employeeList = response.data.employees_details; + } else { + $scope.employeeList = ''; + } + }); + } // get University List $scope.universitySearchData = ''; @@ -190,7 +212,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'referredmobilenumber': '', 'switchsetting': true, 'DeactiveComments': '', - 'Comments': '' + 'Comments': '', + 'admittedBy': '' }; $scope.myModelCourse = { @@ -586,7 +609,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } else { var req = { method: 'POST', - url: apiPoint.url + 'insertStudent/', + url: apiPoint.url + 'insertStudent1/', headers: { 'Content-Type': 'application/json' }, @@ -639,7 +662,8 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", 'referredmobilenumber': '', 'switchsetting': true, 'DeactiveComments': '', - 'Comments': '' + 'Comments': '', + 'admittedBy': '' }; $scope.myModelCourseAdd = { 'university': '', diff --git a/Apollo/assets/views/student/editStudentDetails.html b/Apollo/assets/views/student/editStudentDetails.html index 1579d1ef..a6bb1648 100755 --- a/Apollo/assets/views/student/editStudentDetails.html +++ b/Apollo/assets/views/student/editStudentDetails.html @@ -368,6 +368,19 @@
+
+ + + + Admitted By is Required + +
+
+ + + + Admitted By is Required + +