From 27324bae409e05c6ed85c6ea2d59ef19cb2781d0 Mon Sep 17 00:00:00 2001 From: saravana kumar kandasami Date: Mon, 19 Feb 2018 09:46:38 +0000 Subject: [PATCH 1/4] dashboardCtrl.js line no:288 --- Apollo/assets/js/controllers/dashboardCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index 0f77d24b..a8ce4eda 100755 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -285,7 +285,7 @@ app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS" }); } else { - swal("Failed!", "This student is not registerd", "warning"); + swal("Failed!", "This student is not registered", "warning"); $scope.courseEditLoading = false; $scope.studentDetails = ""; $scope.courseDetails = ""; From cca0b0388d68785f71094852972c63813daafb9e Mon Sep 17 00:00:00 2001 From: resicovenba Date: Tue, 20 Feb 2018 10:34:38 +0530 Subject: [PATCH 2/4] status updation screen Course details Updates : kdk --- Apollo/api/application/config/routes.php | 3 + .../controllers/Student_Controller.php | 95 + .../models/StatusUpdation_model.php | 416 ++-- .../api/application/models/Student_model.php | 1891 ++++++++++------- Apollo/assets/js/controllers/studentCtrl.js | 633 +++--- .../status-update/answer_booklet_status.html | 8 +- .../status-update/application_status.html | 8 +- .../status-update/certification_status.html | 8 +- .../status-update/study_material_status.html | 10 +- .../student/editStudentCourseDetails.html | 6 +- .../views/student/editStudentDetails.html | 762 +++---- .../assets/views/student/student_details.html | 4 +- .../student/student_details_SuperAdmin.html | 4 +- 13 files changed, 2216 insertions(+), 1632 deletions(-) diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 4a6e7e33..536537d6 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -129,6 +129,9 @@ $route['updateStudentImgDetails'] = 'Student_Controller/updateStudentImgDetails' $route['getBranchListDetails'] = 'Student_Controller/getBranchListDetails'; $route['getBranchActiveStatusforStuAdd'] = 'Student_Controller/getBranchActiveStatusforStuAdd'; $route['getExistingStudentDetails'] = 'Student_Controller/getExistingStudentDetails'; +$route['addStudentEntrollDocDetails'] = 'Student_Controller/addStudentEntrollDocDetails'; +$route['getListofStuDocDetails'] = 'Student_Controller/getListofStuDocDetails'; +$route['deleteStuDocDetails'] = 'Student_Controller/deleteStuDocDetails'; //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 1d578cf9..dfa7fa52 100755 --- a/Apollo/api/application/controllers/Student_Controller.php +++ b/Apollo/api/application/controllers/Student_Controller.php @@ -222,6 +222,101 @@ class Student_Controller extends REST_Controller { } } + // get student entrollment document details + public function getListofStuDocDetails_post() { + $StudentID = $this->post('exceptId'); + $localdata = $this->post('localData'); + + $studentDocDetails = $this->student_model->getStudent_doc_details($StudentID); + if ($studentDocDetails) + { + $studentDocDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($studentDocDetails, 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 deleteStuDocDetails_post() { + $StudentID = $this->post('exceptId'); + $docEntryId = $this->post('docDetailsID'); + $localdata = $this->post('localData'); + + $stuDocDeleteDetails = $this->student_model->deleteStu_doc_details($StudentID, $docEntryId); + if ($stuDocDeleteDetails) + { + $stuDocDeleteDetails['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($stuDocDeleteDetails, 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 addStudentEntrollDocDetails_post() { + // echo $this->post('stuDocProof_Status');exit(); + $docName = $_FILES['stuDocProof']['name'] ; + $docsize = $_FILES['stuDocProof']['size'] ; + $docSource = $_FILES['stuDocProof']['tmp_name']; + + + $temp= $this->post('data'); + $data = json_decode($temp, true); + $updatedBy = $this->post('updatedBy'); + $studentId = $this->post('studentID'); + + $doc_upload_status = $this->post('stuDocProof_Status'); + + $req['doc_name'] = $docName; + $req['doc_size'] = $docsize; + $req['doc_source'] = $docSource; + + $req['document_type_name'] = $data['documentName']; + $req['document_status'] = ''; + $req['document_comments'] = $data['documentComments']; + + $req['student_id'] = $studentId; + + $req['CreatedBy'] = $updatedBy; + $date = date('Y-m-d H:i:s'); + $req['CreatedOn'] = $date; + + $studentEntrollDocAdd = $this->student_model->student_entroll_doc_add( $req, $doc_upload_status);// Check if the employee exist + if ($studentEntrollDocAdd) + { + $studentEntrollDocAdd['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($studentEntrollDocAdd, 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 + } + // print_r($temp); + // echo $docName, $studentId, $data['documentName']; + // exit(); + + } + + public function updateStudentImgDetails_post() { $imagename = $_FILES['idStuUpProof']['name']; diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index ab826817..3d1566ee 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -53,20 +53,17 @@ class StatusUpdation_model extends CI_Model return $results; } - public function get_couser_name($cours) { - + public function get_couser_name($cours) { $this->db->select('t2.CourseName'); // $this->db->from('' . COURSE_FEES . ' as t1'); $this->db->from('' . COURSE . ' as t2'); $this->db->where('t2.CourseID', $cours); $roleDetails = $this->db->get()->first_row(); - return "$roleDetails->CourseName"; - + return "$roleDetails->CourseName"; } // update Application status public function update_applicationStatus($arr,$reqDetails) { - $this->db->insert_batch(APPLICATION_STATUS, $arr); if ($this->db->affected_rows() >= 1) { if($this->get_ListCode_status($arr[0]['ListCode'])){ @@ -102,9 +99,9 @@ class StatusUpdation_model extends CI_Model $dateToMsg = $arr[0]['CDate']; $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); // $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); - $cerNamtToMsg = 'MARK CARD'; - $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); - $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; + $cerNamtToMsg = 'MARK CARD'; + $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); + $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; // $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg."; $this->smssend($arr, $mesg); @@ -165,93 +162,92 @@ class StatusUpdation_model extends CI_Model public function get_prev_status_list($reqDetailsFor, $reqDetails){ if( $reqDetailsFor == 'STUDY_MATERIAL') { - $searchFor = 'M001'; - $searchTableFor = STUDY_MATERIAL_STATUS; - $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); - $this->db->from(''. $searchTableFor . ' as t1'); - $this->db->where('t1.StudentID', $reqDetails['student']); - $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); - $this->db->where('t2.CourseID', $reqDetails['CourseID']); - $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); - $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); - $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); - $this->db->order_by('t1.CreatedOn', 'DESC'); - $statusDetails = $this->db->get(); - $prevStatusDetails = $statusDetails->result(); - if (count($prevStatusDetails) > 0) { - $results['preStatusDetails'] = true; - $results['preStatus_details_list'] = $prevStatusDetails; - } else { - $results['preStatusDetails'] = false; - $results['message'] = 'No record found'; - } + $searchFor = 'M001'; + $searchTableFor = STUDY_MATERIAL_STATUS; + $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); + $this->db->from(''. $searchTableFor . ' as t1'); + $this->db->where('t1.StudentID', $reqDetails['student']); + $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); + $this->db->where('t2.CourseID', $reqDetails['CourseID']); + $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); + $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); + $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); + $this->db->order_by('t1.CreatedOn', 'DESC'); + $statusDetails = $this->db->get(); + $prevStatusDetails = $statusDetails->result(); + if (count($prevStatusDetails) > 0) { + $results['preStatusDetails'] = true; + $results['preStatus_details_list'] = $prevStatusDetails; + } else { + $results['preStatusDetails'] = false; + $results['message'] = 'No record found'; + } } else if ( $reqDetailsFor == 'APPICATION_STATUS' ) { - $searchFor = 'A001'; - $searchTableFor = APPLICATION_STATUS; - $this->db->select('t1.*, t4.Firstname, t5.ListName, t6.CertificateName'); - $this->db->from(''. $searchTableFor . ' as t1'); - $this->db->where('t1.StudentID', $reqDetails['student']); - // $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); - // $this->db->where('t2.CourseID', $reqDetails['CourseID']); - $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); - $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); - $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); - $this->db->join('' . CERTIFICATION . ' as t6', 't6.CertificationID = t1.CertificationType', 'LEFT'); - $this->db->order_by('t1.CreatedOn', 'DESC'); - $statusDetails = $this->db->get(); - $prevStatusDetails = $statusDetails->result(); - if (count($prevStatusDetails) > 0) { - $results['preStatusDetails'] = true; - $results['preStatus_details_list'] = $prevStatusDetails; - } else { - $results['preStatusDetails'] = false; - $results['message'] = 'No record found'; - } + $searchFor = 'A001'; + $searchTableFor = APPLICATION_STATUS; + $this->db->select('t1.*, t4.Firstname, t5.ListName, t6.CertificateName'); + $this->db->from(''. $searchTableFor . ' as t1'); + $this->db->where('t1.StudentID', $reqDetails['student']); + // $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); + // $this->db->where('t2.CourseID', $reqDetails['CourseID']); + $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); + $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); + $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); + $this->db->join('' . CERTIFICATION . ' as t6', 't6.CertificationID = t1.CertificationType', 'LEFT'); + $this->db->order_by('t1.CreatedOn', 'DESC'); + $statusDetails = $this->db->get(); + $prevStatusDetails = $statusDetails->result(); + if (count($prevStatusDetails) > 0) { + $results['preStatusDetails'] = true; + $results['preStatus_details_list'] = $prevStatusDetails; + } else { + $results['preStatusDetails'] = false; + $results['message'] = 'No record found'; + } } else if ( $reqDetailsFor == 'CERTIFICATION_STATUS' ) { $searchFor = 'C001'; $searchTableFor = CERTIFICATION_STATUS; - $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); - $this->db->from(''. $searchTableFor . ' as t1'); - $this->db->where('t1.StudentID', $reqDetails['student']); - $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); - $this->db->where('t2.CourseID', $reqDetails['CourseID']); - $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); - $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); - $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); - // $this->db->join('' . CERTIFICATION . ' as t6', 't6.CertificationID = t1.CertificationType', 'LEFT'); - $this->db->order_by('t1.CreatedOn', 'DESC'); - $statusDetails = $this->db->get(); - $prevStatusDetails = $statusDetails->result(); - if (count($prevStatusDetails) > 0) { - $results['preStatusDetails'] = true; - $results['preStatus_details_list'] = $prevStatusDetails; - } else { - $results['preStatusDetails'] = false; - $results['message'] = 'No record found'; - } + $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); + $this->db->from(''. $searchTableFor . ' as t1'); + $this->db->where('t1.StudentID', $reqDetails['student']); + $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); + $this->db->where('t2.CourseID', $reqDetails['CourseID']); + $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); + $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); + $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); + // $this->db->join('' . CERTIFICATION . ' as t6', 't6.CertificationID = t1.CertificationType', 'LEFT'); + $this->db->order_by('t1.CreatedOn', 'DESC'); + $statusDetails = $this->db->get(); + $prevStatusDetails = $statusDetails->result(); + if (count($prevStatusDetails) > 0) { + $results['preStatusDetails'] = true; + $results['preStatus_details_list'] = $prevStatusDetails; + } else { + $results['preStatusDetails'] = false; + $results['message'] = 'No record found'; + } } else if ( $reqDetailsFor == 'ANSWERBOOKLET_STATUS' ) { - $searchFor = 'B001'; - $searchTableFor = ANSWER_BOOKLET; - $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); - $this->db->from(''. $searchTableFor . ' as t1'); - $this->db->where('t1.StudentID', $reqDetails['student']); - $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); - $this->db->where('t2.CourseID', $reqDetails['CourseID']); - $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); - $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); - $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); - $this->db->order_by('t1.CreatedOn', 'DESC'); - $statusDetails = $this->db->get(); - $prevStatusDetails = $statusDetails->result(); - if (count($prevStatusDetails) > 0) { - $results['preStatusDetails'] = true; - $results['preStatus_details_list'] = $prevStatusDetails; - } else { - $results['preStatusDetails'] = false; - $results['message'] = 'No record found'; - } + $searchFor = 'B001'; + $searchTableFor = ANSWER_BOOKLET; + $this->db->select('t1.*, t4.Firstname, t5.ListName, t2.Sem_Year'); + $this->db->from(''. $searchTableFor . ' as t1'); + $this->db->where('t1.StudentID', $reqDetails['student']); + $this->db->join('' . COURSE_FEES . ' as t2', 't2.ID = t1.CourseID', 'LEFT'); + $this->db->where('t2.CourseID', $reqDetails['CourseID']); + $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); + $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); + $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); + $this->db->order_by('t1.CreatedOn', 'DESC'); + $statusDetails = $this->db->get(); + $prevStatusDetails = $statusDetails->result(); + if (count($prevStatusDetails) > 0) { + $results['preStatusDetails'] = true; + $results['preStatus_details_list'] = $prevStatusDetails; + } else { + $results['preStatusDetails'] = false; + $results['message'] = 'No record found'; + } } - return $results; } @@ -274,8 +270,6 @@ class StatusUpdation_model extends CI_Model // update answer booklet status public function update_answerbooklet($arr,$reqDetails) { - - // print_r($arr);exit(); $this->db->insert_batch(ANSWER_BOOKLET, $arr); if ($this->db->affected_rows() >= 1) { @@ -291,7 +285,6 @@ class StatusUpdation_model extends CI_Model } public function get_couser_sem_yr_msg($cours) { - $this->db->select('t1.Sem_Year, t2.CourseName'); $this->db->from('' . COURSE_FEES . ' as t1'); $this->db->join('' . COURSE . ' as t2', 't2.CourseID = t1.CourseID', 'LEFT'); @@ -335,52 +328,102 @@ class StatusUpdation_model extends CI_Model SFS.CourseID = '$reqData' AND SFS.StudentID = '$stuFor'"; // AND CF.ProgramType ='Y001'"; - $queryDetails = $this->db->query($subQuery); $results['semYearResult'] = true; $results['semYear_result_details'] = $queryDetails->result(); - return $results; } // get serach result public function get_search_result($reqData, $req) { - // print_r($reqData['University']); // print_r($req); // exit(); $University = $reqData['University']; $Course = $reqData['Course']; $Batch = $reqData['Batch']; - $branch = $req['localBranchID']; - if( $branch == 'All' ) { - $subQuery = "SELECT S.* , SC.CourseID , C.CourseName , U.UniversityName + + // echo $University; + // echo $branch + + if($University != '' && $Course == '' && $Batch == '') { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON SC.CourseID = C.CourseID WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University') - OR (SC.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University')) + SC.UniversityID = '$University' AND S.IsActive = '1' AND SC.IsActive = '1'"; - + // AND S.BranchCode = '$branch' + // SC.UniversityID LIKE '%$University%' + // AND SC.CourseID LIKE '%$Course%' + // AND SC.BatchCode LIKE '%$Batch%' $queryDetails = $this->db->query($subQuery); $results['searchResult'] = true; $results['search_result_details'] = $queryDetails->result(); - } else { - // echo $University; - // echo $branch; - $subQuery = "SELECT S.* , SC.CourseID , C.CourseName , U.UniversityName + } else if ($University != '' && $Course != '' && $Batch == '' ) { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON SC.CourseID = C.CourseID WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University') - OR (SC.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University')) + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND S.IsActive = '1' + AND SC.IsActive = '1'"; + // AND S.BranchCode = '$branch' + // SC.UniversityID LIKE '%$University%' + // AND SC.CourseID LIKE '%$Course%' + // AND SC.BatchCode LIKE '%$Batch%' + $queryDetails = $this->db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + } else if ( $University != '' && $Course == '' && $Batch != '' ) { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName + FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID + LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + SC.CourseID = C.CourseID + WHERE + SC.BatchCode = '$Batch' AND SC.UniversityID = '$University' + AND S.IsActive = '1' + AND SC.IsActive = '1'"; + // AND S.BranchCode = '$branch' + // SC.UniversityID LIKE '%$University%' + // AND SC.CourseID LIKE '%$Course%' + // AND SC.BatchCode LIKE '%$Batch%' + $queryDetails = $this->db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + }else if ( $University != '' && $Course != '' && $Batch != '' ) { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName + FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID + LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + SC.CourseID = C.CourseID + WHERE + SC.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND S.IsActive = '1' + AND SC.IsActive = '1'"; + // AND S.BranchCode = '$branch' + // SC.UniversityID LIKE '%$University%' + // AND SC.CourseID LIKE '%$Course%' + // AND SC.BatchCode LIKE '%$Batch%' + $queryDetails = $this->db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + } + } else { + // echo $University; + // echo $branch; + + if($University != '' && $Course == '' && $Batch == '') { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName + FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID + LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + SC.CourseID = C.CourseID + WHERE + SC.UniversityID = '$University' AND S.IsActive = '1' AND SC.BranchID = '$branch' AND SC.IsActive = '1'"; @@ -388,10 +431,61 @@ class StatusUpdation_model extends CI_Model // SC.UniversityID LIKE '%$University%' // AND SC.CourseID LIKE '%$Course%' // AND SC.BatchCode LIKE '%$Batch%' - $queryDetails = $this->db->query($subQuery); $results['searchResult'] = true; $results['search_result_details'] = $queryDetails->result(); + } else if ($University != '' && $Course != '' && $Batch == '' ) { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName + FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID + LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + SC.CourseID = C.CourseID + WHERE + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND S.IsActive = '1' + AND SC.BranchID = '$branch' + AND SC.IsActive = '1'"; + // AND S.BranchCode = '$branch' + // SC.UniversityID LIKE '%$University%' + // AND SC.CourseID LIKE '%$Course%' + // AND SC.BatchCode LIKE '%$Batch%' + $queryDetails = $this->db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + } else if ( $University != '' && $Course == '' && $Batch != '' ) { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName ,C.CourseCode, U.UniversityName + FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID + LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + SC.CourseID = C.CourseID + WHERE + SC.BatchCode = '$Batch' AND SC.UniversityID = '$University' + AND S.IsActive = '1' + AND SC.BranchID = '$branch' + AND SC.IsActive = '1'"; + // AND S.BranchCode = '$branch' + // SC.UniversityID LIKE '%$University%' + // AND SC.CourseID LIKE '%$Course%' + // AND SC.BatchCode LIKE '%$Batch%' + $queryDetails = $this->db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + } else if ( $University != '' && $Course != '' && $Batch != '' ) { + $subQuery = "SELECT S.* , SC.ID as UNI_ID, SC.CourseID , C.CourseName , C.CourseCode, U.UniversityName + FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID + LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + SC.CourseID = C.CourseID + WHERE + SC.BatchCode = '$Batch' AND SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND S.IsActive = '1' + AND SC.BranchID = '$branch' + AND SC.IsActive = '1'"; + // AND S.BranchCode = '$branch' + // SC.UniversityID LIKE '%$University%' + // AND SC.CourseID LIKE '%$Course%' + // AND SC.BatchCode LIKE '%$Batch%' + $queryDetails = $this->db->query($subQuery); + $results['searchResult'] = true; + $results['search_result_details'] = $queryDetails->result(); + } } return $results; } @@ -410,16 +504,14 @@ class StatusUpdation_model extends CI_Model // University Details $resultArr['UniversityID'] = $clip->UniversityID; $resultArr['UniversityName'] = $clip->UniversityName; - // Course Details - $this->db->select('t2.CourseID, t2.CourseName'); + $this->db->select('t2.CourseID, t2.CourseName, t2.CourseCode'); $this->db->from(''.COURSE. ' as t2'); $this->db->where('t2.UniversityID', $clip->UniversityID); $this->db->where('t2.IsActive', 1); $courDetails = $this->db->get(); $courseDetails = $courDetails->result(); $resultArr['Course'] =$courseDetails; - // Batch Details $this->db->select('t3.BatchName, t3.BatchCode'); $this->db->from(''.BATCH. ' as t3'); @@ -438,10 +530,8 @@ class StatusUpdation_model extends CI_Model // http://www.24x7sms.com/downloads/24X7SMS_http_API2.0.pdf // API Key : xegCdYUIMf3 - // Your new password for logging into Apollo student portal is (Password). Please change the password as soon as you login. // This is the template to be used. - public function smssend($arr, $msg) { $number =array(); @@ -514,8 +604,6 @@ class StatusUpdation_model extends CI_Model $this->db->where('PLD.IsActive','1'); $checkStatus=$this->db->get()->last_row(); if($checkStatus){ - - $studentDetails = $this->studentInfo($fromDetails); if($studentDetails){ $arrayDetails['MobileNumber']=$studentDetails->MobileNumber; @@ -554,43 +642,7 @@ class StatusUpdation_model extends CI_Model $this->db->where('IsActive', '1'); $activityDetails=$this->db->get(ACTIVITY)->last_row(); if($activityDetails){ - - $newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber']; - $newLeadDetails['LeadName'] = $arrayDetails['LeadName']; - $newLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy']; - $newLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn']; - $this->db->insert(LEAD_DETAILS, $newLeadDetails); - // this if for insert lead details - if($this->db->affected_rows() == '1'){ - // get and store insert id from db - $track_Details['LeadID']=$this->db->insert_id(); - $track_Details['ActivityStatus'] = $activityDetails->ActivityID; - $track_Details['University'] = $arrayDetails['University']; - $track_Details['Course'] = $arrayDetails['Course']; - $track_Details['AssignedTo'] = $arrayDetails['CreatedBy']; - $track_Details['StatusCode'] = $arrayDetails['StatusCode']; - $track_Details['CreatedBy'] = $arrayDetails['CreatedBy']; - $track_Details['CreatedOn'] = $arrayDetails['CreatedOn']; - $track_Details['CreatedBranch']=$arrayDetails['CreatedBranch']; - $this->db->insert(LEAD_TRACKING, $track_Details); - // this if for insert tracking details - if($this->db->affected_rows() == '1'){ - $insertfollowup_Details['TrackingID']=$this->db->insert_id(); - $insertfollowup_Details['FollowupOn']=$arrayDetails['FollowupOn']; - $insertfollowup_Details['FollowupComments']=$arrayDetails['FollowupComments']; - $insertfollowup_Details['CreatedBy'] = $arrayDetails['CreatedBy']; - $insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn']; - $this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details); - // this if for insert follow up details - - } - - - } - - // hide tracking updated code - - /*$this->db->select('LD.LeadID,LT.TrackingID'); + $this->db->select('LD.LeadID,LT.TrackingID'); $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); $this->db->where('LD.MobileNumber',$arrayDetails['MobileNumber']); @@ -609,7 +661,6 @@ class StatusUpdation_model extends CI_Model $changeStatusCode['UpdatedBy'] = $arrayDetails['CreatedBy']; $changeStatusCode['UpdatedOn'] = $arrayDetails['CreatedOn']; $changeStatusCode['CreatedBranch']=$arrayDetails['CreatedBranch']; - $this->db->where('TrackingID',$leadDet->TrackingID); $this->db->update(LEAD_TRACKING, $changeStatusCode); // end update status @@ -619,9 +670,7 @@ class StatusUpdation_model extends CI_Model $updateTrackDetails['CreatedBy'] = $arrayDetails['CreatedBy']; $updateTrackDetails['CreatedOn'] = $arrayDetails['CreatedOn']; $this->db->insert(LEAD_TRACKING_FOLLOWUP, $updateTrackDetails); - } - else{ $this->db->select('LeadID'); $this->db->where('MobileNumber',$arrayDetails['MobileNumber']); @@ -646,9 +695,7 @@ class StatusUpdation_model extends CI_Model $followup_Details['CreatedOn'] = $arrayDetails['CreatedOn']; $this->db->insert(LEAD_TRACKING_FOLLOWUP, $followup_Details); // this if for insert follow up details - } - } else{ $newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber']; @@ -678,21 +725,12 @@ class StatusUpdation_model extends CI_Model $insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn']; $this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details); // this if for insert follow up details - } - - } - } - - - }*/ - - + } } } - return true; } else{ @@ -762,43 +800,7 @@ class StatusUpdation_model extends CI_Model $this->db->where('IsActive', '1'); $activityDetails=$this->db->get(ACTIVITY)->last_row(); if($activityDetails){ - - $newLeadDetails['MobileNumber'] = $arrayDetails['MobileNumber']; - $newLeadDetails['LeadName'] = $arrayDetails['LeadName']; - $newLeadDetails['CreatedBy'] = $arrayDetails['CreatedBy']; - $newLeadDetails['CreatedOn'] = $arrayDetails['CreatedOn']; - $this->db->insert(LEAD_DETAILS, $newLeadDetails); - // this if for insert lead details - if($this->db->affected_rows() == '1'){ - // get and store insert id from db - $track_Details['LeadID']=$this->db->insert_id(); - $track_Details['ActivityStatus'] = $activityDetails->ActivityID; - $track_Details['University'] = $arrayDetails['University']; - $track_Details['Course'] = $arrayDetails['Course']; - $track_Details['AssignedTo'] = $arrayDetails['CreatedBy']; - $track_Details['StatusCode'] = $arrayDetails['StatusCode']; - $track_Details['CreatedBy'] = $arrayDetails['CreatedBy']; - $track_Details['CreatedOn'] = $arrayDetails['CreatedOn']; - $track_Details['CreatedBranch']=$arrayDetails['CreatedBranch']; - $this->db->insert(LEAD_TRACKING, $track_Details); - // this if for insert tracking details - if($this->db->affected_rows() == '1'){ - $insertfollowup_Details['TrackingID']=$this->db->insert_id(); - $insertfollowup_Details['FollowupOn']=$arrayDetails['FollowupOn']; - $insertfollowup_Details['FollowupComments']=$arrayDetails['FollowupComments']; - $insertfollowup_Details['CreatedBy'] = $arrayDetails['CreatedBy']; - $insertfollowup_Details['CreatedOn'] = $arrayDetails['CreatedOn']; - $this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertfollowup_Details); - // this if for insert follow up details - - } - - - } - - /// hide seperate track id - - /* $this->db->select('LD.LeadID,LT.TrackingID'); + $this->db->select('LD.LeadID,LT.TrackingID'); $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); $this->db->where('LD.MobileNumber',$arrayDetails['MobileNumber']); @@ -895,7 +897,7 @@ class StatusUpdation_model extends CI_Model } - }*/ + } } diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index 2206b182..0d21fd16 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -4,813 +4,1144 @@ * Time: 5:28 PM */ defined('BASEPATH') OR exit('No direct script access allowed'); - class Student_model extends CI_Model + { - - /* - * student details - * - * created by kdk - * */ + /* + * student details + * + * created by kdk + * */ - // get List of Branchs - public function get_branch_list() { - $this->db->select('t1.BranchCode,t1.BranchName'); - $this->db->from('' . BRANCH . ' as t1'); - // $this->db->where('t1.IsActive', 1); - $branchDetails = $this->db->get(); - $checkArr = $branchDetails->result(); - if (count($checkArr) > 0) { - $result['branDetailstatus'] = true; - $result['branch_details'] = $branchDetails->result(); - } else { - $result['branDetailstatus'] = false; - } - return $result; - } - - // check the branch active status for student add - public function getBranchActiveStatusforStuAdd($branchId){ - $this->db->select('t1.IsActive'); - $this->db->from('' . BRANCH . ' as t1'); - $this->db->where('BranchCode', $branchId); - $statusDetails = $this->db->get()->first_row(); - // echo $statusDetails->IsActive;exit(); - $result['branch_active_status'] = $statusDetails->IsActive; - return $result; - // if (count($checkArr) > 0) { - // $result['branDetailstatus'] = true; - // $result['branch_details'] = $branchDetails->result(); - // } else { - // $result['branDetailstatus'] = false; - // } - // return $result; - } - + // get List of Branches - // get student list based on login user - public function get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $getSearchData) - { - // print_r($getSearchData);exit(); - // echo $loginUserId, $loginUserBranchId, $loginUserType; exit(); - if ($loginUserType == SUPER_ADMIN) { - // list for super admin based on branch - if($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') { - $this->db->select('*'); - $this->db->from('' . STUDENTS . ' as t1'); - // $this->db->order_by('CreatedOn', 'DESC'); - // $this->db->where('BranchCode', $loginUserBranchId); - $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); - $this->db->where('t2.BranchID', $loginUserBranchId); - $this->db->group_by('t2.StudentID'); - $this->db->order_by('t2.CreatedOn', 'DESC'); - $stuDetails = $this->db->get(); - $checkArr = $stuDetails->result(); - if (count($checkArr) > 0) { - $results['studentList'] = true; - $results['student_details'] = $stuDetails->result(); - } else { - $results['studentList'] = false; - }} else { - // print_r($getSearchData);exit(); - // $this->db->select('t1.*'); - // // $this->db->from(STUDENTS); - // $this->db->from('' . STUDENTS . ' as t1'); - // $this->db->order_by('t1.CreatedOn', 'DESC'); - // $this->db->where('t1.BranchCode', $loginUserBranchId); - // $this->db->from('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); - // $this->db->where('t2.UniversityID', $getSearchData["University"]); - // $this->db->where('t2.CourseID', $getSearchData["Course"]); - $University = $getSearchData['University']; - $Course = $getSearchData['Course']; - // $Batch = $getSearchData['Batch']; - $Batch=''; - $StuStatus = $getSearchData['Status']; + public function get_branch_list() + { + $this->db->select('t1.BranchCode,t1.BranchName'); + $this->db->from('' . BRANCH . ' as t1'); - if($StuStatus == ''){ - $subQuery = "SELECT S.* - FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID - LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON - SC.CourseID = C.CourseID - WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')) - AND S.BranchCode = '$loginUserBranchId' - GROUP BY SC.StudentID - ORDER BY S.CreatedOn"; - } else { - $subQuery = "SELECT S.* - FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID - LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON - SC.CourseID = C.CourseID - WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')) - AND S.IsActive = '$StuStatus' - AND S.BranchCode = '$loginUserBranchId' - GROUP BY SC.StudentID - ORDER BY S.CreatedOn"; - } + // $this->db->where('t1.IsActive', 1); - $stuDetails = $this->db->query($subQuery); - - // $stuDetails = $this->db->get(); - $checkArr = $stuDetails->result(); - if (count($checkArr) > 0) { - $results['studentList'] = true; - $results['student_details'] = $stuDetails->result(); - } else { - $results['studentList'] = false; - } - } - // if ($loginUserBranchId == 'All') { - // // for getting all branch details - // $staffId = $this->selfGetEmpId($loginUserId); - // $this->db->select('*'); - // $this->db->order_by('CreatedOn', 'DESC'); - // $this->db->from(STAFF); - // // not for SuperAdmin and Student Role code - // $this->db->where_not_in('StaffID', $staffId); - // // $this->db->where('BranchCode', $loginUserBranchId); - // $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'; - // } - // } else { - // $staffId = $this->selfGetEmpId($loginUserId); - // $this->db->select('*'); - // $this->db->order_by('CreatedOn', 'DESC'); - // $this->db->from(STAFF); - // // not for SuperAdmin and Student Role code - // $this->db->where_not_in('StaffID', $staffId); - // $this->db->where('BranchCode', $loginUserBranchId); - // $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'; - // } - // } - } else if ($loginUserType == ADMIN) { - // list for admin - if($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') { - // print_r($getSearchData);exit(); - $this->db->select('*'); - $this->db->from('' . STUDENTS . ' as t1'); - // $this->db->where('BranchCode', $loginUserBranchId); - // $this->db->group_by('user_id'); - $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); - $this->db->where('t2.BranchID', $loginUserBranchId); - $this->db->group_by('t2.StudentID'); - $this->db->order_by('t2.CreatedOn', 'DESC'); + $branchDetails = $this->db->get(); + $checkArr = $branchDetails->result(); + if (count($checkArr) > 0) { + $result['branDetailstatus'] = true; + $result['branch_details'] = $branchDetails->result(); + } + else { + $result['branDetailstatus'] = false; + } - $stuDetails = $this->db->get(); - $checkArr = $stuDetails->result(); - if (count($checkArr) > 0) { - $results['studentList'] = true; - $results['student_details'] = $stuDetails->result(); - } else { - $results['studentList'] = false; - } - } else { - // print_r($getSearchData);exit(); - // $this->db->select('t1.*'); - // // $this->db->from(STUDENTS); - // $this->db->from('' . STUDENTS . ' as t1'); - // $this->db->order_by('t1.CreatedOn', 'DESC'); - // $this->db->where('t1.BranchCode', $loginUserBranchId); - // $this->db->from('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); - // $this->db->where('t2.UniversityID', $getSearchData["University"]); - // $this->db->where('t2.CourseID', $getSearchData["Course"]); - - $University = $getSearchData['University']; - $Course = $getSearchData['Course']; - // $Batch = $getSearchData['Batch']; - $Batch=''; - $StuStatus = $getSearchData['Status']; - if($StuStatus == '' ){ - $subQuery = "SELECT S.* - FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID - LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON - SC.CourseID = C.CourseID - WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')) - AND SC.BranchID = '$loginUserBranchId' - GROUP BY SC.StudentID - ORDER BY S.CreatedOn"; - } else { - $subQuery = "SELECT S.* - FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID - LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON - SC.CourseID = C.CourseID - WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')) - AND S.IsActive = '$StuStatus' - AND SC.BranchID = '$loginUserBranchId' - GROUP BY SC.StudentID - ORDER BY S.CreatedOn"; - } - $stuDetails = $this->db->query($subQuery); - // $stuDetails = $this->db->get(); - $checkArr = $stuDetails->result(); - if (count($checkArr) > 0) { - $results['studentList'] = true; - $results['student_details'] = $stuDetails->result(); - } else { - $results['studentList'] = false; - } - } - - } else if ($loginUserType == EMPLOYEE) { - // list for staff - // list for admin - if($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') { - // print_r($getSearchData);exit(); + return $result; + } - $this->db->select('t1.*'); - $this->db->from('' . STUDENTS . ' as t1'); - $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); - $this->db->where('t2.BranchID', $loginUserBranchId); - $this->db->group_by('t2.StudentID'); - // $this->db->from(STUDENTS); - $this->db->order_by('t2.CreatedOn', 'DESC'); - $stuDetails = $this->db->get(); - $checkArr = $stuDetails->result(); - if (count($checkArr) > 0) { - $results['studentList'] = true; - $results['student_details'] = $stuDetails->result(); - } else { - $results['studentList'] = false; - } - } else { - // print_r($getSearchData);exit(); - // $this->db->select('t1.*'); - // // $this->db->from(STUDENTS); - // $this->db->from('' . STUDENTS . ' as t1'); - // $this->db->order_by('t1.CreatedOn', 'DESC'); - // $this->db->where('t1.BranchCode', $loginUserBranchId); - // $this->db->from('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); - // $this->db->where('t2.UniversityID', $getSearchData["University"]); - // $this->db->where('t2.CourseID', $getSearchData["Course"]); - - $University = $getSearchData['University']; - $Course = $getSearchData['Course']; - // $Batch = $getSearchData['Batch']; - $Batch=''; - $StuStatus = $getSearchData['Status']; + // check the branch active status for student add - if($StuStatus == '' ){ - $subQuery = "SELECT S.* - FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID - LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON + public function getBranchActiveStatusforStuAdd($branchId) + { + $this->db->select('t1.IsActive'); + $this->db->from('' . BRANCH . ' as t1'); + $this->db->where('BranchCode', $branchId); + $statusDetails = $this->db->get()->first_row(); + + // echo $statusDetails->IsActive;exit(); + + $result['branch_active_status'] = $statusDetails->IsActive; + return $result; + + // if (count($checkArr) > 0) { + // $result['branDetailstatus'] = true; + // $result['branch_details'] = $branchDetails->result(); + // } else { + // $result['branDetailstatus'] = false; + // } + // return $result; + + } + + // get student list based on login user + + public function get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $getSearchData) + { + + // print_r($getSearchData);exit(); + // echo $loginUserId, $loginUserBranchId, $loginUserType; exit(); + + if ($loginUserType == SUPER_ADMIN) { + + // list for super admin based on branch + + if ($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') { + $this->db->select('*'); + $this->db->from('' . STUDENTS . ' as t1'); + + // $this->db->order_by('CreatedOn', 'DESC'); + // $this->db->where('BranchCode', $loginUserBranchId); + + $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); + $this->db->where('t2.BranchID', $loginUserBranchId); + $this->db->group_by('t2.StudentID'); + $this->db->order_by('t2.CreatedOn', 'DESC'); + $stuDetails = $this->db->get(); + $checkArr = $stuDetails->result(); + if (count($checkArr) > 0) { + $results['studentList'] = true; + $results['student_details'] = $stuDetails->result(); + } + else { + $results['studentList'] = false; + } + } + else { + + // print_r($getSearchData);exit(); + // $this->db->select('t1.*'); + // // $this->db->from(STUDENTS); + // $this->db->from('' . STUDENTS . ' as t1'); + // $this->db->order_by('t1.CreatedOn', 'DESC'); + // $this->db->where('t1.BranchCode', $loginUserBranchId); + // $this->db->from('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); + // $this->db->where('t2.UniversityID', $getSearchData["University"]); + // $this->db->where('t2.CourseID', $getSearchData["Course"]); + + $University = $getSearchData['University']; + $Course = $getSearchData['Course']; + + // $Batch = $getSearchData['Batch']; + + $Batch = ''; + $StuStatus = $getSearchData['Status']; + if ($StuStatus == '') { + if ($University != '' && $Course == '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON SC.CourseID = C.CourseID WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')) - AND SC.BranchID = '$loginUserBranchId' - GROUP BY SC.StudentID - ORDER BY S.CreatedOn"; - // ### query branch code changed from student branch code to student course branch code - //AND S.BranchCode = '$loginUserBranchId' -> SC.BranchCode = '$loginUserBranchId' - } else { - $subQuery = "SELECT S.* - FROM ".STUDENTS." as S LEFT JOIN ".STUDENTCOURSE." as SC ON SC.StudentID = S.StudentID - LEFT JOIN ".UNIVERSITY." as U ON SC.UniversityID = U.UniversityID LEFT JOIN ".COURSE." as C ON - SC.CourseID = C.CourseID - WHERE - (SC.UniversityID = '$University' - OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')) - AND S.IsActive = '$StuStatus' + SC.UniversityID = '$University' AND SC.BranchID = '$loginUserBranchId' GROUP BY SC.StudentID ORDER BY S.CreatedOn"; - // ### query branch code changed from student branch code to student course branch code - //AND S.BranchCode = '$loginUserBranchId' -> SC.BranchCode = '$loginUserBranchId' - } + } + else + if ($University != '' && $Course != '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + } + else { + if ($University != '' && $Course == '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + AND S.IsActive = '$StuStatus' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + else + if ($University != '' && $Course != '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + AND S.IsActive = '$StuStatus' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + } - $stuDetails = $this->db->query($subQuery); - - // $stuDetails = $this->db->get(); - $checkArr = $stuDetails->result(); - if (count($checkArr) > 0) { - $results['studentList'] = true; - $results['student_details'] = $stuDetails->result(); - } else { - $results['studentList'] = false; - } - } - } else { - - $results['studentList'] = false; - } - return $results; - } + $stuDetails = $this->db->query($subQuery); - // get a student cource list - public function get_student_course_list($studentId, $req) { - // echo $req['localBranchID'];exit(); - $this->db->select('t1.*,t2.UniversityName,t3.CourseName,t3.Specilization1,t3.Specilization2,t4.BatchName'); - $this->db->from('' . STUDENTCOURSE . ' as t1'); - $this->db->join('' . UNIVERSITY . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); - $this->db->join('' . COURSE . ' as t3', 't3.CourseID = t1.CourseID', 'LEFT'); - $this->db->join('' . BATCH . ' as t4', 't4.BatchCode = t1.BatchCode', 'LEFT'); - $this->db->where('t1.BranchID', $req['localBranchID']); - $this->db->where('StudentID', $studentId); - $courseDetails = $this->db->get(); - $checkArr = $courseDetails->result(); - if (count($checkArr) > 0) { - $result['stuCourseDetails'] = true; - $result['course_details'] = $courseDetails->result(); - } else { - $result['stuCourseDetails'] = false; - } - return $result; - } - - // get student course details - public function get_student_course($studentcourseId) { - $this->db->select('*'); - $this->db->from(STUDENTCOURSE); - $this->db->where('ID', $studentcourseId); - $courseDetails = $this->db->get(); - $checkArr = $courseDetails->result(); - if (count($checkArr) > 0) { - $result['stuCourseDetails'] = true; - $result['course_details'] = $courseDetails->result(); - } else { - $result['stuCourseDetails'] = false; - } - return $result; - } + // $stuDetails = $this->db->get(); - // 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; - } + $checkArr = $stuDetails->result(); + if (count($checkArr) > 0) { + $results['studentList'] = true; + $results['student_details'] = $stuDetails->result(); + } + else { + $results['studentList'] = false; + } + } + // if ($loginUserBranchId == 'All') { + // // for getting all branch details + // $staffId = $this->selfGetEmpId($loginUserId); + // $this->db->select('*'); + // $this->db->order_by('CreatedOn', 'DESC'); + // $this->db->from(STAFF); + // // not for SuperAdmin and Student Role code + // $this->db->where_not_in('StaffID', $staffId); + // // $this->db->where('BranchCode', $loginUserBranchId); + // $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'; + // } + // } else { + // $staffId = $this->selfGetEmpId($loginUserId); + // $this->db->select('*'); + // $this->db->order_by('CreatedOn', 'DESC'); + // $this->db->from(STAFF); + // // not for SuperAdmin and Student Role code + // $this->db->where_not_in('StaffID', $staffId); + // $this->db->where('BranchCode', $loginUserBranchId); + // $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'; + // } + // } - //get course, batch for university - public function get_courseBatch_list($univId) { - $this->db->select('C.CourseID, C.CourseName,C.Specilization1,C.Specilization2'); - $this->db->from(COURSE.' as C'); - $this->db->where('UniversityID',$univId); - $this->db->where('IsActive',1); - $courseDetails = $this->db->get(); - if($courseDetails->result()){ - $this->db->select('B.BatchCode, B.BatchName'); - $this->db->from(BATCH.' as B'); - $this->db->where('UniversityID',$univId); - $this->db->where('IsActive',1); - $batchDetails = $this->db->get(); - if( $batchDetails->result()) { - $result['courseStatus'] = true; - $result['course_details'] = $courseDetails->result(); - $result['batch_details'] = $batchDetails->result(); - } else { - $result['courseStatus'] = false; - $result['message'] = "No records found!"; - } - } - else { - $result['courseStatus'] = false; - $result['message'] = "No records found!"; - } - return $result; - } + } + else if ($loginUserType == ADMIN) { - public function get_exist_stu_details($data, $reqArr) { - // echo $data;exit(); - $this->db->select('t0.*'); - $this->db->from('' . STUDENTS . ' as t0'); - $this->db->where('t0.StudentID', $data); - $personalDetails = $this->db->get()->result(); - $this->db->select('t1.*,t2.UniversityName,t3.CourseName,t3.Specilization1,t3.Specilization2,t4.BatchName, t5.BranchName'); - // $this->db->from('' . STUDENTS . ' as t0'); - $this->db->from('' . STUDENTCOURSE . ' as t1'); - $this->db->join('' . UNIVERSITY . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); - $this->db->join('' . COURSE . ' as t3', 't3.CourseID = t1.CourseID', 'LEFT'); - $this->db->join('' . BATCH . ' as t4', 't4.BatchCode = t1.BatchCode', 'LEFT'); - $this->db->join('' . BRANCH . ' as t5', 't5.BranchCode = t1.BranchID', 'LEFT'); - $this->db->where('t1.StudentID', $data); - // $this->db->group_by('t1.StudentID'); - $courseDetails = $this->db->get()->result(); - $result['personalDetails'] = $personalDetails; - $result['courseDetails'] = $courseDetails; - $result['existingStudentDetailsStatus'] = true; - return $result; - } + // list for admin - // check exist - public function check_exist($data, $checkData) - { - if ($checkData == 'studentId') { - // check for student id - // $this->db->select('*'); - // $this->db->from(STAFF); - // $this->db->where('StaffID', $data); - // if ($this->db->get()->first_row()) { - // $result['existEmpId'] = true; - // $result['message'] = "This Employee ID is already exist!"; - // } else { - // $result['existEmpId'] = false; - // } - } else if ($checkData == 'mobileNumber') { - // check for mobile number - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('MobileNumber', $data); - $details = $this->db->get()->result(); - // echo count($details);exit(); - if (count($details) > 0) { - // print_r($details);exit(); - // echo $details[0]->StudentID;exit(); - $datas['studentId'] = $details[0]->StudentID; - $datas['type'] = 'R001'; - $result['details'] = $datas; - $result['existMobile'] = true; - $result['message'] = "This Mobile Number is already exist!"; - } else { - $this->db->select('*'); - $this->db->from(LOGIN); - $this->db->where('MobileNumber', $data); - $details1 = $this->db->get()->result(); - if ( $details1 > 0) { - $datas['studentId'] = $details1[0]->StaffID; - $datas['type'] = $details1[0]->ListCode; - $result['details'] = $datas; - $result['existMobile'] = true; - $result['message'] = "This Mobile Number is already exist!"; - } else { - $result['existMobile'] = false; - } - } - - } else if ($checkData == 'emailId') { - // check for email id - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('EmailID', $data); - if ($this->db->get()->first_row()) { - $result['existEmailId'] = true; - $result['message'] = "This EmailId is already exist!"; - } else { - $result['existEmailId'] = false; - } - } else { - } - return $result; - } + if ($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') { - // add student course - public function add_student_course( $studID, $Arr) { - if($this->getBranchActiveStatusforStuAdd($Arr['BranchID'])['branch_active_status'] === '1'){ - $this->db->select('*'); - $this->db->from(STUDENTCOURSE); - $this->db->where('StudentID', $studID); - $this->db->where('CourseID', $Arr['CourseID']); + // print_r($getSearchData);exit(); - if($this->db->get()->first_row()) { - $result['addStuCourseStatus'] = false; - $result['message'] = "This Student Already exist for this course"; - } else { - $this->db->insert(STUDENTCOURSE, $Arr); - if ($this->db->affected_rows() == '1') { - $result['addStuCourseStatus'] = true; - $result['message'] = "Successfully Student Course Details Updated"; - } else { - $result['addStuCourseStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } - }else{ - $result['addStuCourseStatus'] = false; - $result['message'] = "New Cource Cannot able to create for In-Active Branch"; - } - return $result; - } + $this->db->select('*'); + $this->db->from('' . STUDENTS . ' as t1'); - // add student - public function add_student($Arr, $courseArr, $imagename, $imageSource, $size) - { - // echo $this->getBranchActiveStatusforStuAdd($courseArr['BranchID'])['branch_active_status'];exit(); - if($this->getBranchActiveStatusforStuAdd($courseArr['BranchID'])['branch_active_status'] === '1'){ - // echo 'in';exit(); - if( $imageSource == '') { // add employee without image - $imageNameDb = 'default.jpeg'; - $Arr['ProfilePicPath'] = "student/".$imageNameDb; - // print_r($Arr); - // print_r($courseArr);exit(); - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('MobileNumber', $Arr['MobileNumber']); - if($this->db->get()->first_row()) { - $result['addStudentStatus'] = false; - $result['message'] = "This Student Already exist"; - } else { - $this->db->insert(STUDENTS, $Arr); - $insert_id = $this->db->insert_id('StudentID'); - $courseArr['StudentID'] = $insert_id; - if ($this->db->affected_rows() == '1') { - $this->db->insert(STUDENTCOURSE, $courseArr); - if ($this->db->affected_rows() == '1') { - $loginArr['StaffID'] = $courseArr['StudentID']; - $loginArr['ListCode'] = STUDENT; - $loginArr['MobileNumber'] = $Arr['MobileNumber']; - $loginArr['EmailId'] = $Arr['EmailID']; - $loginArr['IsActive'] = $Arr['IsActive']; - $loginArr['CreatedBy'] = $Arr['CreatedBy']; - $loginArr['CreatedOn'] = $Arr['CreatedOn']; - $loginArr['Password'] = ENCR_PASSWORD; - $this->db->insert(LOGIN, $loginArr); - if ($this->db->affected_rows() == '1') { - $result['addStudentStatus'] = true; - $result['message'] = "Successfully student details added"; - } else { - $result['addStudentStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } else { - $result['addStudentStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } else { - $result['addStudentStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } - } else { - $target = "../images/student/"; - $getUploadStatus = $this->upload_image($imageSource, $size, $target); - $imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg'; - $Arr['ProfilePicPath'] = "student/".$imageNameDb; - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('MobileNumber', $Arr['MobileNumber']); - if($this->db->get()->first_row()) { - $result['addStudentStatus'] = false; - $result['message'] = "This Student Already exist"; - } else { - $this->db->insert(STUDENTS, $Arr); - $insert_id = $this->db->insert_id('StudentID'); - $courseArr['StudentID'] = $insert_id; - if ($this->db->affected_rows() == '1') { - $this->db->insert(STUDENTCOURSE, $courseArr); - if ($this->db->affected_rows() == '1') { - $loginArr['StaffID'] = $courseArr['StudentID']; - $loginArr['ListCode'] = STUDENT; - $loginArr['MobileNumber'] = $Arr['MobileNumber']; - $loginArr['EmailId'] = $Arr['EmailID']; - $loginArr['IsActive'] = $Arr['IsActive']; - $loginArr['CreatedBy'] = $Arr['CreatedBy']; - $loginArr['CreatedOn'] = $Arr['CreatedOn']; - $loginArr['Password'] = ENCR_PASSWORD; - $this->db->insert(LOGIN, $loginArr); - if ($this->db->affected_rows() == '1') { - $result['addStudentStatus'] = true; - $result['message'] = "Successfully student details added"; - } else { - $result['addStudentStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } else { - $result['addStudentStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } else { - $result['addStudentStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } - } - }else { - $result['addStudentStatus'] = false; - $result['message'] = "New Student cannot able to create for In-Active Branch"; - - } - return $result; - } + // $this->db->where('BranchCode', $loginUserBranchId); + // $this->db->group_by('user_id'); - // check existing data while update - public function check_update_exist($exceptId, $datas, $checkFor) - { - if ($checkFor == 'mobileNumber') { - // check update for mobile number - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('MobileNumber', $datas); - $this->db->where_not_in('StudentID', $exceptId); - if ($this->db->get()->first_row()) { - $result['existMobile'] = true; - $this->db->select('MobileNumber'); - $this->db->from(STUDENTS); - $this->db->where('StudentID', $exceptId); - $result['resetValue'] = $this->db->get()->first_row(); - $result['message'] = "This Mobile Number is already exist!"; - } else { - // check login - $this->db->select('*'); - $this->db->from(LOGIN); - $this->db->where('MobileNumber', $datas); - $this->db->where_not_in('StaffID', $exceptId); - if($this->db->get()->first_row()) { - $result['existMobile'] = true; - $this->db->select('MobileNumber'); - $this->db->from(STUDENTS); - $this->db->where('StudentID', $exceptId); - $result['resetValue'] = $this->db->get()->first_row(); - $result['message'] = "This Mobile Number is already exist!"; - } else { - $result['existMobile'] = false; - } - } - } else if ($checkFor == 'emailId') { - // check update for email - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('EmailID', $datas); - $this->db->where_not_in('StudentID', $exceptId); - if ($this->db->get()->first_row()) { - $result['existEmailId'] = true; - $this->db->select('EmailID'); - $this->db->from(STUDENTS); - $this->db->where('StudentID', $exceptId); - $result['resetValue'] = $this->db->get()->first_row(); - $result['message'] = "This EmailId is already exist!"; - } else { - $result['existEmailId'] = false; - } - } else { - } - return $result; - } + $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); + $this->db->where('t2.BranchID', $loginUserBranchId); + $this->db->group_by('t2.StudentID'); + $this->db->order_by('t2.CreatedOn', 'DESC'); + $stuDetails = $this->db->get(); + $checkArr = $stuDetails->result(); + if (count($checkArr) > 0) { + $results['studentList'] = true; + $results['student_details'] = $stuDetails->result(); + } + else { + $results['studentList'] = false; + } + } + else { + $University = $getSearchData['University']; + $Course = $getSearchData['Course']; - // update student personal details - public function update_student($empArr, $updateFor, $imagename, $imageSource, $size) - { - if( $imageSource == '') { - // print_r($empArr); - // print_r($updateFor); - // exit(); - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('MobileNumber', $empArr['MobileNumber']); - $this->db->where_not_in('StudentID', $updateFor); - if ($this->db->get()->first_row()) { - $result['updateStuStatus'] = false; - $result['message'] = "This Mobile Number Already Exist"; - } else { - $this->db->select('*'); - $this->db->from(LOGIN); - $this->db->where('MobileNumber', $empArr['MobileNumber']); - $this->db->where_not_in('StaffID', $updateFor); - if($this->db->get()->first_row()) { - $result['updateStuStatus'] = false; - $result['message'] = "This Mobile Number Already Exist"; - } else { - $this->db->where('StudentID', $updateFor); - $this->db->update(STUDENTS, $empArr); - if ($this->db->affected_rows() == '1') { - $mobile = $empArr['MobileNumber']; - $email = $empArr['EmailID']; - $active = $empArr['IsActive']; - $updatedBy = $empArr['UpdatedBy']; - $updatedOn = $empArr['UpdatedOn']; - $sql = "UPDATE ".LOGIN." SET MobileNumber='$mobile', EmailId='$email', IsActive='$active', UpdatedBy='$updatedBy', UpdatedOn='$updatedOn' WHERE StaffID='$updateFor'"; - if($this->db->query($sql) == '1'){ - $result['updateStuStatus'] = true; - $result['message'] = "Successfully student details Updated"; - } else { - $result['updateStuStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } else { - $result['updateStuStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } - } - } else { - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->where('MobileNumber', $empArr['MobileNumber']); - $this->db->where_not_in('StudentID', $updateFor); - if ($this->db->get()->first_row()) { - $result['updateStuStatus'] = false; - $result['message'] = "This Mobile Number Already Exist"; - } else { - $this->db->select('*'); - $this->db->from(LOGIN); - $this->db->where('MobileNumber', $empArr['MobileNumber']); - $this->db->where_not_in('StaffID', $updateFor); - if($this->db->get()->first_row()) { - $result['updateStuStatus'] = false; - $result['message'] = "This Mobile Number Already Exist"; - } else { - $target = "../images/student/"; - $getUploadStatus = $this->upload_image($imageSource, $size, $target); - $imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg'; - $empArr['ProfilePicPath'] = "student/".$imageNameDb; - $this->db->select('ProfilePicPath'); - $this->db->from(STUDENTS); - $this->db->where('StudentID', $updateFor); - $roleDetails = $this->db->get()->first_row(); - // echo $roleDetails->ProfilePicPath; - // exit(); - if( $roleDetails->ProfilePicPath != '' && $roleDetails->ProfilePicPath != 'student/default.jpeg'){ - unlink('../images/'.$roleDetails->ProfilePicPath); - } else { - } - $this->db->where('StudentID', $updateFor); - $this->db->update(STUDENTS, $empArr); - if ($this->db->affected_rows() == '1') { - $mobile = $empArr['MobileNumber']; - $email = $empArr['EmailID']; - $active = $empArr['IsActive']; - $updatedBy = $empArr['UpdatedBy']; - $updatedOn = $empArr['UpdatedOn']; - $sql = "UPDATE ".LOGIN." SET MobileNumber='$mobile', EmailId='$email', IsActive='$active', UpdatedBy='$updatedBy', UpdatedOn='$updatedOn' WHERE StaffID='$updateFor'"; - if($this->db->query($sql) == '1'){ - $result['updateStuStatus'] = true; - $result['message'] = "Successfully student details Updated"; - } else { - $result['updateStuStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } else { - $result['updateStuStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } - } - } - return $result; - } + // $Batch = $getSearchData['Batch']; + $Batch = ''; + $StuStatus = $getSearchData['Status']; + if ($StuStatus == '') { + if ($University != '' && $Course == '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + else if ($University != '' && $Course != '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + } + else { + if ($University != '' && $Course == '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + AND S.IsActive = '$StuStatus' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + else if ($University != '' && $Course != '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + AND S.IsActive = '$StuStatus' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + } - public function update_student_course($reqArr, $id) { - // print_r($id); - // print_r($reqArr); - // exit(); - $this->db->select('*'); - $this->db->from(STUDENTCOURSE); - $this->db->where('StudentID', $reqArr['StudentID']); - $this->db->where('CourseID', $reqArr['CourseID']); - $this->db->where_not_in('ID', $id); - if($this->db->get()->first_row()) { - $result['updateStuCourseStatus'] = false; - $result['message'] = "This Student Already exist for this course"; - } else { - $this->db->where('ID', $id); - $this->db->update(STUDENTCOURSE, $reqArr); - if ($this->db->affected_rows() == '1') { - $result['updateStuCourseStatus'] = true; - $result['message'] = "Successfully Student Course Details Updated"; - } else { - $result['updateStuCourseStatus'] = false; - $result['message'] = "Something went wrong.please try again"; - } - } - return $result; - } + $stuDetails = $this->db->query($subQuery); - // image upload in taget path - public function upload_image( $imageSource, $size, $target ) { - $key2 = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, 12); - $new_regNo = "Dri_" . $key2 . "." . 'jpeg'; - $targetPlace = $target . $new_regNo; - // echo $targetPlace;exit(); - if(!move_uploaded_file($imageSource , $targetPlace)) - { - return $result['status'] = false; - } else { - $result['status'] = true; - $result['imageName'] = $new_regNo; - return $result; - } - } + // $stuDetails = $this->db->get(); -} \ No newline at end of file + $checkArr = $stuDetails->result(); + if (count($checkArr) > 0) { + $results['studentList'] = true; + $results['student_details'] = $stuDetails->result(); + } + else { + $results['studentList'] = false; + } + } + } + else if ($loginUserType == EMPLOYEE) { + + // list for staff + // list for admin + + if ($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') { + + // print_r($getSearchData);exit(); + + $this->db->select('t1.*'); + $this->db->from('' . STUDENTS . ' as t1'); + $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); + $this->db->where('t2.BranchID', $loginUserBranchId); + $this->db->group_by('t2.StudentID'); + + // $this->db->from(STUDENTS); + + $this->db->order_by('t2.CreatedOn', 'DESC'); + $stuDetails = $this->db->get(); + $checkArr = $stuDetails->result(); + if (count($checkArr) > 0) { + $results['studentList'] = true; + $results['student_details'] = $stuDetails->result(); + } + else { + $results['studentList'] = false; + } + } + else { + + // print_r($getSearchData);exit(); + // $this->db->select('t1.*'); + // // $this->db->from(STUDENTS); + // $this->db->from('' . STUDENTS . ' as t1'); + // $this->db->order_by('t1.CreatedOn', 'DESC'); + // $this->db->where('t1.BranchCode', $loginUserBranchId); + // $this->db->from('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); + // $this->db->where('t2.UniversityID', $getSearchData["University"]); + // $this->db->where('t2.CourseID', $getSearchData["Course"]); + + $University = $getSearchData['University']; + $Course = $getSearchData['Course']; + + // $Batch = $getSearchData['Batch']; + + $Batch = ''; + $StuStatus = $getSearchData['Status']; + if ($StuStatus == '') { + if ($University != '' && $Course == '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + else if ($University != '' && $Course != '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } // ### query branch code changed from student branch code to student course branch code + + // AND S.BranchCode = '$loginUserBranchId' -> SC.BranchCode = '$loginUserBranchId' + // (SC.UniversityID = '$University' + // OR (SC.CourseID = '$Course' AND SC.UniversityID = '$University')) + + } + else { + if ($University != '' && $Course == '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + AND S.IsActive = '$StuStatus' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + else if ($University != '' && $Course != '') { + $subQuery = "SELECT S.* + FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID + LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON + SC.CourseID = C.CourseID + WHERE + SC.CourseID = '$Course' AND SC.UniversityID = '$University' + AND SC.BranchID = '$loginUserBranchId' + AND S.IsActive = '$StuStatus' + GROUP BY SC.StudentID + ORDER BY S.CreatedOn"; + } + + // ### query branch code changed from student branch code to student course branch code + // AND S.BranchCode = '$loginUserBranchId' -> SC.BranchCode = '$loginUserBranchId' + + } + + $stuDetails = $this->db->query($subQuery); + + // $stuDetails = $this->db->get(); + + $checkArr = $stuDetails->result(); + if (count($checkArr) > 0) { + $results['studentList'] = true; + $results['student_details'] = $stuDetails->result(); + } + else { + $results['studentList'] = false; + } + } + } + else { + $results['studentList'] = false; + } + + return $results; + } + + // get a student cource list + + public function get_student_course_list($studentId, $req) + { + + // echo $req['localBranchID'];exit(); + + $this->db->select('t1.*,t2.UniversityName,t3.CourseName,t3.CourseCode,t3.Specilization1,t3.Specilization2,t4.BatchName'); + $this->db->from('' . STUDENTCOURSE . ' as t1'); + $this->db->join('' . UNIVERSITY . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); + $this->db->join('' . COURSE . ' as t3', 't3.CourseID = t1.CourseID', 'LEFT'); + $this->db->join('' . BATCH . ' as t4', 't4.BatchCode = t1.BatchCode', 'LEFT'); + $this->db->where('t1.BranchID', $req['localBranchID']); + $this->db->where('StudentID', $studentId); + $courseDetails = $this->db->get(); + $checkArr = $courseDetails->result(); + if (count($checkArr) > 0) { + $result['stuCourseDetails'] = true; + $result['course_details'] = $courseDetails->result(); + } + else { + $result['stuCourseDetails'] = false; + } + + return $result; + } + + // get student course details + + public function get_student_course($studentcourseId) + { + $this->db->select('*'); + $this->db->from(STUDENTCOURSE); + $this->db->where('ID', $studentcourseId); + $courseDetails = $this->db->get(); + $checkArr = $courseDetails->result(); + if (count($checkArr) > 0) { + $result['stuCourseDetails'] = true; + $result['course_details'] = $courseDetails->result(); + } + else { + $result['stuCourseDetails'] = false; + } + + 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, batch for university + + public function get_courseBatch_list($univId) + { + $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); + $courseDetails = $this->db->get(); + if ($courseDetails->result()) { + $this->db->select('B.BatchCode, B.BatchName'); + $this->db->from(BATCH . ' as B'); + $this->db->where('UniversityID', $univId); + $this->db->where('IsActive', 1); + $batchDetails = $this->db->get(); + if ($batchDetails->result()) { + $result['courseStatus'] = true; + $result['course_details'] = $courseDetails->result(); + $result['batch_details'] = $batchDetails->result(); + } + else { + $result['courseStatus'] = false; + $result['message'] = "No records found!"; + } + } + else { + $result['courseStatus'] = false; + $result['message'] = "No records found!"; + } + + return $result; + } + + // Get exist student details + + public function get_exist_stu_details($data, $reqArr) + { + + // echo $data;exit(); + + $this->db->select('t0.*'); + $this->db->from('' . STUDENTS . ' as t0'); + $this->db->where('t0.StudentID', $data); + $personalDetails = $this->db->get()->result(); + $this->db->select('t1.*,t2.UniversityName,t3.CourseName,t3.Specilization1,t3.Specilization2,t4.BatchName, t5.BranchName'); + + // $this->db->from('' . STUDENTS . ' as t0'); + + $this->db->from('' . STUDENTCOURSE . ' as t1'); + $this->db->join('' . UNIVERSITY . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); + $this->db->join('' . COURSE . ' as t3', 't3.CourseID = t1.CourseID', 'LEFT'); + $this->db->join('' . BATCH . ' as t4', 't4.BatchCode = t1.BatchCode', 'LEFT'); + $this->db->join('' . BRANCH . ' as t5', 't5.BranchCode = t1.BranchID', 'LEFT'); + $this->db->where('t1.StudentID', $data); + + // $this->db->group_by('t1.StudentID'); + + $courseDetails = $this->db->get()->result(); + $result['personalDetails'] = $personalDetails; + $result['courseDetails'] = $courseDetails; + $result['existingStudentDetailsStatus'] = true; + return $result; + } + + // check exist + + public function check_exist($data, $checkData) + { + if ($checkData == 'studentId') { + + // check for student id + // $this->db->select('*'); + // $this->db->from(STAFF); + // $this->db->where('StaffID', $data); + // if ($this->db->get()->first_row()) { + // $result['existEmpId'] = true; + // $result['message'] = "This Employee ID is already exist!"; + // } else { + // $result['existEmpId'] = false; + // } + + } + else if ($checkData == 'mobileNumber') { + + // check for mobile number + + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('MobileNumber', $data); + $details = $this->db->get()->result(); + + // echo count($details);exit(); + + if (count($details) > 0) { + + // print_r($details);exit(); + // echo $details[0]->StudentID;exit(); + + $datas['studentId'] = $details[0]->StudentID; + $datas['type'] = 'R001'; + $result['details'] = $datas; + $result['existMobile'] = true; + $result['message'] = "This Mobile Number is already exist!"; + } + else { + $this->db->select('*'); + $this->db->from(LOGIN); + $this->db->where('MobileNumber', $data); + $details1 = $this->db->get()->result(); + if ($details1 > 0) { + $datas['studentId'] = $details1[0]->StaffID; + $datas['type'] = $details1[0]->ListCode; + $result['details'] = $datas; + $result['existMobile'] = true; + $result['message'] = "This Mobile Number is already exist!"; + } + else { + $result['existMobile'] = false; + } + } + } + else if ($checkData == 'emailId') { + + // check for email id + + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('EmailID', $data); + if ($this->db->get()->first_row()) { + $result['existEmailId'] = true; + $result['message'] = "This EmailId is already exist!"; + } + else { + $result['existEmailId'] = false; + } + } + else { + } + + return $result; + } + + // add student course + + public function add_student_course($studID, $Arr) + { + if ($this->getBranchActiveStatusforStuAdd($Arr['BranchID']) ['branch_active_status'] === '1') { + $this->db->select('*'); + $this->db->from(STUDENTCOURSE); + $this->db->where('StudentID', $studID); + $this->db->where('CourseID', $Arr['CourseID']); + if ($this->db->get()->first_row()) { + $result['addStuCourseStatus'] = false; + $result['message'] = "This Student Already exist for this course"; + } + else { + $this->db->insert(STUDENTCOURSE, $Arr); + if ($this->db->affected_rows() == '1') { + $result['addStuCourseStatus'] = true; + $result['message'] = "Successfully Student Course Details Updated"; + } + else { + $result['addStuCourseStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + } + else { + $result['addStuCourseStatus'] = false; + $result['message'] = "New Cource Cannot able to create for In-Active Branch"; + } + + return $result; + } + + // add student + + public function add_student($Arr, $courseArr, $imagename, $imageSource, $size) + { + + // echo $this->getBranchActiveStatusforStuAdd($courseArr['BranchID'])['branch_active_status'];exit(); + + if ($this->getBranchActiveStatusforStuAdd($courseArr['BranchID']) ['branch_active_status'] === '1') { + + // echo 'in';exit(); + + if ($imageSource == '') { // add employee without image + $imageNameDb = 'default.jpeg'; + $Arr['ProfilePicPath'] = "student/" . $imageNameDb; + + // print_r($Arr); + // print_r($courseArr);exit(); + + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('MobileNumber', $Arr['MobileNumber']); + if ($this->db->get()->first_row()) { + $result['addStudentStatus'] = false; + $result['message'] = "This Student Already exist"; + } + else { + $this->db->insert(STUDENTS, $Arr); + $insert_id = $this->db->insert_id('StudentID'); + $courseArr['StudentID'] = $insert_id; + if ($this->db->affected_rows() == '1') { + $this->db->insert(STUDENTCOURSE, $courseArr); + if ($this->db->affected_rows() == '1') { + $loginArr['StaffID'] = $courseArr['StudentID']; + $loginArr['ListCode'] = STUDENT; + $loginArr['MobileNumber'] = $Arr['MobileNumber']; + $loginArr['EmailId'] = $Arr['EmailID']; + $loginArr['IsActive'] = $Arr['IsActive']; + $loginArr['CreatedBy'] = $Arr['CreatedBy']; + $loginArr['CreatedOn'] = $Arr['CreatedOn']; + $loginArr['Password'] = ENCR_PASSWORD; + $this->db->insert(LOGIN, $loginArr); + if ($this->db->affected_rows() == '1') { + $result['addStudentStatus'] = true; + $result['message'] = "Successfully student details added"; + } + else { + $result['addStudentStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + else { + $result['addStudentStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + else { + $result['addStudentStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + } + else { + $target = "../images/student/"; + $getUploadStatus = $this->upload_image($imageSource, $size, $target); + $imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg'; + $Arr['ProfilePicPath'] = "student/" . $imageNameDb; + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('MobileNumber', $Arr['MobileNumber']); + if ($this->db->get()->first_row()) { + $result['addStudentStatus'] = false; + $result['message'] = "This Student Already exist"; + } + else { + $this->db->insert(STUDENTS, $Arr); + $insert_id = $this->db->insert_id('StudentID'); + $courseArr['StudentID'] = $insert_id; + if ($this->db->affected_rows() == '1') { + $this->db->insert(STUDENTCOURSE, $courseArr); + if ($this->db->affected_rows() == '1') { + $loginArr['StaffID'] = $courseArr['StudentID']; + $loginArr['ListCode'] = STUDENT; + $loginArr['MobileNumber'] = $Arr['MobileNumber']; + $loginArr['EmailId'] = $Arr['EmailID']; + $loginArr['IsActive'] = $Arr['IsActive']; + $loginArr['CreatedBy'] = $Arr['CreatedBy']; + $loginArr['CreatedOn'] = $Arr['CreatedOn']; + $loginArr['Password'] = ENCR_PASSWORD; + $this->db->insert(LOGIN, $loginArr); + if ($this->db->affected_rows() == '1') { + $result['addStudentStatus'] = true; + $result['message'] = "Successfully student details added"; + } + else { + $result['addStudentStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + else { + $result['addStudentStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + else { + $result['addStudentStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + } + } + else { + $result['addStudentStatus'] = false; + $result['message'] = "New Student cannot able to create for In-Active Branch"; + } + + return $result; + } + + // check existing data while update + + public function check_update_exist($exceptId, $datas, $checkFor) + { + if ($checkFor == 'mobileNumber') { + + // check update for mobile number + + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('MobileNumber', $datas); + $this->db->where_not_in('StudentID', $exceptId); + if ($this->db->get()->first_row()) { + $result['existMobile'] = true; + $this->db->select('MobileNumber'); + $this->db->from(STUDENTS); + $this->db->where('StudentID', $exceptId); + $result['resetValue'] = $this->db->get()->first_row(); + $result['message'] = "This Mobile Number is already exist!"; + } + else { + + // check login + + $this->db->select('*'); + $this->db->from(LOGIN); + $this->db->where('MobileNumber', $datas); + $this->db->where_not_in('StaffID', $exceptId); + if ($this->db->get()->first_row()) { + $result['existMobile'] = true; + $this->db->select('MobileNumber'); + $this->db->from(STUDENTS); + $this->db->where('StudentID', $exceptId); + $result['resetValue'] = $this->db->get()->first_row(); + $result['message'] = "This Mobile Number is already exist!"; + } + else { + $result['existMobile'] = false; + } + } + } + else if ($checkFor == 'emailId') { + + // check update for email + + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('EmailID', $datas); + $this->db->where_not_in('StudentID', $exceptId); + if ($this->db->get()->first_row()) { + $result['existEmailId'] = true; + $this->db->select('EmailID'); + $this->db->from(STUDENTS); + $this->db->where('StudentID', $exceptId); + $result['resetValue'] = $this->db->get()->first_row(); + $result['message'] = "This EmailId is already exist!"; + } + else { + $result['existEmailId'] = false; + } + } + else { + } + + return $result; + } + + // get the student entrollment doc details + + public function getStudent_doc_details($stuId) + { + $this->db->select('*'); + $this->db->order_by('CreatedOn', 'DESC'); + $this->db->from('T_StudentDocumentsDetails'); + $this->db->where('StudentID', $stuId); + $getDocDetails = $this->db->get(); + $documentDetails = $getDocDetails->result(); + if (count($documentDetails) > 0) { + $results['docListStatus'] = true; + $results['student_doc_details'] = $documentDetails; + } + else { + $results['docListStatus'] = false; + $results['message'] = 'No record found'; + } + + return $results; + } + + public function deleteStu_doc_details($stuId, $docId) + { + $sql = "DELETE FROM T_StudentDocumentsDetails WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'"; + if ($this->db->query($sql)) { + $results['deleteStatus'] = true; + } + else { + $results['deleteStatus'] = false; + $results['message'] = 'Something went wrong.please try again'; + } + } + + // add student entroll doc details + + public function student_entroll_doc_add($req, $doc_status) + { + + // if( $doc_status == "true") { + + $target = "../images/documents/"; + $getUploadStatus = $this->upload_doc_student($req['doc_source'], $req['doc_name'], $req['doc_size'], $target, $req['student_id']); + if ($imageNameDb = $getUploadStatus['status'] == true) { + $imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg'; + + // echo $imageNameDb;exit(); + + $strPath = "documents/" . $imageNameDb; + $stuId = $req['student_id']; + $docTypeName = $req['document_type_name']; + $docStatus = $req['document_status']; + $docComments = $req['document_comments']; + $docCreatedBy = $req['CreatedBy']; + $docCreatadOn = $req['CreatedOn']; + + // echo $docCreatadOn;exit(); + // ".STAFF_BRANCH." + + $sql1 = "INSERT INTO T_StudentDocumentsDetails (StudentID, DocumentName, Status, DocumentStorePath, Comments, CreatedBy, CreatedOn) + VALUES ('$stuId', '$docTypeName', '$docStatus', '$strPath', '$docComments', '$docCreatedBy', '$docCreatadOn')"; + + // update branch to staff_branch table + + if ($this->db->query($sql1) == '1') { + $result['stuDocUpdateStatus'] = true; + $result['message'] = "Successfully Student document details updated"; + } + else { + $result['stuDocUpdateStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + else { + $result['stuDocUpdateStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + + return $result; + } + + // student document upload target path + + public function upload_doc_student($imageSource, $doc_name, $size, $target, $stu_id) + { + $key2 = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ') , 0, 12); + $new_regNo = "Dri_" . $key2 . "_" . $stu_id . "_" . $doc_name; + $targetPlace = $target . $new_regNo; + + // echo $targetPlace;exit(); + + if (!move_uploaded_file($imageSource, $targetPlace)) { + return $result['status'] = false; + } + else { + $result['status'] = true; + $result['imageName'] = $new_regNo; + return $result; + } + } + + // update student personal details + + public function update_student($empArr, $updateFor, $imagename, $imageSource, $size) + { + if ($imageSource == '') { + + // print_r($empArr); + // print_r($updateFor); + // exit(); + + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('MobileNumber', $empArr['MobileNumber']); + $this->db->where_not_in('StudentID', $updateFor); + if ($this->db->get()->first_row()) { + $result['updateStuStatus'] = false; + $result['message'] = "This Mobile Number Already Exist"; + } + else { + $this->db->select('*'); + $this->db->from(LOGIN); + $this->db->where('MobileNumber', $empArr['MobileNumber']); + $this->db->where_not_in('StaffID', $updateFor); + if ($this->db->get()->first_row()) { + $result['updateStuStatus'] = false; + $result['message'] = "This Mobile Number Already Exist"; + } + else { + $this->db->where('StudentID', $updateFor); + $this->db->update(STUDENTS, $empArr); + if ($this->db->affected_rows() == '1') { + $mobile = $empArr['MobileNumber']; + $email = $empArr['EmailID']; + $active = $empArr['IsActive']; + $updatedBy = $empArr['UpdatedBy']; + $updatedOn = $empArr['UpdatedOn']; + $sql = "UPDATE " . LOGIN . " SET MobileNumber='$mobile', EmailId='$email', IsActive='$active', UpdatedBy='$updatedBy', UpdatedOn='$updatedOn' WHERE StaffID='$updateFor'"; + if ($this->db->query($sql) == '1') { + $result['updateStuStatus'] = true; + $result['message'] = "Successfully student details Updated"; + } + else { + $result['updateStuStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + else { + $result['updateStuStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + } + } + else { + $this->db->select('*'); + $this->db->from(STUDENTS); + $this->db->where('MobileNumber', $empArr['MobileNumber']); + $this->db->where_not_in('StudentID', $updateFor); + if ($this->db->get()->first_row()) { + $result['updateStuStatus'] = false; + $result['message'] = "This Mobile Number Already Exist"; + } + else { + $this->db->select('*'); + $this->db->from(LOGIN); + $this->db->where('MobileNumber', $empArr['MobileNumber']); + $this->db->where_not_in('StaffID', $updateFor); + if ($this->db->get()->first_row()) { + $result['updateStuStatus'] = false; + $result['message'] = "This Mobile Number Already Exist"; + } + else { + $target = "../images/student/"; + $getUploadStatus = $this->upload_image($imageSource, $size, $target); + $imageNameDb = $getUploadStatus['status'] == true ? $getUploadStatus['imageName'] : $getUploadStatus['imageName'] = 'default.jpeg'; + $empArr['ProfilePicPath'] = "student/" . $imageNameDb; + $this->db->select('ProfilePicPath'); + $this->db->from(STUDENTS); + $this->db->where('StudentID', $updateFor); + $roleDetails = $this->db->get()->first_row(); + + // echo $roleDetails->ProfilePicPath; + // exit(); + + if ($roleDetails->ProfilePicPath != '' && $roleDetails->ProfilePicPath != 'student/default.jpeg') { + unlink('../images/' . $roleDetails->ProfilePicPath); + } + else { + } + $this->db->where('StudentID', $updateFor); + $this->db->update(STUDENTS, $empArr); + if ($this->db->affected_rows() == '1') { + $mobile = $empArr['MobileNumber']; + $email = $empArr['EmailID']; + $active = $empArr['IsActive']; + $updatedBy = $empArr['UpdatedBy']; + $updatedOn = $empArr['UpdatedOn']; + $sql = "UPDATE " . LOGIN . " SET MobileNumber='$mobile', EmailId='$email', IsActive='$active', UpdatedBy='$updatedBy', UpdatedOn='$updatedOn' WHERE StaffID='$updateFor'"; + if ($this->db->query($sql) == '1') { + $result['updateStuStatus'] = true; + $result['message'] = "Successfully student details Updated"; + } + else { + $result['updateStuStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + else { + $result['updateStuStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + } + } + return $result; + } + + // Update Student Course Details + + public function update_student_course($reqArr, $id) + { + + // print_r($id); + // print_r($reqArr); + // exit(); + + $this->db->select('*'); + $this->db->from(STUDENTCOURSE); + $this->db->where('StudentID', $reqArr['StudentID']); + $this->db->where('CourseID', $reqArr['CourseID']); + $this->db->where_not_in('ID', $id); + if ($this->db->get()->first_row()) { + $result['updateStuCourseStatus'] = false; + $result['message'] = "This Student Already exist for this course"; + } + else { + $this->db->where('ID', $id); + $this->db->update(STUDENTCOURSE, $reqArr); + if ($this->db->affected_rows() == '1') { + $result['updateStuCourseStatus'] = true; + $result['message'] = "Successfully Student Course Details Updated"; + } + else { + $result['updateStuCourseStatus'] = false; + $result['message'] = "Something went wrong.please try again"; + } + } + return $result; + } + + // image upload in taget path + + public function upload_image($imageSource, $size, $target) + { + $key2 = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ') , 0, 12); + $new_regNo = "Dri_" . $key2 . "." . 'jpeg'; + $targetPlace = $target . $new_regNo; + + // echo $targetPlace;exit(); + + if (!move_uploaded_file($imageSource, $targetPlace)) { + return $result['status'] = false; + } + else { + $result['status'] = true; + $result['imageName'] = $new_regNo; + return $result; + } + } +} diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 81477689..0af4ed07 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -58,7 +58,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.inActiveBranchStatus = false; $scope.addStudentView = function () { // check the local branch is active for add a new student for this branch - var checkBranchActiveForStuAdd = { + var checkBranchActiveForStuAdd = { method: 'POST', url: apiPoint.url + 'getBranchActiveStatusforStuAdd/', headers: { @@ -71,11 +71,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $http(checkBranchActiveForStuAdd).then(function (response) { if (response.data) { var checkStatus = response.data.branch_active_status; - if(checkStatus == "0"){ - $scope.inActiveBranchStatus = true; - swal(" ", "Cannot create a new Student for In-Active Branch", "warning"); - }else { - $scope.inActiveBranchStatus = false; + if (checkStatus == "0") { + $scope.inActiveBranchStatus = true; + swal(" ", "Cannot create a new Student for In-Active Branch", "warning"); + } else { + $scope.inActiveBranchStatus = false; } } else { } @@ -128,7 +128,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } } - // get University List + // get University List $scope.universitySearchData = ''; $scope.getUniversitySearchList = function () { var empListreq = { @@ -151,14 +151,14 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }; $scope.searchData = { - "University": "", + "University": "", "Course": "", "Status": "" } -$scope.myUnivSearch = ""; - $scope.getUniveId = function (univ) { - if( univ === ''){ - $scope.myUnivSearch = ""; + $scope.myUnivSearch = ""; + $scope.getUniveId = function (univ) { + if (univ === '') { + $scope.myUnivSearch = ""; $scope.searchData.University = ''; $scope.searchData.Course = ''; $scope.searchData.Batch = ''; @@ -166,8 +166,8 @@ $scope.myUnivSearch = ""; $scope.batchData = name.Batch; $scope.OpenWindowStatus = false; $scope.getStudentList(); - } else { - let name = JSON.parse(univ); + } else { + let name = JSON.parse(univ); $scope.searchData.University = name.UniversityID; $scope.searchData.Course = ''; $scope.searchData.Batch = ''; @@ -175,9 +175,9 @@ $scope.myUnivSearch = ""; $scope.batchData = name.Batch; $scope.OpenWindowStatus = false; $scope.getStudentList(); - } - - }; + } + + }; $scope.getValueChange = function () { @@ -186,9 +186,9 @@ $scope.myUnivSearch = ""; // "Course": "", // "Status": "" // } - $scope.getStudentList(); + $scope.getStudentList(); } -$scope.studentListLength = 0; + $scope.studentListLength = 0; $scope.getStudentList = function () { $scope.loader = true; var empListreq = { @@ -199,7 +199,7 @@ $scope.studentListLength = 0; }, data: { data: localDetails, - search: $scope.searchData + search: $scope.searchData } }; $http(empListreq).then(function (response) { @@ -220,7 +220,7 @@ $scope.studentListLength = 0; $scope.setEditId = function (id) { $scope.editId = id; $scope.editCourseId = -1; - $scope.studentViewPage=-1; + $scope.studentViewPage = -1; } $scope.setEditCourseId = function (id) { @@ -300,7 +300,7 @@ $scope.studentListLength = 0; }; $http(req).then(function (response) { if (response.data.addStuCourseStatus == true) { - swal(" ","Student course added successfully.", "success"); + swal(" ", "Student course added successfully.", "success"); $scope.getStudentCourseList($scope.currentStudentId); } else { swal(" ", response.data.message, "error"); @@ -518,27 +518,27 @@ $scope.studentListLength = 0; }; $http(checkReq).then(function (response) { if (response.data.existMobile == true) { - if(response.data.details.type === 'R001'){ + if (response.data.details.type === 'R001') { // swal("Warning!", response.data.message, "warning"); $scope.myModel.primaryPhone = ''; // student registration find student previously exist // $scope.existingStudentView = true; // $scope.existingStudentId = response.data.details.studentId; - SweetAlert.swal({ - title: "Warning!", - text: "Student Exsit with this same Number." + "\n Do you want to Enroll New Cource!", - type: "warning", - showCancelButton: true, - confirmButtonColor: "#007aff", - confirmButtonText: "Yes!" - }, function (res) { - if(res === true){ - $scope.existingStudentView = true; - $scope.existingStudentId = response.data.details.studentId; - } - }); + SweetAlert.swal({ + title: "Warning!", + text: "Student exist with this same number." + "\n Do you want to enroll new course!", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#007aff", + confirmButtonText: "Yes!" + }, function (res) { + if (res === true) { + $scope.existingStudentView = true; + $scope.existingStudentId = response.data.details.studentId; + } + }); - }else if (response.data.details.type === 'R002' || response.data.details.type === 'R003'){ + } else if (response.data.details.type === 'R002' || response.data.details.type === 'R003') { swal("Warning!", response.data.message, "warning"); $scope.myModel.primaryPhone = ''; } else { @@ -551,11 +551,11 @@ $scope.studentListLength = 0; } $scope.stuExistingDetailsShowLoading = false; - - $scope.getExistStudentDetails = function() { - // alert($scope.existingStudentId); - $scope.stuExistingDetailsShowLoading = true; - var checkExisReq = { + + $scope.getExistStudentDetails = function () { + // alert($scope.existingStudentId); + $scope.stuExistingDetailsShowLoading = true; + var checkExisReq = { method: 'POST', url: apiPoint.url + 'getExistingStudentDetails/', headers: { @@ -577,13 +577,13 @@ $scope.studentListLength = 0; }); } - $scope.cancelExisStudentView = function() { - $scope.existingStudentView = false; + $scope.cancelExisStudentView = function () { + $scope.existingStudentView = false; } // add student course for existing student - $scope.addCourseExistingStudent= { + $scope.addCourseExistingStudent = { submit: function (form, myModelCourse, p) { var firstError = null; @@ -621,25 +621,25 @@ $scope.studentListLength = 0; }; $http(req).then(function (response) { if (response.data.addStuCourseStatus == true) { - swal(" ","Student course added successfully. ", "success"); + swal(" ", "Student course added successfully. ", "success"); $state.go($state.current, {}, { reload: true }); // $scope.getStudentCourseList($scope.currentStudentId); } else { swal(" ", response.data.message, "error"); // $scope.getStudentCourseList($scope.currentStudentId); - $scope.myModelCourse.dateofjoining = ''; + $scope.myModelCourse.dateofjoining = ''; } }); } }, - cancel: function() { - $scope.myModelCourse = { - 'university': '', - 'course': '', - 'batch': '', - 'dateofjoining': '', - 'enrollmentid': '' - }; + cancel: function () { + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; } } @@ -717,7 +717,7 @@ $scope.studentListLength = 0; // add student $scope.studentFORM = { submit: function (form, myModel, myModelCourseAdd) { - + var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -794,36 +794,36 @@ $scope.studentListLength = 0; reset: function (form) { // $scope.myModel = angular.copy($scope.master); form.$setPristine(true); - $scope.myModel = { - 'primaryPhone': '', - 'firstname': '', - 'lastname': '', - 'fathername': '', - 'mothername': '', - 'emailId': '', - 'secondaryPhone': '', - 'dateofbirth': '', - 'gender': '', - 'aadharNumber': '', - 'otherId': '', - 'otherIdDetails': '', - 'address1': '', - 'address2': '', - 'caste': '', - 'category': '', - 'religion': '', - 'nationality': '', - 'prequalification': '', - 'occupation': '', - 'designation': '', - 'companyname': '', - 'referredby': '', - 'referredmobilenumber': '', - 'switchsetting': true, - 'DeactiveComments': '', - 'Comments': '' - }; - $scope.myModelCourseAdd = { + $scope.myModel = { + 'primaryPhone': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'caste': '', + 'category': '', + 'religion': '', + 'nationality': '', + 'prequalification': '', + 'occupation': '', + 'designation': '', + 'companyname': '', + 'referredby': '', + 'referredmobilenumber': '', + 'switchsetting': true, + 'DeactiveComments': '', + 'Comments': '' + }; + $scope.myModelCourseAdd = { 'university': '', 'course': '', 'batch': '', @@ -890,6 +890,141 @@ $scope.studentListLength = 0; } + // start : entrollment document upload ============================= + + $scope.studentDocumentsList = ''; + // get Student Document Details + $scope.getStuEntrollDocDetails = function (stuId) { + $scope.studentDocumentsList = ''; + var getStudentDocDetails = { + method: 'POST', + url: apiPoint.url + 'getListofStuDocDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + exceptId: stuId, + localData: localDetail + } + }; + $http(getStudentDocDetails).then(function (response) { + if (response.data.docListStatus == true) { + $scope.docNotFound = false; + $scope.studentDocumentsList = response.data.student_doc_details; + } else { + $scope.docNotFound = true; + } + }); + } + + $scope.deleteDocDetails = function (id, stuID) { + SweetAlert.swal({ + title: "Warning!", + text: "Want to Delete this file ?", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#007aff", + confirmButtonText: "Yes!" + }, function (res) { + if (res === true) { + // alert(id); + // alert(stuId); + var deleteDocEntry = { + method: 'POST', + url: apiPoint.url + 'deleteStuDocDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + exceptId: stuID, + docDetailsID: id, + localData: localDetail + } + }; + $http(deleteDocEntry).then(function (response) { + if (response.data.docDeleteStatus == true) { + $scope.getStuEntrollDocDetails(stuID); + } else { + $scope.docNotFound = true; + } + }); + } + }); + } + + $scope.myModelAddDocuments = { + "documentName": "", + "documentComments": "" + } + + //an array of documents selected + $scope.filesDocuments = []; + //listen for the document selected event + $scope.$on("fileSelectedDocument", function (event, args) { + $scope.$apply(function () { + //add the file object to the scope's files collection + $scope.filesDocuments[0] = args.file; + }); + }); + + $scope.studentEntrollDocFORM = { + submit: function (form, myModelAddDocuments, stuID) { + var firstError = null; + if (form.$invalid) { + var field = null, firstError = null; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$name; + } + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); + } else { + if ($scope.filesDocuments[0] == undefined || $scope.filesDocuments[0] == null || $scope.filesDocuments.length === 0) { + swal("Warning!", "Choose the File.", "warning"); + } else { + var formData = new FormData(); + var stuDocProof = $scope.filesDocuments[0]; + var stuDocProofStatus = $scope.filesDocuments[0] !== undefined ? true : false; + + formData.append("data", JSON.stringify(myModelAddDocuments)); + formData.append("studentID", stuID); + formData.append("updatedBy", localDetails.localUserID); + formData.append('stuDocProof', stuDocProof); + formData.append('stuDocProof_Status', stuDocProofStatus); + + $http.post(apiPoint.url + 'addStudentEntrollDocDetails/', formData, { + transformRequest: angular.identity, + headers: { 'Content-Type': undefined, 'Process-Data': false }, + }).success(function (res) { + if (res.stuDocUpdateStatus == true) { + $scope.getStuEntrollDocDetails(stuID); + swal(" ", "Updated successfully.", "success"); + + // $scope.getStudentList(); + // $scope.editId = -1; + // $scope.editSaveButtonDisable = false; + } else { + swal(" ", res.data.message, "error"); + // $scope.editSaveButtonDisable = false; + } + }); + } + } + }, + reset: function (form) { + $scope.filesDocuments[0] = undefined; + form.$setPristine(true); + angular.element("input[type='file']").val(null); + } + } + + // end : entrollment document upload ==================================== $scope.stepsModelEdit = []; $scope.imageUploadEdit = function (event) { @@ -930,8 +1065,9 @@ $scope.studentListLength = 0; $scope.editSaveButtonDisable = false; // update student details $scope.updateStuDetails = function (form, p, hidedob) { - $scope.editSaveButtonDisable = true; + $scope.editSaveButtonDisable = true; var firstError = null; + // alert(form.$invalid); if (form.$invalid) { var field = null, firstError = null; for (field in form) { @@ -947,6 +1083,7 @@ $scope.studentListLength = 0; angular.element('.ng-invalid[name=' + firstError + ']').focus(); // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); } else { + // alert(p.DOB); var idProof = $scope.filesEdit[0]; @@ -992,17 +1129,17 @@ $scope.studentListLength = 0; $http.post(apiPoint.url + 'updateStudentImgDetails/', formData, { transformRequest: angular.identity, headers: { 'Content-Type': undefined, 'Process-Data': false }, - }).success(function(res) { + }).success(function (res) { // alert(JSON.stringify(res)); if (res.updateStuStatus == true) { - swal(" ","Updated successfully." , "success"); + swal(" ", "Updated successfully.", "success"); $scope.getStudentList(); $scope.editId = -1; - $scope.editSaveButtonDisable = false; + $scope.editSaveButtonDisable = false; } else { // $scope.ldloading1[loading.replace('-', '_')] = false; swal(" ", response.data.message, "error"); - $scope.editSaveButtonDisable = false; + $scope.editSaveButtonDisable = false; } }); } @@ -1056,7 +1193,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl }; $http(empListreq).then(function (response) { if (response.data.branDetailstatus) { - $scope.loader = false; + $scope.loader = false; $scope.branchList_data = response.data.branch_details; } else { } @@ -1078,7 +1215,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.currentDate = new Date(sixteenYearsBeforeNow); $scope.getStudentList(); $scope.getUniversityList(); - $scope.getUniversitySearchList(); + $scope.getUniversitySearchList(); $scope.myModel.dateofbirth = $filter('date')($scope.currentDate, 'dd-MM-yyyy'); $scope.viewStudentDetailsPage = true; } @@ -1146,10 +1283,10 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $http(checkBranchActiveForStuAdd).then(function (response) { if (response.data) { var checkStatus = response.data.branch_active_status; - if(checkStatus == "0"){ - $scope.inActiveBranchStatus = true; - swal(" ", "Cannot create a new Student for In-Active Branch", "warning"); - }else { + if (checkStatus == "0") { + $scope.inActiveBranchStatus = true; + swal(" ", "Cannot create a new Student for In-Active Branch", "warning"); + } else { // $scope.inActiveBranchStatus = false; } } else { @@ -1179,7 +1316,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl - // get University List + // get University List $scope.universitySearchData = ''; $scope.getUniversitySearchList = function () { var empListreq = { @@ -1206,17 +1343,17 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl "Course": "", "Status": "" } -$scope.myUnivSearch = ""; - $scope.getUniveId = function (univ) { - let name = JSON.parse(univ); - $scope.searchData.University = name.UniversityID; - $scope.searchData.Course = ''; - $scope.searchData.Batch = ''; - $scope.courseData = name.Course; - $scope.batchData = name.Batch; - $scope.OpenWindowStatus = false; - $scope.getStudentList(); - }; + $scope.myUnivSearch = ""; + $scope.getUniveId = function (univ) { + let name = JSON.parse(univ); + $scope.searchData.University = name.UniversityID; + $scope.searchData.Course = ''; + $scope.searchData.Batch = ''; + $scope.courseData = name.Course; + $scope.batchData = name.Batch; + $scope.OpenWindowStatus = false; + $scope.getStudentList(); + }; $scope.getValueChange = function () { @@ -1225,9 +1362,9 @@ $scope.myUnivSearch = ""; // "Course": "", // "Status": "" // } - $scope.getStudentList(); + $scope.getStudentList(); } - $scope.Searchloader = false; + $scope.Searchloader = false; $scope.studentListLength = 0; $scope.getStudentList = function () { $scope.Searchloader = true; @@ -1239,7 +1376,7 @@ $scope.myUnivSearch = ""; }, data: { data: localDetails, - search: $scope.searchData + search: $scope.searchData } }; $http(empListreq).then(function (response) { @@ -1247,7 +1384,7 @@ $scope.myUnivSearch = ""; $scope.Searchloader = false; $scope.studentData = true; $scope.data = response.data.student_details; - $scope.studentListLength = $scope.data.length; + $scope.studentListLength = $scope.data.length; } else { $scope.Searchloader = false; $scope.studentData = false; @@ -1340,7 +1477,7 @@ $scope.myUnivSearch = ""; }; $http(req).then(function (response) { if (response.data.addStuCourseStatus == true) { - swal(" ","Student course added successfully. ", "success"); + swal(" ", "Student course added successfully. ", "success"); $scope.getStudentCourseList($scope.currentStudentId); } else { swal(" ", response.data.message, "error"); @@ -1366,7 +1503,7 @@ $scope.myUnivSearch = ""; data: { studentID: studentId, updatedBy: localDetails, - + } }; $http(req).then(function (response) { @@ -1565,27 +1702,27 @@ $scope.myUnivSearch = ""; // } else { // } if (response.data.existMobile == true) { - if(response.data.details.type === 'R001'){ + if (response.data.details.type === 'R001') { // swal("Warning!", response.data.message, "warning"); $scope.myModel.primaryPhone = ''; // student registration find student previously exist // $scope.existingStudentView = true; // $scope.existingStudentId = response.data.details.studentId; - SweetAlert.swal({ - title: "Warning!", - text: "Student Exsit with this same Number." + "\n Do you want to Enroll New Cource!", - type: "warning", - showCancelButton: true, - confirmButtonColor: "#007aff", - confirmButtonText: "Yes!" - }, function (res) { - if(res === true){ - $scope.existingStudentView = true; - $scope.existingStudentId = response.data.details.studentId; - } - }); + SweetAlert.swal({ + title: "Warning!", + text: "Student Exsit with this same Number." + "\n Do you want to Enroll New Cource!", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#007aff", + confirmButtonText: "Yes!" + }, function (res) { + if (res === true) { + $scope.existingStudentView = true; + $scope.existingStudentId = response.data.details.studentId; + } + }); - }else if (response.data.details.type === 'R002' || response.data.details.type === 'R003'){ + } else if (response.data.details.type === 'R002' || response.data.details.type === 'R003') { swal("Warning!", response.data.message, "warning"); $scope.myModel.primaryPhone = ''; } else { @@ -1598,11 +1735,11 @@ $scope.myUnivSearch = ""; } $scope.stuExistingDetailsShowLoading = false; - - $scope.getExistStudentDetails = function() { - // alert($scope.existingStudentId); - $scope.stuExistingDetailsShowLoading = true; - var checkExisReq = { + + $scope.getExistStudentDetails = function () { + // alert($scope.existingStudentId); + $scope.stuExistingDetailsShowLoading = true; + var checkExisReq = { method: 'POST', url: apiPoint.url + 'getExistingStudentDetails/', headers: { @@ -1624,12 +1761,12 @@ $scope.myUnivSearch = ""; }); } - $scope.cancelExisStudentView = function() { - $scope.existingStudentView = false; + $scope.cancelExisStudentView = function () { + $scope.existingStudentView = false; } - // add student course for existing student - $scope.addCourseExistingStudent= { + // add student course for existing student + $scope.addCourseExistingStudent = { submit: function (form, myModelCourse, p) { var firstError = null; @@ -1667,28 +1804,28 @@ $scope.myUnivSearch = ""; }; $http(req).then(function (response) { if (response.data.addStuCourseStatus == true) { - swal(" ","Student course added successfully. ", "success"); - $scope.disableButton = false; - $scope.viewStudentDetailsPage = false; - $scope.myActivateDiv(); + swal(" ", "Student course added successfully. ", "success"); + $scope.disableButton = false; + $scope.viewStudentDetailsPage = false; + $scope.myActivateDiv(); // $state.go($state.current, {}, { reload: true }); // $scope.getStudentCourseList($scope.currentStudentId); } else { swal(" ", response.data.message, "error"); // $scope.getStudentCourseList($scope.currentStudentId); - $scope.myModelCourse.dateofjoining = ''; + $scope.myModelCourse.dateofjoining = ''; } }); } }, - cancel: function() { - $scope.myModelCourse = { - 'university': '', - 'course': '', - 'batch': '', - 'dateofjoining': '', - 'enrollmentid': '' - }; + cancel: function () { + $scope.myModelCourse = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; } } @@ -1773,47 +1910,47 @@ $scope.myUnivSearch = ""; } } - $scope.myActivateDiv = function() { - $scope.viewStudentDetailsPage = false; - $scope.myModel = { - 'primaryPhone': '', - 'firstname': '', - 'lastname': '', - 'fathername': '', - 'mothername': '', - 'emailId': '', - 'secondaryPhone': '', - 'dateofbirth': '', - 'gender': '', - 'aadharNumber': '', - 'otherId': '', - 'otherIdDetails': '', - 'address1': '', - 'address2': '', - 'caste': '', - 'category': '', - 'religion': '', - 'nationality': '', - 'prequalification': '', - 'occupation': '', - 'designation': '', - 'companyname': '', - 'referredby': '', - 'referredmobilenumber': '', - 'switchsetting': true, - 'DeactiveComments': '', - 'Comments': '' - }; - $scope.myModelCourseAdd = { - 'university': '', - 'course': '', - 'batch': '', - 'dateofjoining': '', - 'enrollmentid': '' - }; - $timeout(function(){ - getDetails(); - },1000); + $scope.myActivateDiv = function () { + $scope.viewStudentDetailsPage = false; + $scope.myModel = { + 'primaryPhone': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'caste': '', + 'category': '', + 'religion': '', + 'nationality': '', + 'prequalification': '', + 'occupation': '', + 'designation': '', + 'companyname': '', + 'referredby': '', + 'referredmobilenumber': '', + 'switchsetting': true, + 'DeactiveComments': '', + 'Comments': '' + }; + $scope.myModelCourseAdd = { + 'university': '', + 'course': '', + 'batch': '', + 'dateofjoining': '', + 'enrollmentid': '' + }; + $timeout(function () { + getDetails(); + }, 1000); } // add student @@ -1863,7 +2000,7 @@ $scope.myUnivSearch = ""; // $state.go($state.current, {}, { reload: true }); $scope.myActivateDiv(); // $scope.tabactive2 = false; - // $scope.viewStudentDetailsPage = false; + // $scope.viewStudentDetailsPage = false; // $scope.tabActive('tabactive1'); } else { // $scope.ldloading1[loading.replace('-', '_')] = false; @@ -1887,14 +2024,14 @@ $scope.myUnivSearch = ""; }; $http(req).then(function (response) { if (response.data.addStudentStatus == true) { - swal( "", "Student added successfully.", "success"); + swal("", "Student added successfully.", "success"); $scope.disableButton = false; $scope.viewStudentDetailsPage = false; // $state.go($state.current, {}, { reload: true }); $scope.myActivateDiv(); // $scope.tabactive1 = true; // $scope.tabactive2 = false; - + // $scope.tabActive('tabactive1'); } else { $scope.disableButton = false; @@ -1908,35 +2045,35 @@ $scope.myUnivSearch = ""; // $scope.myModel = angular.copy($scope.master); form.$setPristine(true); $scope.myModel = { - 'primaryPhone': '', - 'firstname': '', - 'lastname': '', - 'fathername': '', - 'mothername': '', - 'emailId': '', - 'secondaryPhone': '', - 'dateofbirth': '', - 'gender': '', - 'aadharNumber': '', - 'otherId': '', - 'otherIdDetails': '', - 'address1': '', - 'address2': '', - 'caste': '', - 'category': '', - 'religion': '', - 'nationality': '', - 'prequalification': '', - 'occupation': '', - 'designation': '', - 'companyname': '', - 'referredby': '', - 'referredmobilenumber': '', - 'switchsetting': true, - 'DeactiveComments': '', - 'Comments': '' - }; - $scope.myModelCourseAdd = { + 'primaryPhone': '', + 'firstname': '', + 'lastname': '', + 'fathername': '', + 'mothername': '', + 'emailId': '', + 'secondaryPhone': '', + 'dateofbirth': '', + 'gender': '', + 'aadharNumber': '', + 'otherId': '', + 'otherIdDetails': '', + 'address1': '', + 'address2': '', + 'caste': '', + 'category': '', + 'religion': '', + 'nationality': '', + 'prequalification': '', + 'occupation': '', + 'designation': '', + 'companyname': '', + 'referredby': '', + 'referredmobilenumber': '', + 'switchsetting': true, + 'DeactiveComments': '', + 'Comments': '' + }; + $scope.myModelCourseAdd = { 'university': '', 'course': '', 'batch': '', @@ -2156,23 +2293,37 @@ app.directive('fileUploadEdit', function () { scope.$emit("fileSelectedEdit", { file: files[i] }); } }); - - - -} -}; + } + }; }); -app.filter('unique', function() { - return function(collection, primaryKey, secondaryKey) { //optional secondary key +// file upload directive - file-upload-document +app.directive('fileUploadDocument', function () { + return { + scope: true, //create a new scope + link: function (scope, el, attrs) { + el.bind('change', function (event) { + var files = event.target.files; + //iterate files since 'multiple' may be specified on the element + for (var i = 0; i < files.length; i++) { + //emit event upward + scope.$emit("fileSelectedDocument", { file: files[i] }); + } + }); + } + }; +}); + +app.filter('unique', function () { + return function (collection, primaryKey, secondaryKey) { //optional secondary key var output = [], keys = []; - angular.forEach(collection, function(item) { + angular.forEach(collection, function (item) { var key; secondaryKey === undefined ? key = item[primaryKey] : key = item[primaryKey][secondaryKey]; - if(keys.indexOf(key) === -1) { + if (keys.indexOf(key) === -1) { keys.push(key); output.push(item); } @@ -2183,7 +2334,7 @@ app.filter('unique', function() { }); /*modal controller * */ -app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS", "$http", function ($scope, $modal, $log,apiPoint,$http) { +app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS", "$http", function ($scope, $modal, $log, apiPoint, $http) { //Tooltip for print button $scope.dynamicTooltip = 'Student View'; @@ -2202,13 +2353,13 @@ app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS" 'Content-Type': 'application/json' }, data: { - requestedBy :studentDetails.StudentID, + requestedBy: studentDetails.StudentID, requestedFrom: 1 } }; $http(getcourse).then(function (response) { - if (response.data.status == 200 && response.data.studentStatus== true) { + if (response.data.status == 200 && response.data.studentStatus == true) { $scope.courseEditLoading = false; // $scope.studentDetails = response.data.studentDetails; $scope.studentDetails = response.data; @@ -2219,7 +2370,7 @@ app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS" // size: size, resolve: { items: function () { - return $scope.studentDetails; + return $scope.studentDetails; } } }); @@ -2249,7 +2400,7 @@ app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS" // size: size, resolve: { items1: function () { - return values; + return values; } } }); @@ -2267,7 +2418,7 @@ app.controller('studentModalDemoCtrl', ["$scope", "$modal", "$log", "API_POINTS" // Please note that $modalInstance represents a modal window (instance) dependency. // It is not the same as the $modal service used above. -app.controller('ModalInstanceCtrl', ["$scope", "$modalInstance", "items","WordsService", function ($scope, $modalInstance, items,WordsService) { +app.controller('ModalInstanceCtrl', ["$scope", "$modalInstance", "items", "WordsService", function ($scope, $modalInstance, items, WordsService) { $scope.items = items; $scope.selected = { @@ -2284,7 +2435,7 @@ app.controller('ModalInstanceCtrl', ["$scope", "$modalInstance", "items","WordsS }]); -app.controller('ModalInstanceCtrl1', ["$scope", "$modalInstance", "items1","WordsService", function ($scope, $modalInstance, items1,WordsService) { +app.controller('ModalInstanceCtrl1', ["$scope", "$modalInstance", "items1", "WordsService", function ($scope, $modalInstance, items1, WordsService) { $scope.items1 = items1; diff --git a/Apollo/assets/views/status-update/answer_booklet_status.html b/Apollo/assets/views/status-update/answer_booklet_status.html index 6c613a73..1550e407 100755 --- a/Apollo/assets/views/status-update/answer_booklet_status.html +++ b/Apollo/assets/views/status-update/answer_booklet_status.html @@ -39,7 +39,7 @@ @@ -154,12 +154,12 @@ {{p.Lastname}} {{p.MobileNumber}} {{p.EmailID}} - {{p.CourseName}} + {{p.CourseName}} ({{p.CourseCode}}) - + - + diff --git a/Apollo/assets/views/status-update/application_status.html b/Apollo/assets/views/status-update/application_status.html index 29e451be..9f39ee04 100755 --- a/Apollo/assets/views/status-update/application_status.html +++ b/Apollo/assets/views/status-update/application_status.html @@ -39,7 +39,7 @@ @@ -155,12 +155,12 @@ {{p.Lastname}} {{p.MobileNumber}} {{p.EmailID}} - {{p.CourseName}} + {{p.CourseName}}({{p.CourseCode}}) - + - + diff --git a/Apollo/assets/views/status-update/certification_status.html b/Apollo/assets/views/status-update/certification_status.html index f16aa777..6d932a7c 100755 --- a/Apollo/assets/views/status-update/certification_status.html +++ b/Apollo/assets/views/status-update/certification_status.html @@ -39,7 +39,7 @@ @@ -153,12 +153,12 @@ {{p.Lastname}} {{p.MobileNumber}} {{p.EmailID}} - {{p.CourseName}} + {{p.CourseName}}({{p.CourseCode}}) - + - + diff --git a/Apollo/assets/views/status-update/study_material_status.html b/Apollo/assets/views/status-update/study_material_status.html index d0e9f524..3870fdda 100755 --- a/Apollo/assets/views/status-update/study_material_status.html +++ b/Apollo/assets/views/status-update/study_material_status.html @@ -34,12 +34,12 @@
@@ -155,13 +155,13 @@ {{p.Lastname}} {{p.MobileNumber}} {{p.EmailID}} - {{p.CourseName}} + {{p.CourseName}}({{p.CourseCode}}) - + - + diff --git a/Apollo/assets/views/student/editStudentCourseDetails.html b/Apollo/assets/views/student/editStudentCourseDetails.html index c9abcf46..16667a77 100755 --- a/Apollo/assets/views/student/editStudentCourseDetails.html +++ b/Apollo/assets/views/student/editStudentCourseDetails.html @@ -34,7 +34,7 @@ {{s.UniversityName}} - {{s.CourseName}} + {{s.CourseName}}({{s.CourseCode}}) {{s.Specilization1}} {{s.Specilization2}} {{s.BatchName}} @@ -88,7 +88,7 @@ Course is required @@ -283,7 +283,7 @@ Course is required diff --git a/Apollo/assets/views/student/editStudentDetails.html b/Apollo/assets/views/student/editStudentDetails.html index 939b7a24..510bef5c 100755 --- a/Apollo/assets/views/student/editStudentDetails.html +++ b/Apollo/assets/views/student/editStudentDetails.html @@ -1,481 +1,483 @@ -
-
-
-
-
- - Personal Details - -
-
-
+ + + +
+
+
-
+
+ + Personal Details +
-
- - +
-
- -
-
-
- -
-
- -
-
-
-
-
-
+
+
+
+ + +
+
+ +
+
+
+ +
+ +
+
- -
-
- - -
-
- +
+
+
-
-
+
- +
+
+
- -
- -
-
-
-
-
-
-
+ +
+ + + +

Document Details

+
+
+ + Add Document Details + +
+
+
+
+ + + Document Name is required. +
+
+ + + + + + +
+
+ +
+ + +
+
+
+ +
+
- - -
-
- + + + + +
+ No document details found **
-
--> - -
-
- +
+ + + + \ No newline at end of file diff --git a/Apollo/assets/views/student/student_details.html b/Apollo/assets/views/student/student_details.html index 8218255d..7238e830 100755 --- a/Apollo/assets/views/student/student_details.html +++ b/Apollo/assets/views/student/student_details.html @@ -96,7 +96,7 @@ @@ -650,7 +650,7 @@ Course is required diff --git a/Apollo/assets/views/student/student_details_SuperAdmin.html b/Apollo/assets/views/student/student_details_SuperAdmin.html index f832ddb0..dff493e8 100644 --- a/Apollo/assets/views/student/student_details_SuperAdmin.html +++ b/Apollo/assets/views/student/student_details_SuperAdmin.html @@ -126,7 +126,7 @@ @@ -674,7 +674,7 @@ Course is required From 0430ee4475dbc0cf8126cd88b90ea17f50b1de27 Mon Sep 17 00:00:00 2001 From: resicovenba Date: Tue, 20 Feb 2018 15:43:22 +0530 Subject: [PATCH 3/4] student entrollment document update : kdk --- .../api/application/models/Student_model.php | 35 ++++++++++++--- Apollo/assets/js/controllers/studentCtrl.js | 30 ++++++++++--- .../views/student/editStudentDetails.html | 43 +++++++++++-------- 3 files changed, 76 insertions(+), 32 deletions(-) diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index 0d21fd16..6a0af7f9 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -898,14 +898,35 @@ class Student_model extends CI_Model public function deleteStu_doc_details($stuId, $docId) { - $sql = "DELETE FROM T_StudentDocumentsDetails WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'"; - if ($this->db->query($sql)) { - $results['deleteStatus'] = true; - } - else { - $results['deleteStatus'] = false; - $results['message'] = 'Something went wrong.please try again'; + $sql1 = "SELECT * FROM T_StudentDocumentsDetails WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'"; + $resultSql1 = $this->db->query($sql1)->result(); + if(count($resultSql1) > 0){ + // print_r($resultSql1); + // echo $resultSql1[0]->DocumentStorePath;exit(); + $sql = "DELETE FROM T_StudentDocumentsDetails WHERE StudentID = '" . $stuId . "' AND ID = '" . $docId . "'"; + if ($this->db->query($sql)) { + try{ + if(!file_exists('../images/' . $resultSql1[0]->DocumentStorePath)) { + throw new Exception("File Not Found."); + }else { + unlink('../images/' . $resultSql1[0]->DocumentStorePath); + } + } catch(Exception $e){ + // echo "Error :"; + } finally { + $results['message'] = 'Deleted Successfully.'; + $results['deleteStatus'] = true; + } + } + else { + $results['deleteStatus'] = false; + $results['message'] = 'Something went wrong.please try again'; + } + }else{ + $results['deleteStatus'] = false; + $results['message'] = 'Something went wrong.please try again'; } + return $results; } // add student entroll doc details diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 0af4ed07..55d2aa92 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -895,7 +895,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.studentDocumentsList = ''; // get Student Document Details $scope.getStuEntrollDocDetails = function (stuId) { - $scope.studentDocumentsList = ''; + // $scope.studentDocumentsList = ''; var getStudentDocDetails = { method: 'POST', url: apiPoint.url + 'getListofStuDocDetails/', @@ -913,6 +913,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.studentDocumentsList = response.data.student_doc_details; } else { $scope.docNotFound = true; + $scope.studentDocumentsList.call(); } }); } @@ -929,6 +930,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", if (res === true) { // alert(id); // alert(stuId); + $scope.documentAddDetailsLoading = true; var deleteDocEntry = { method: 'POST', url: apiPoint.url + 'deleteStuDocDetails/', @@ -942,10 +944,14 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", } }; $http(deleteDocEntry).then(function (response) { - if (response.data.docDeleteStatus == true) { + if (response.data.deleteStatus == true) { + // swal("Success!", response.data.message, "success"); + $scope.documentAddDetailsLoading = false; + $scope.studentDocumentsList = ''; $scope.getStuEntrollDocDetails(stuID); } else { - $scope.docNotFound = true; + swal(" ", res.data.message, "error"); + $scope.documentAddDetailsLoading = false; } }); } @@ -966,9 +972,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", $scope.filesDocuments[0] = args.file; }); }); - + + $scope.documentAddDetailsLoading = false; $scope.studentEntrollDocFORM = { submit: function (form, myModelAddDocuments, stuID) { + var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -985,9 +993,11 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", angular.element('.ng-invalid[name=' + firstError + ']').focus(); // swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error"); } else { + if ($scope.filesDocuments[0] == undefined || $scope.filesDocuments[0] == null || $scope.filesDocuments.length === 0) { swal("Warning!", "Choose the File.", "warning"); } else { + $scope.documentAddDetailsLoading = true; var formData = new FormData(); var stuDocProof = $scope.filesDocuments[0]; var stuDocProofStatus = $scope.filesDocuments[0] !== undefined ? true : false; @@ -1004,13 +1014,21 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", }).success(function (res) { if (res.stuDocUpdateStatus == true) { $scope.getStuEntrollDocDetails(stuID); - swal(" ", "Updated successfully.", "success"); - + // swal(" ", "Updated successfully.", "success"); + $scope.documentAddDetailsLoading = false; + $scope.filesDocuments[0] = undefined; + form.$setPristine(true); + angular.element("input[type='file']").val(null); + $scope.myModelAddDocuments = { + "documentName": "", + "documentComments": "" + } // $scope.getStudentList(); // $scope.editId = -1; // $scope.editSaveButtonDisable = false; } else { swal(" ", res.data.message, "error"); + $scope.documentAddDetailsLoading = false; // $scope.editSaveButtonDisable = false; } }); diff --git a/Apollo/assets/views/student/editStudentDetails.html b/Apollo/assets/views/student/editStudentDetails.html index 510bef5c..28169069 100755 --- a/Apollo/assets/views/student/editStudentDetails.html +++ b/Apollo/assets/views/student/editStudentDetails.html @@ -1,4 +1,4 @@ - +
@@ -399,14 +399,15 @@ -

Document Details

+
Add Document Details
-
+
+
- -
+
-
+
+
+
+
+
Loading...
- - +
@@ -465,10 +470,10 @@ {{doc.DocumentStorePath}} - - - + + From b09789c2d9309ac1c106c802b4195cebc4a65ada Mon Sep 17 00:00:00 2001 From: resicovenba Date: Thu, 22 Feb 2018 09:58:28 +0530 Subject: [PATCH 4/4] updates studentDetails : kdk --- Apollo/assets/js/controllers/studentCtrl.js | 2 +- .../assets/views/student/editStudentDetails.html | 5 +++-- .../Dri_RSjVir7twzcm_132_default-user-imge.jpeg | Bin 0 -> 3209 bytes 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 Apollo/images/documents/Dri_RSjVir7twzcm_132_default-user-imge.jpeg diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 55d2aa92..e08259c6 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -1728,7 +1728,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl // $scope.existingStudentId = response.data.details.studentId; SweetAlert.swal({ title: "Warning!", - text: "Student Exsit with this same Number." + "\n Do you want to Enroll New Cource!", + text: "Student Exist with this same Number." + "\n Do you want to Enroll New Course!", type: "warning", showCancelButton: true, confirmButtonColor: "#007aff", diff --git a/Apollo/assets/views/student/editStudentDetails.html b/Apollo/assets/views/student/editStudentDetails.html index 28169069..a2a6f649 100755 --- a/Apollo/assets/views/student/editStudentDetails.html +++ b/Apollo/assets/views/student/editStudentDetails.html @@ -460,7 +460,7 @@ Document Name - Status + Details Download/Delete @@ -469,10 +469,11 @@ {{doc.DocumentName}} {{doc.DocumentStorePath}} + + diff --git a/Apollo/images/documents/Dri_RSjVir7twzcm_132_default-user-imge.jpeg b/Apollo/images/documents/Dri_RSjVir7twzcm_132_default-user-imge.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..7fb22b9a1f841ecfb5ca5082b15be8a41acefa4d GIT binary patch literal 3209 zcmb7@c{mjA7RSdnl4XqS)W|T5wT7Wk;)aHhwd`54jTEF+Djg<uYjNcFCU+f80>_Q2vmfhA96|pDg#$k zP!K$E8hJ_%2~$*%W8ye^l#7cS#Kk297v>j+|KIDN1pqz*_z3vO!Xyb`1~ajMnGW6o z#2A3gEQhGS7sF)(va&Oh`n&*UCT3Npko_MIn3!3>tZYEOlc&v`kLg4t3rHe# z%>#p8ReHRu(u%iKjI7~8i0$1 z!31Uj1GE7<(SKpdzMt^wc~EF=csg-op95PJ{lN<;4^cPb6w!TdXY$1-etN3RXoTGY z|Kq$E4=vl+OBr!OtI@RZR@QnrjdgP2Z=f*IMGOD653>$WW*mfV20|6czVSltn>38@ zT`hRAF8DrOxPTPME>GY665^^uS{B`xsE$*8MC}P$?@8Y_X%#6K&llT>?CU2*`NTzL z_^cVtVr=}9=qs9VitR{bgU#l-y~v6)8d$3$T@|Mc_~!ZCtdDCj(EGO?eJQk@!GLC& zrt{01rvmEyaO0;^X96p5IW_QeRk7pGpF_f17RtAxDe)d0aDBs-6k3LC`CrQaw8h6_ z5@ZbtwD{{;gi&+FGogr&d5+bmFf}x@uhV9Wra0@-8TQ0dTWV<-+3dl$*DoPi)Pd{e zn3-1HEKBnx|F}>zQK{tv$V8Ri-?-lC5adxLCHSsJwoJN$*&Bwvh^mZri>0Dt3G8u* zF0XM3x>*Rq(b7q{D!pr^Kj`(IfL&+&@P^~S{ugnGz;5Cj{br3WXbfR&o>0@5o~xZZ zq|;0^L&5d(38}`u#^*lqoml{WB4jP6`DG!qHJ7ZzkmoT6BI`$rw{{W+VqAhR9~T@Rav3`S z7NkVhnE~U;TX6_YHl8vrB7f|g9?R6ZMSK^5>H~0td z@=5gkxOK8AHvU%4dTDn@>}D0YD&$JHUJh0}PsY4SWqs$?@ z3=e@S(Z`^N4PJMC(q5&DoG)0NQ^SX$j5x&fe2ht={vq2+7e&P%sAEQ{#UpCL$ooUbs`_|1NHY(C{n3K4zjS zmR#F=B`)4^A7SsdoemAexnT-h-vnCRw9ZU=v!-retgm>S?{J~G}YLekJW02F?m6xq|VSB3}%)}l;yT(-*O@%ohC69bH^ zG0ByxBsfSR|BN9V zjg|IL?~W?u4MyxXJrm3z8sEgdp4@|(T&cr#ywJj)nrc3trdw1!5eB;HnD39htigc` zc!ddmCF0{et8KL|J=-+pes*6ev9tPBT_=y?e!;w^MYO=iHmf%XXDV=b4%X#zR(&TvVcZGt#6<(FKDcU;NC& z>Qt(Bz{rQZ-T`;eUZvOc^n&K5Mr{^}7uJhVocu1C*8NW?8@{yC)~v)oaHcF)F6FgX zn)(}cnvp9HHvc&8gD91vt7fEl5$lMJ2rf7LyVIDoOXv_H57{WH7+-$=?)qwpt@mPr z$zWeo|APJjU~xL!un1?F(`SxqEB%D5$cg!Ly1XPCT|`zk&J~VYMmbb^oF!fxdCXbx zjMjH$PyT&4+X#@PU#R5>D?=20BT$YFW!EURfBPY$S-*M0p2*STT-Y}>WRYIIQPmR- zi^-`rM34m~J?~55^`cWG@KP-qTnTM02(B(SJ7$GAM0@3tO0HCimY>sSz1wLKGh>(pg%KiXrrv>9Ct>x+FLk1*P<+IVpv(AY|nARn>y9) zT6({XtkXp4V;RkTT9(eK>mRP4vlqDHzo=%Q`Qm01SV_RUtZQ@%qjxAm7(Jm{v37e% z+OIS@JU@RF^Z5-S(e(1n8qTk_?@6uu^!hx@ome}I@dO@UCr5&pVsCZc!nv+`f3J$p zirFSX0p%KS^W}$sG59)8Joy;8 zjx#Po{wX@)qdiy6p{y1)@1Mk?m*+uN8w*aLJC*1a_qA6u6nkh%qmO_4k+F(c!#4bU z>3vcdS+(9R`ST5OdPz=gO^TYWPlDM?lh_asX_@)Aq}_qV>u6O0yCZd!qP=N-ueIQG zgQz_2PdZMt5U0jWOecaNmZdv7geOELZSlE7pN6>ZH%}GO>o=)N&Krh(dCI@A=+s%$ z!d*P2uT?I@b+U1&PW+iRXIaS(1Q>!iCxZ#U8B-ri6g1by!#)?aSE+wbo>Gn3&L=$pVL|dPu@fr!Honi0hhiH(yj|#u~j^{ZG z)QiO?BBCnd;yuP3uA0M0Vo`Oqp82Kn5$)sU?ysBJj9jm39^I0EcJ}+wy~&gJicxb{ z3T2y&KhT@2H!Qx0zj?M}N{hU)#Q4mu4e__tlSFUilk=J$YOnS?sc45)K%$7lS7-gS z#M*DGCj*}^4M3OIc8c~4MoSFnKMnv3+nJAnt0%Z8|2?&7^*?5Ij)wM!5pLw)uDhdp zy{^DAT+pxKuvwD$FuD(7=bH7RS+P+0R$sRf%y-1Mqj95Y)NbT+Rck|xf#ReY;q6$d zTUv5mt24+-p*eZ!<)iXrZ_O)aFU7lDW()+t^eFzG#F$R662PqIWRK)B+i~XO%*y}W PF-%7CT{tWNI-vd?#qiK+ literal 0 HcmV?d00001