methods['addStudent_post']['limit'] = 100; // load the employee model $this->load->model('Student_model', 'student_model'); } // list of branch for admin student add screen public function getBranchListDetails_post() { $reqData = $this->post('data'); $branchListDetails = $this->student_model->get_branch_list(); // Get Branch list if ($branchListDetails) { $branchListDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($branchListDetails, 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 } } // check the branch active for add a new student public function getBranchActiveStatusforStuAdd_post() { $reqData = $this->post('data'); $branchId = $reqData['localBranchID']; $checkBranchActiveStatis = $this->student_model->getBranchActiveStatusforStuAdd($branchId); // Get Branch list if ($checkBranchActiveStatis) { $checkBranchActiveStatis['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($checkBranchActiveStatis, 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 getStudentList_post() { $reqData = $this->post('data'); $searchReqData = $this->post('search'); $loginUserId = $reqData['localUserID']; $loginUserBranchId = $reqData['localBranchID']; $loginUserType = $reqData['localType']; $batchcode = $searchReqData['Batch']; $studentListDetails = $this->student_model->get_student_list($loginUserId, $loginUserBranchId, $loginUserType, $searchReqData,$batchcode); // Check if the employee exist if ($studentListDetails) { $studentListDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentListDetails, 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 getStudentUniversity_post() { $reqData = $this->post('data'); $loginUserId = $reqData['localUserID']; $loginUserBranchId = $reqData['localBranchID']; $loginUserType = $reqData['localType']; $getUniversityListDetails = $this->student_model->get_university_list($loginUserBranchId); // Check if the employee exist if ($getUniversityListDetails) { $getUniversityListDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getUniversityListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function getStudentCourseList_post() { $studentID = $this->post('studentID'); $reqData = $this->post('updatedBy'); $studentCourse = $this->student_model->get_student_course_list($studentID, $reqData); // Check if the employee exist if ($studentCourse) { $studentCourse['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentCourse, 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 getStudentTrackingDetails_post() { $universityid=$this->post('universityid'); $courseid=$this->post('courseid'); $MobileNumber = $this->post('MobileNumber'); $loginBranch=$this->post('loginBranch');//CH001// $userType =$this->post('userType'); $createdBy =$this->post('createdBy'); $trackingDetails = $this->student_model->get_student_tracking_details($universityid,$courseid,$MobileNumber,$loginBranch,$userType,$createdBy); // Check if the employee exist if ($trackingDetails) { $trackingDetailsData['trackingdata']=$trackingDetails; $trackingDetailsData['status'] = REST_Controller::HTTP_OK; //$trackingDetails['trackingstatus']=true; // Set the response and exit $this->response($trackingDetailsData, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // $this->response($trackingDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } } public function getStudentCourseDetails_post() { $studentCourseID = $this->post('studentcourseId'); $studentCourse = $this->student_model->get_student_course($studentCourseID); // Check if the employee exist if ($studentCourse) { $studentCourse['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentCourse, 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 chkUpdateStuExistDetail_post() { $exceptId = $this->post('exceptId'); $datas = $this->post('datas'); $checkFor = $this->post('check'); $checkRes = $this->student_model->check_update_exist($exceptId, $datas, $checkFor); // Check if the employee exist if ($checkRes) { $checkRes['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($checkRes, 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 updateStudentCourseDetail_post() { $data = $this->post('data'); // error_log("data================".implode(',', $data)); // exit; $updatedBy = $this->post('updatedBy'); $id = $data['ID']; $req['StudentID'] = $data['StudentID']; $req['UniversityID'] = $data['UniversityID']; $req['CourseID'] = $data['CourseID']; $req['SessionID'] = $data['SessionID']; $req['DOJ'] = $data['DOJ']; $req['BranchID'] = $data['BranchID']; $req['EnrollmentID'] = $data['EnrollmentID']; $req['Specilization1'] = $data['Specilization1']; $req['Specilization2'] = $data['Specilization2']; $req['UpdatedBy'] = $updatedBy; $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; // below fields we need to update only for admins if($this->post('updatedUserType') == SUPER_ADMIN || $this->post('updatedUserType') == ADMIN ){ $req['IsActive'] = $data['IsActive']; $req['Status'] = $data['Status']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '' : $data['DeactiveComments']; } $studentCourseUpdate = $this->student_model->update_student_course($req, $id); if ($studentCourseUpdate) { $studentCourseUpdate['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentCourseUpdate, 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 } } // 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() { $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 } } // get student pending enrollment document details public function getListofStuPendingDocDetails_post() { $StudentID = $this->post('exceptId'); $localdata = $this->post('localData'); $studentPendingDocDetails = $this->student_model->getStudent_PendingDoc_Details($StudentID, $localdata); if ($studentPendingDocDetails) { $studentPendingDocDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentPendingDocDetails, 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 addStudentEnrollPendingDocDetails_post() { $updateDetails = $this->post('updateDetails'); $localdata = $this->post('localData'); $reqData['StudentID'] = $updateDetails['student']; $reqData['Details'] = $updateDetails['doc_Details']; $reqData['DocumentDate']= $updateDetails['documentdate']; $reqData['Status'] = $updateDetails['checkTracking']; $reqData['StatusName'] = "PENDING"; $reqData['CreatedBy'] = $localdata['localUserID']; $reqData['CourseID'] = $updateDetails['CourseID']; $date = date('Y-m-d H:i:s'); $reqData['CreatedOn'] = $date; $addStudentPendingDocDetails = $this->student_model->addStu_PendingDoc_Details($reqData, $localdata); //print_r($reqData); if ($addStudentPendingDocDetails) { $addStudentPendingDocDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($addStudentPendingDocDetails, 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 } } // delete pending enrollment document details public function deleteDocPendingDetails_post() { $expID = $this->post('exceptId'); $localData = $this->post('localData'); $stuEnrollPendingDocDeleteDetails = $this->student_model->deleteStu_entrollPending_doc_details($expID); if ($stuEnrollPendingDocDeleteDetails) { $stuEnrollPendingDocDeleteDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($stuEnrollPendingDocDeleteDetails, 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 updateStudentImgDetails_post() { $imagename = $_FILES['idStuUpProof']['name']; $size = $_FILES['idStuUpProof']['size']; $imageSource = $_FILES['idStuUpProof']['tmp_name']; $temp = $this->post('data'); $data = json_decode($temp, true); $updatedBy = $this->post('updatedBy'); $updateStudent = $data['StudentID']; $req['MobileNumber'] = $data['MobileNumber']; $req['Firstname'] = $data['Firstname']; $req['Lastname'] = $data['Lastname']; $req['Fathername'] = $data['Fathername']; $req['EmailID'] = $data['EmailID']; $req['MotherName'] = $data['MotherName']; $req['AlternateNumber'] = $data['AlternateNumber']; $req['Gender'] = $data['Gender']; $req['DOB'] = $data['DOB']; $req['PresentAddress'] = $data['PresentAddress']; $req['PermanentAddress'] = $data['PermanentAddress']; $req['AadharNumber'] = $data['AadharNumber']; $req['OtherID'] = $data['OtherID']; $req['OtherIDDetails'] = $data['OtherIDDetails']; $req['Qualification'] = $data['Qualification']; $req['PreQualification'] = $data['PreQualification']; $req['Caste'] = $data['Caste']; $req['Category'] = $data['Category']; $req['Religion'] = $data['Religion']; $req['Nationality'] = $data['Nationality']; $req['Occupation'] = $data['Occupation']; $req['Designation'] = $data['Designation']; $req['Companyname'] = $data['Companyname']; $req['ReferredBy'] = $data['ReferredBy']; $req['ReferersMobileNumber'] = $data['ReferersMobileNumber']; $req['ProfilePicPath'] = $data['ProfilePicPath']; $req['Comments'] = $data['Comments']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '' : $data['DeactiveComments']; $req['IsActive'] = $data['IsActive']; $req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0"; $req['UpdatedBy'] = $updatedBy; $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; $studentUpdate = $this->student_model->update_student($req, $updateStudent, $imagename, $imageSource, $size); // Check if the employee exist if ($studentUpdate) { $studentUpdate['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentUpdate, 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 updateStudentExistDetail_post() { // $mobile = $this->post('OldPhone'); $olddata= $this->post('OldDetails'); $data = $this->post('data'); $updatedBy = $this->post('updatedBy'); $updateStudent = $data['StudentID']; $imagename = ''; $size = ''; $imageSource = ''; $req['MobileNumber'] = $data['MobileNumber']; $req['Firstname'] = $data['Firstname']; $req['Lastname'] = $data['Lastname']; $req['Fathername'] = $data['Fathername']; $req['EmailID'] = $data['EmailID']; $req['MotherName'] = $data['MotherName']; $req['AlternateNumber'] = $data['AlternateNumber']; $req['Gender'] = $data['Gender']; $req['DOB'] = $data['DOB']; $req['PresentAddress'] = $data['PresentAddress']; $req['PermanentAddress'] = $data['PermanentAddress']; $req['AadharNumber'] = $data['AadharNumber']; $req['OtherID'] = $data['OtherID']; $req['OtherIDDetails'] = $data['OtherIDDetails']; $req['Qualification'] = $data['Qualification']; $req['PreQualification'] = $data['PreQualification']; $req['Caste'] = $data['Caste']; $req['Category'] = $data['Category']; $req['Religion'] = $data['Religion']; $req['Nationality'] = $data['Nationality']; $req['Occupation'] = $data['Occupation']; $req['Designation'] = $data['Designation']; $req['Companyname'] = $data['Companyname']; $req['ReferredBy'] = $data['ReferredBy']; $req['ReferersMobileNumber'] = $data['ReferersMobileNumber']; $req['ProfilePicPath'] = $data['ProfilePicPath']; $req['Comments'] = $data['Comments']; $req['AdmittedBy'] = $data['AdmittedBy']; $req['DeactiveComments'] = $data['IsActive'] == 1 ? '' : $data['DeactiveComments']; $req['IsActive'] = $data['IsActive'] == 1 ? "1" : "0"; $req['LoginAccess'] = $data['LoginAccess'] == 1 ? "1" : "0"; $req['UpdatedBy'] = $updatedBy; $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; $studentUpdate = $this->student_model->update_student($req, $updateStudent, $imagename, $imageSource, $size); // Check if the employee exist // if($mobile!= $req['MobileNumber']) // { // $mobileHistory['StudentID'] = $data['StudentID']; // $mobileHistory['Previous_No'] = $mobile; // $mobileHistory['Current_No'] = $req['MobileNumber']; // $mobileHistory['UpdateBy'] = $req['UpdatedBy']; // $date = date('Y-m-d H:i:s'); // $mobileHistory['UpdatedOn'] = $date; // $mobileHistory['branch']=$data['BranchCode']; // $updatemobilehistory = $this->student_model->UpdateMobileHistory($mobileHistory); // } $changed = 0; if($olddata['AadharNumber'] != $req['AadharNumber']) { $mobileHistory['AadharNumber'] = $olddata['AadharNumber']; $changed =1; } if($olddata['AdmittedBy'] != $req['AdmittedBy']) { $mobileHistory['AdmittedBy'] = $olddata['AdmittedBy']; $changed =1; } if($olddata['AlternateNumber'] != $req['AlternateNumber']) { $mobileHistory['AlternateNumber'] = $olddata['AlternateNumber']; $changed =1; } if($olddata['Caste'] != $req['Caste']) { $mobileHistory['Caste'] = $olddata['Caste']; $changed =1; } if($olddata['Category'] != $req['Category']) { $mobileHistory['Category'] = $olddata['Category']; $changed =1; } if($olddata['Comments'] != $req['Comments']) { $mobileHistory['Comments'] = $olddata['Comments']; $changed =1; } if($olddata['Companyname'] != $req['Companyname']) { $mobileHistory['Companyname'] = $olddata['Companyname']; $changed =1; } if($olddata['DOB'] != $req['DOB']) { $mobileHistory['DOB'] = $olddata['DOB']; $changed =1; } if($olddata['Designation'] != $req['Designation']) { $mobileHistory['Designation'] = $olddata['Designation']; $changed =1; } if($olddata['EmailID'] != $req['EmailID']) { $mobileHistory['EmailID'] = $olddata['EmailID']; $changed =1; } if($olddata['Fathername'] != $req['Fathername']) { $mobileHistory['Fathername'] = $olddata['Fathername']; $changed =1; } if($olddata['Firstname'] != $req['Firstname']) { $mobileHistory['Firstname'] = $olddata['Firstname']; $changed =1; } if($olddata['Gender'] != $req['Gender']) { $mobileHistory['Gender'] = $olddata['Gender']; $changed =1; } if($olddata['Lastname'] != $req['Lastname']) { $mobileHistory['Lastname'] = $olddata['Lastname']; $changed =1; } if($olddata['MobileNumber'] != $req['MobileNumber']) { $mobileHistory['Previous_No'] = $olddata['MobileNumber']; $changed =1; } if($olddata['MotherName'] != $req['MotherName']) { $mobileHistory['MotherName'] = $olddata['MotherName']; $changed =1; } if($olddata['Nationality'] != $req['Nationality']) { $mobileHistory['Nationality'] = $olddata['Nationality']; $changed =1; } if($olddata['Occupation'] != $req['Occupation']) { $mobileHistory['Occupation'] = $olddata['Occupation']; $changed =1; } if($olddata['OtherID'] != $req['OtherID']) { $mobileHistory['OtherID'] = $olddata['OtherID']; $changed =1; } if($olddata['OtherIDDetails'] != $req['OtherIDDetails']) { $mobileHistory['OtherIDDetails'] = $olddata['OtherIDDetails']; $changed =1; } if($olddata['PermanentAddress'] != $req['PermanentAddress']) { $mobileHistory['PermanentAddress'] = $olddata['PermanentAddress']; $changed =1; } if($olddata['PreQualification'] != $req['PreQualification']) { $mobileHistory['PreQualification'] = $olddata['PreQualification']; $changed =1; } if($olddata['PresentAddress'] != $req['PresentAddress']) { $mobileHistory['PresentAddress'] = $olddata['PresentAddress']; $changed =1; } if($olddata['Qualification'] != $req['Qualification']) { $mobileHistory['Qualification'] = $olddata['Qualification']; $changed =1; } if($olddata['ReferersMobileNumber'] != $req['ReferersMobileNumber']) { $mobileHistory['ReferersMobileNumber'] = $olddata['ReferersMobileNumber']; $changed =1; } if($olddata['ReferredBy'] != $req['ReferredBy']) { $mobileHistory['ReferredBy'] = $olddata['ReferredBy']; $changed =1; } if($olddata['Religion'] != $req['Religion']) { $mobileHistory['Religion'] = $olddata['Religion']; $changed =1; } if($changed == 1) { $mobileHistory['StudentID'] = $data['StudentID']; $mobileHistory['Current_No'] = $req['MobileNumber']; $mobileHistory['UpdateBy'] = $req['UpdatedBy']; $date = date('Y-m-d H:i:s'); $mobileHistory['UpdatedOn'] = $date; $mobileHistory['branch']=$data['BranchCode']; $updatemobilehistory = $this->student_model->UpdateMobileHistory($mobileHistory); } if ($studentUpdate) { $studentUpdate['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentUpdate, 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 getCourseBatch_post() { $data = $this->post('data'); $reqDetails = $this->post('reqDetails'); $getCourseBatchListDetails = $this->student_model->get_courseBatch_list($data, $reqDetails['localBranchID']); // Check if the employee exist if ($getCourseBatchListDetails) { $getCourseBatchListDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getCourseBatchListDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response(['message' => 'No list were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function chkStudentExistDetail_post() { $data = $this->post('data'); $checkData = $this->post('check'); $checkRes = $this->student_model->check_exist($data, $checkData); // Check if the employee exist if ($checkRes) { $checkRes['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($checkRes, 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 getExistingStudentDetails_post() { $data = $this->post('data'); $reqDetails = $this->post('check'); $checkExisRes = $this->student_model->get_exist_stu_details($data, $reqDetails); // Check if the employee exist if ($checkExisRes) { $checkExisRes['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($checkExisRes, 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 } } // add new course for student public function insertStudentCourse_post() { $addStudent = $this->post('addStudent'); $coursedata = $this->post('coursedata'); $createdBy = $this->post('createdBy'); $createdBranch = $this->post('loginBranch'); $reqCourse['StudentID'] = $addStudent; $reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['CourseID'] = $coursedata['course']; $reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['Specilization1'] = $coursedata['specilization1']; $reqCourse['Specilization2'] = $coursedata['specilization2']; $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = '1'; $reqCourse['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $reqCourse['CreatedOn'] = $date; // print_r($reqCourse);exit(); $studentAddCourse = $this->student_model->add_student_course($addStudent, $reqCourse); // Check if the employee exist if ($studentAddCourse) { $studentAddCourse['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentAddCourse, 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 insertStudentImg_post() { $imagename = $_FILES['idStuProof']['name']; $size = $_FILES['idStuProof']['size']; $imageSource = $_FILES['idStuProof']['tmp_name']; $temp = $this->post('data'); $tempBranch = $this->post('coursedata'); $data = json_decode($temp, true); $coursedata = json_decode($tempBranch, true); $createdBy = $this->post('createdBy'); $createdBranch = $this->post('loginBranch'); $req['Firstname'] = $data['firstname']; $req['Lastname'] = $data['lastname']; $req['Fathername'] = $data['fathername']; $req['EmailID'] = $data['emailId']; $req['MotherName'] = $data['mothername']; $req['MobileNumber'] = $data['primaryPhone']; $req['AlternateNumber'] = $data['secondaryPhone']; $req['Gender'] = $data['gender']; $req['DOB'] = $data['dateofbirth']; $req['PresentAddress'] = $data['address2']; $req['PermanentAddress'] = $data['address1']; $req['AadharNumber'] = $data['aadharNumber']; $req['OtherID'] = $data['otherId']; $req['OtherIDDetails'] = $data['otherIdDetails']; $req['Caste'] = $data['caste']; $req['Category'] = $data['category']; $req['Religion'] = $data['religion']; $req['Nationality'] = $data['nationality']; $req['Occupation'] = $data['occupation']; $req['Designation'] = $data['designation']; $req['Companyname'] = $data['companyname']; $req['ReferredBy'] = $data['referredby']; $req['ReferersMobileNumber'] = $data['referredmobilenumber']; $req['PreQualification'] = $data['prequalification']; $req['IsActive'] = $data['switchsetting']; $req['Comments'] = $data['Comments']; $req['AdmittedBy'] = $data['admittedBy']; $req['BranchCode'] = $createdBranch; $req['DeactiveComments'] = $data['switchsetting'] == 1 ? '' : $data['DeactiveComments']; $req['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $req['CreatedOn'] = $date; $reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['CourseID'] = $coursedata['course']; $reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['Specilization1'] = $coursedata['specilization1']; $reqCourse['Specilization2'] = $coursedata['specilization2']; $reqCourse['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $reqCourse['CreatedOn'] = $date; $studentAdd = $this->student_model->add_student($req, $reqCourse, $imagename, $imageSource, $size); // Check if the employee exist if ($studentAdd) { $studentAdd['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentAdd, 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 } } // add student public function addStudent_post() { $imagename = ''; $size = ''; $imageSource = ''; $data = $this->post('data'); $coursedata = $this->post('coursedata'); $createdBy = $this->post('createdBy'); $createdBranch = $this->post('loginBranch'); $req['Firstname'] = $data['firstname']; $req['Lastname'] = $data['lastname']; $req['Fathername'] = $data['fathername']; $req['EmailID'] = $data['emailId']; $req['MotherName'] = $data['mothername']; $req['MobileNumber'] = $data['primaryPhone']; $req['AlternateNumber'] = $data['secondaryPhone']; $req['Gender'] = $data['gender']; $req['DOB'] = $data['dateofbirth']; $req['PresentAddress'] = $data['address2']; $req['PermanentAddress'] = $data['address1']; $req['AadharNumber'] = $data['aadharNumber']; $req['OtherID'] = $data['otherId']; $req['OtherIDDetails'] = $data['otherIdDetails']; $req['Caste'] = $data['caste']; $req['Category'] = $data['category']; $req['Religion'] = $data['religion']; $req['Nationality'] = $data['nationality']; $req['Occupation'] = $data['occupation']; $req['Designation'] = $data['designation']; $req['Companyname'] = $data['companyname']; $req['ReferredBy'] = $data['referredby']; $req['ReferersMobileNumber'] = $data['referredmobilenumber']; $req['PreQualification'] = $data['prequalification']; $req['IsActive'] = $data['switchsetting']; $req['Comments'] = $data['Comments']; $req['AdmittedBy'] = $data['admittedBy']; $req['BranchCode'] = $createdBranch; $req['DeactiveComments'] = $data['switchsetting'] == 1 ? '' : $data['DeactiveComments']; $req['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $req['CreatedOn'] = $date; $reqCourse['UniversityID'] = $coursedata['university']; $reqCourse['CourseID'] = $coursedata['course']; $reqCourse['SessionID'] = $coursedata['batch']; $reqCourse['DOJ'] = $coursedata['dateofjoining']; $reqCourse['BranchID'] = $createdBranch; $reqCourse['IsActive'] = $data['switchsetting']; $reqCourse['EnrollmentID'] = $coursedata['enrollmentid']; $reqCourse['Specilization1'] = $coursedata['specilization1']; $reqCourse['Specilization2'] = $coursedata['specilization2']; $reqCourse['CreatedBy'] = $createdBy; $date = date('Y-m-d H:i:s'); $reqCourse['CreatedOn'] = $date; $studentAdd = $this->student_model->add_student($req, $reqCourse, $imagename, $imageSource, $size); // Check if the employee exist if ($studentAdd) { $studentAdd['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentAdd, 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 testsmsandmailflow_get(){ $studentAdd = $this->student_model->testsmsandmailflow(); if ($studentAdd) { $studentAdd['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($studentAdd, 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 getEmployeeDetailsBranch_post() { $data = $this->post('data'); $loginUserId = $data['localUserID']; $loginBranchId = $data['localBranchID']; $loginUserType = $data['localType']; $getLoginBranchEmpList = $this->student_model->get_login_branch_Emp_list($loginUserId, $loginBranchId, $loginUserType); // Check if the employee exist if ($getLoginBranchEmpList) { $getLoginBranchEmpList['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getLoginBranchEmpList, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response(['message' => 'No users were found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } public function getCourse_post() { $data = $this->post('data'); $localBranchID =$data['localBranchID']; $getcourselist= $this->student_model->get_All_Course($localBranchID); if ($getcourselist) { $getcourselist['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getcourselist, 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 Getnotificcations_post() { $det['StudentID']=$this->post('StudentID'); $det['Phone']= $this->post('Phone'); $det['Email']=$this->post('Email'); $det['loginBranch']= $this->post('loginBranch'); $det['createdBy']=$this->post('createdBy'); $getnotifications = $this->student_model->GetStudentNotifications($det); if ($getnotifications) { $getnotifications['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getnotifications, 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 GetPhoneHistory_post() { $get['studentID'] = $this->post('StudentID'); $get['loginBranch'] = $this->post('loginBranch'); $phonenumberdetails = $this->student_model->GetPhoneDetails($get); if ($phonenumberdetails) { $phonenumberdetails['status'] = REST_Controller::HTTP_OK; $this->response($phonenumberdetails, REST_Controller::HTTP_OK); } else { $this->response(['message' => 'No data found', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); } } }