diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 3e2858d9..f3bbd0c2 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -125,6 +125,7 @@ $route['getStudentList'] = 'Student_Controller/getStudentList'; $route['updateStudentExistDetail'] = 'Student_Controller/updateStudentExistDetail'; $route['chkUpdateStuExistDetail'] = 'Student_Controller/chkUpdateStuExistDetail'; $route['getStudentCourseList'] = 'Student_Controller/getStudentCourseList'; +$route['getStudentTrackingDetails']= 'Student_Controller/getStudentTrackingDetails'; $route['getStudentCourseDetails'] = 'Student_Controller/getStudentCourseDetails'; $route['updateStudentCourseDetail'] = 'Student_Controller/updateStudentCourseDetail'; $route['insertStudentCourse'] = 'Student_Controller/insertStudentCourse'; diff --git a/Apollo/api/application/controllers/Student_Controller.php b/Apollo/api/application/controllers/Student_Controller.php index 250bf000..3ea73fe4 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -118,7 +118,23 @@ class Student_Controller extends REST_Controller { } } - + public function getStudentTrackingDetails_post() + { + $MobileNumber = $this->post('MobileNumber'); + $trackingDetails = $this->student_model->get_student_tracking_details($MobileNumber); // Check if the employee exist + if ($trackingDetails) { + $trackingDetails['status'] = REST_Controller::HTTP_OK; + $trackingDetails['trackingstatus']=true; + $trackingDetails['trackingdata']=$trackingDetails; + // Set the response and exit + $this->response($trackingDetails, 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 + + } + } public function getStudentCourseDetails_post() { $studentCourseID = $this->post('studentcourseId'); $studentCourse = $this->student_model->get_student_course($studentCourseID); // Check if the employee exist diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index c847724b..7a503c7c 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -35,6 +35,21 @@ class Student_model extends CI_Model { $result['branch_active_status'] = $statusDetails->IsActive; return $result; } + public function get_student_tracking_details($MobileNumber) + { + $this->db->select('LTF.FollowupOn,LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,LT.University,LT.Course,LT.AlternateMobile,LT.Address,LT.Flag,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,AV.ActivityID,AV.ActivityName,LTF.FollowupComments'); + $this->db->from(LEAD_TRACKING_FOLLOWUP.' as LTF'); + $this->db->join(LEAD_TRACKING.' as LT','LT.TrackingID=LTF.TrackingID'); + $this->db->join(LEAD_DETAILS.' as LD', 'LT.LeadID = LD.LeadID'); + $this->db->join(LOGIN.' as LO', 'LO.ID = LT.AssignedTo'); + $this->db->join(STAFF.' as ST', 'ST.StaffID = LO.StaffID'); + $this->db->join(ACTIVITY.' as AV', 'AV.ActivityID = LT.ActivityStatus'); + $this->db->join(PICK_LIST_DETAILS.' as PLD1', 'PLD1.ListCode = LT.StatusCode'); + $this->db->where('LD.MobileNumber',$MobileNumber); + $trackingDetails=$this->db->get()->first_row(); + $result['trackingdetails'] =$trackingDetails; + return $result; + } // get student list based on login user public function get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $getSearchData,$batchcode) { diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 67d1db95..0ffd46c2 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -1831,13 +1831,15 @@ $scope.allcourselist =''; }); } - $scope.editId = -1; + $scope.editId = -1; $scope.editCourseId = -1; + $scope.editTrackingId=-1; $scope.setEditId = function (uniqe_id ,id) { // alert() $scope.editId = uniqe_id; $scope.editCourseId = -1; + $scope.editTrackingId=-1; } $scope.setEditCourseId = function (uniqe_id ,id) { @@ -1849,18 +1851,33 @@ $scope.allcourselist =''; // $scope.getStudentCourseDetails(id); $scope.editCourseId = uniqe_id; $scope.editId = -1; + $scope.editTrackingId=-1; $scope.courseEditLoading = true; $scope.courselist = true; } + $scope.setEditTrackingId = function (uniqe_id ,MobileNumber) { + + //alert('1'); + $scope.list = false; + $scope.getStudentTrackingDetails(MobileNumber); + $scope.currentStudentId = MobileNumber; + // $scope.getStudentCourseDetails(id); + $scope.editTrackingId = uniqe_id; + $scope.editId = -1; + $scope.editCourseId=-1; + $scope.trackingEditLoading = true; + $scope.courselist = true; + } $scope.cancel = function () { $scope.getStudentList(); $scope.editId = -1; $scope.editCourseId = -1; - + $scope.editTrackingId=-1; } + $scope.cancelCourseDetails = function () { $scope.getStudentCourseList($scope.currentStudentId); // $scope.editId = -1; @@ -2010,6 +2027,37 @@ $scope.allcourselist =''; } }); } + $scope.getStudentTrackingDetails = function (MobileNumber) + { + + $scope.trackingEditLoading = true; + $scope.list = true; + $scope.courseEdit = false; + $scope.courseAdd = false; + var req = { + method: 'POST', + url: apiPoint.url + 'getStudentTrackingDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + MobileNumber: MobileNumber, + + } + + }; + $http(req).then(function (response) { + + if (response.data.trackingstatus==true) { + + $scope.trackingDetails = response.data.trackingdata; + console.log($scope.trackingDetails); + } else { + $scope.trackingDetails = false; + $scope.courseEditLoading=''; + } + }); + } $scope.stuCourseEditDetailsObj = {}; diff --git a/Apollo/assets/views/student/editTrackingDetails.html b/Apollo/assets/views/student/editTrackingDetails.html new file mode 100644 index 00000000..c46327bd --- /dev/null +++ b/Apollo/assets/views/student/editTrackingDetails.html @@ -0,0 +1,67 @@ +