methods['getUniversity_post']['limit'] = 100; $this->methods['chkUnivIdExistDetail_post']['limit'] = 100; $this->methods['getDefaultActivityDetails_post']['limit'] = 100; $this->methods['updateDefaultActivityDetails_post']['limit'] = 100; // load the university model $this->load->model('University_model', 'university_model'); } // get university details public function getUniversity_post() { $reqData = $this->post('data'); $loginUserId = $reqData['localUserID']; $loginUserBranchId = $reqData['localBranchID']; $loginUserType = $reqData['localType']; $getUniversityListDetails = $this->university_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 } } //update university details public function updateUniversityDetail_post() { $reqData = $this->post('data'); $req['UpdatedBy'] = $this->post('updatedBy'); $date = date('Y-m-d H:i:s'); $req['UpdatedOn'] = $date; $req['UniversityName']= $reqData['UniversityName']; $req['UniversityShortName']= $reqData['UniversityShortName']; $req['MobileNumber']= $reqData['MobileNumber']; $req['EmailID']= $reqData['EmailID']; $req['Address']= $reqData['Address']; $req['IsActive']= $reqData['IsActive']; $req['BranchCode'] = $this->post('branchCode'); $req['ID']= $reqData['ID']; $updateFor = $reqData['UniversityID']; $updateUniversityDetail = $this->university_model->update_university_details($updateFor, $req);// Check if the employee exist if ($updateUniversityDetail) { $updateUniversityDetail['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($updateUniversityDetail, 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 } } // check university details exist public function chkUnivIdExistDetail_post() { $data = $this->post('data'); $check = $this->post('check'); $branchCode = $this->post('branchCode'); $checkUnivExist = $this->university_model->check_Univ_Exist($data, $check,$branchCode);// Check if the employee exist if ($checkUnivExist) { $checkUnivExist['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($checkUnivExist, 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 } } // insert university details public function insertUniversity_post() { $reqData = $this->post('data'); $req['CreatedBy'] = $this->post('createdBy'); $date = date('Y-m-d H:i:s'); $req['CreatedOn'] = $date; $req['UniversityName']= $reqData['UniversityName']; $req['UniversityShortName']= $reqData['UniversityShortName']; $req['MobileNumber']= $reqData['MobileNumber']; $req['EmailID']= $reqData['EmailID']; $req['Address']= $reqData['Address']; $req['IsActive']= $reqData['switchsetting']; $req['UniversityID']= $reqData['UniversityID']; $req['BranchCode']= $this->post('branchCode'); $insertUniv = $this->university_model->insert_Univ($req);// Check if the employee exist if ($insertUniv) { $insertUniv['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($insertUniv, 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 } } /* * add activity details * created Surendiran * */ public function addActivityDetails_post() { $now = new DateTime(); $now->setTimezone(new DateTimezone('Asia/Kolkata')); $details['ActivityID'] = $this->post('activityID'); $details['ActivityName'] = $this->post('activityName'); $details['Description'] = $this->post('description'); $details['CreatedBy'] = $this->post('createdBy'); $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); $details['IsActive'] = $this->post('status'); $jsonData=$this->post('activityStatus'); $activityDetails = $this->university_model->addActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL) if ($activityDetails) { $activityDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($activityDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'Something went wrong.please try again!', 'status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } /* * get activity details * created by Surendiran * */ public function getActivityDetails_post() { $requestedBy = $this->post('requestedBy'); $getActivity = $this->university_model->getActivity($requestedBy); if ($getActivity) { $getActivity['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getActivity, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } /* * update activity details * created by Surendiran * */ public function updateActivityDetails_post() { $now = new DateTime(); $now->setTimezone(new DateTimezone('Asia/Kolkata')); $details['ActivityID'] = $this->post('activityID'); $details['ActivityName'] = $this->post('activityName'); $details['Description'] = $this->post('description'); $details['IsActive'] = $this->post('status'); $details['UpdatedBy'] = $this->post('updatedBy'); $details['UpdatedOn'] = $now->format('Y-m-d H:i:s'); $jsonData=$this->post('activityStatus'); $activityDetails = $this->university_model->updateActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL) if ($activityDetails) { $activityDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($activityDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'Something went wrong.please try again!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } /* * get default activity details * created by kms * */ public function getDefaultActivityDetails_post() { $requestedBy = $this->post('requestedBy'); $getDefaultActivity = $this->university_model->getDefaultActivity($requestedBy); if ($getDefaultActivity) { $getDefaultActivity['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($getDefaultActivity, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'No records found!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } /* * update default activity status * created by kms * */ public function updateDefaultActivityDetails_post() { $now = new DateTime(); $now->setTimezone(new DateTimezone('Asia/Kolkata')); $details['StudentActivityCode'] = $this->post('activityID'); $details['StatusCode'] = $this->post('activityName'); //$details['IsActive'] = $this->post('status'); $details['UpdatedBy'] = $this->post('updatedBy'); $details['UpdatedOn'] = $now->format('Y-m-d H:i:s'); $jsonData=$this->post('activityStatus'); $activityDetails = $this->university_model->updateDefaultActivity($details,$jsonData);// Check if the users data store contains users (in case the database result returns NULL) if ($activityDetails) { $activityDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit $this->response($activityDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code } else { // Set the response and exit $this->response([ 'message' => 'Something went wrong.please try again!', 'status' => REST_Controller::HTTP_NOT_FOUND ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } } }