From b9beccaa571effd5e90639ef615a3ff05898db8a Mon Sep 17 00:00:00 2001 From: resicovenba Date: Mon, 4 Dec 2017 13:06:26 +0530 Subject: [PATCH] activity added --- Apollo/api/application/config/routes.php | 1 + .../controllers/Student_Controller.php | 21 +++++++++++++++++++ .../application/models/Calltracking_model.php | 1 + .../api/application/models/Student_model.php | 18 ++++++++++++++++ Apollo/assets/js/controllers/sessionCtrl.js | 1 + Apollo/assets/js/controllers/studentCtrl.js | 2 +- Apollo/assets/views/activity.html | 4 ++-- Apollo/assets/views/partials/top-navbar.html | 2 +- 8 files changed, 46 insertions(+), 4 deletions(-) diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index ffcf9506..dce50cd0 100644 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -102,6 +102,7 @@ $route['changePassword'] = 'Login_Controller/changePassword'; // student $route['insertStudent'] = 'Student_Controller/addStudent'; +$route['getStudentUniversity'] = 'Student_Controller/getStudentUniversity'; $route['getCourseBatchForUniv'] = 'Student_Controller/getCourseBatch'; $route['chkStudentExistDetail'] = 'Student_Controller/chkStudentExistDetail'; $route['getStudentList'] = 'Student_Controller/getStudentList'; diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index 4cd86954..d0dfda86 100644 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -61,6 +61,27 @@ class Student_Controller extends REST_Controller { } + public function getStudentUniversity_post() { + $reqData = $this->post('data'); + $loginUserId = $reqData['localUserID']; + $loginUserBranchId = $reqData['localBranchID']; + $loginUserType = $reqData['localType']; + $getUniversityListDetails = $this->student_model->get_university_list();// Check if the employee exist + if ($getUniversityListDetails) + { + $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 + { + // Set the response and exit + $this->response([ + 'message' => 'No list were found', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + } public function getStudentCourseList_post() { $studentID = $this->post('studentID'); diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index e562f4bc..7bafcf44 100644 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -121,6 +121,7 @@ class Calltracking_model extends CI_Model { { $this->db->select('ListCode,ListName'); $this->db->where('ListGroup','2'); + $this->db->where('IsActive','1'); $this->db->order_by('ListCode','ASC'); $activity = $this->db->get(PICK_LIST_DETAILS); return $activity->result(); diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index 11ec17d0..5f35c7ec 100644 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -128,6 +128,24 @@ class Student_model extends CI_Model return $result; } + // get university list + public function get_university_list() { + $this->db->select('*'); + $this->db->order_by('CreatedOn', 'DESC'); + $this->db->from(UNIVERSITY); + $this->db->where('IsActive',1); + $univDetails = $this->db->get(); + $universityDetails = $univDetails->result(); + if (count($universityDetails) > 0) { + $results['univList'] = true; + $results['university_details'] = $universityDetails; + } else { + $results['univList'] = false; + $results['message'] = 'No record found'; + } + return $results; + } + //get course for university diff --git a/Apollo/assets/js/controllers/sessionCtrl.js b/Apollo/assets/js/controllers/sessionCtrl.js index 644a083b..73d2bcc4 100644 --- a/Apollo/assets/js/controllers/sessionCtrl.js +++ b/Apollo/assets/js/controllers/sessionCtrl.js @@ -100,6 +100,7 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage", $scope.upDateLocalBran = function (Id) { + localDetail.localBranchID = Id; localDetails.localBranchID = Id; ipCookie('cookiechk', localDetails, { expires: 21 }); diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 9345e9f0..60cf913a 100644 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -314,7 +314,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.getUniversityList = function () { var empListreq = { method: 'POST', - url: apiPoint.url + 'getUniversity/', + url: apiPoint.url + 'getStudentUniversity/', headers: { 'Content-Type': 'application/json' }, diff --git a/Apollo/assets/views/activity.html b/Apollo/assets/views/activity.html index ccf7cc35..15e49c0d 100644 --- a/Apollo/assets/views/activity.html +++ b/Apollo/assets/views/activity.html @@ -21,7 +21,7 @@
-
+
-