349 lines
14 KiB
PHP
Executable File
349 lines
14 KiB
PHP
Executable File
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
|
|
/** @noinspection PhpIncludeInspection */
|
|
require_once APPPATH . '/libraries/REST_Controller.php';
|
|
|
|
/**
|
|
* This is an example of a few basic user interaction methods you could use
|
|
* all done with a hardcoded array
|
|
*
|
|
* @package CodeIgniter
|
|
* @subpackage Rest Server
|
|
* @category Controller
|
|
* @author
|
|
* @license MIT
|
|
* @link
|
|
*/
|
|
class StatusUpdation_Controller extends REST_Controller {
|
|
|
|
/*
|
|
* status Updation details
|
|
* params:
|
|
* created by kdk
|
|
* */
|
|
function __construct()
|
|
{
|
|
// Construct the parent class
|
|
parent::__construct();
|
|
$this->methods['getUniversity_post']['limit'] = 100;
|
|
$this->methods['chkUnivIdExistDetail_post']['limit'] = 100;
|
|
// load the university model
|
|
$this->load->model('StatusUpdation_model', 'statusupdation_model');
|
|
}
|
|
|
|
// get University, Course, Branch Detailss
|
|
public function getUniveCourseBratch_post() {
|
|
$reqData = $this->post('data');
|
|
$loginUserId = $reqData['localUserID'];
|
|
$loginUserBranchId = $reqData['localBranchID'];
|
|
$loginUserType = $reqData['localType'];
|
|
$getUniversityListDetails = $this->statusupdation_model->get_university_course_batch();// 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
|
|
}
|
|
}
|
|
|
|
// ger Result fot searched keyword details
|
|
public function getSearchDetails_post() {
|
|
$reqSearchData = $this->post('data');
|
|
$reqData = $this->post('requestDetails');
|
|
// print_r($reqSearchData);exit();
|
|
|
|
$getSearchDetails = $this->statusupdation_model->get_search_result($reqSearchData, $reqData);// Check if the employee exist
|
|
if ($getSearchDetails)
|
|
{
|
|
$getSearchDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getSearchDetails, 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
|
|
}
|
|
}
|
|
|
|
// get Sem/year for the respective course
|
|
public function getSemYearForCourse_post() {
|
|
$reqData = $this->post('data');
|
|
$stuFor = $this->post('stuFor');
|
|
|
|
$getSemYeatList = $this->statusupdation_model->get_semyear_result($reqData, $stuFor);// Check if the employee exist
|
|
if ($getSemYeatList)
|
|
{
|
|
$getSemYeatList['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getSemYeatList, 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 the study material Status
|
|
public function updateStudentMaterialStatus_post() {
|
|
$reqData = $this->post('data');
|
|
$reqDetails = $this->post('requestDetails');
|
|
|
|
$time = date('Y-m-d H:i:s');
|
|
$dateTime = $time;
|
|
|
|
$count = count($reqData);
|
|
// echo $reqDetails['localUserID'];exit();
|
|
|
|
for($i=0; $i < $count; $i++) {
|
|
$data[] = array(
|
|
'StudentID' => $reqData[$i]['StudentID'],
|
|
'CourseID' => $reqData[$i]['CourseID'],
|
|
'BranchCode' => $reqData[$i]['BranchCode'],
|
|
'ListCode' => $reqData[$i]['ListCode'],
|
|
'SDate' => $reqData[$i]['SDate'],
|
|
'Coursedetail' => $reqData[$i]['Coursedetail'],
|
|
'Comments' => $reqData[$i]['Comments'],
|
|
'Sem' => $reqData[$i]['Sem'],
|
|
'CreatedBy' => $reqDetails['localUserID'],
|
|
'CreatedOn' => $dateTime,
|
|
);
|
|
}
|
|
|
|
$updateStudentMaterialSta = $this->statusupdation_model->update_semyear($data);// Check if the employee exist
|
|
if ($updateStudentMaterialSta)
|
|
{
|
|
$updateStudentMaterialSta['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updateStudentMaterialSta, 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 Answer booklet status
|
|
public function updateAnswerBookLetStatus_post() {
|
|
$reqData = $this->post('data');
|
|
$reqDetails = $this->post('requestDetails');
|
|
|
|
$time = date('Y-m-d H:i:s');
|
|
$dateTime = $time;
|
|
|
|
$count = count($reqData);
|
|
// echo $reqDetails['localUserID'];exit();
|
|
|
|
for($i=0; $i < $count; $i++) {
|
|
$data[] = array(
|
|
'StudentID' => $reqData[$i]['StudentID'],
|
|
'CourseID' => $reqData[$i]['CourseID'],
|
|
'BranchCode' => $reqData[$i]['BranchCode'],
|
|
'ListCode' => $reqData[$i]['ListCode'],
|
|
'AnsDate' => $reqData[$i]['SDate'],
|
|
'Coursedetail' => $reqData[$i]['Coursedetail'],
|
|
'Comments' => $reqData[$i]['Comments'],
|
|
'Sem' => $reqData[$i]['Sem'],
|
|
'CreatedBy' => $reqDetails['localUserID'],
|
|
'CreatedOn' => $dateTime,
|
|
);
|
|
}
|
|
|
|
$updateAnswerBookletStat = $this->statusupdation_model->update_answerbooklet($data,$reqDetails);// Check if the employee exist
|
|
if ($updateAnswerBookletStat)
|
|
{
|
|
$updateAnswerBookletStat['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updateAnswerBookletStat, 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
|
|
}
|
|
}
|
|
|
|
// get certification type list
|
|
public function getCertificateList_post() {
|
|
$reqData = $this->post('data');
|
|
|
|
$certificateList = $this->statusupdation_model->get_certificate_list();// Check if the employee exist
|
|
if ($certificateList)
|
|
{
|
|
$certificateList['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($certificateList, 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 certification status
|
|
public function updateCertificationStatus_post() {
|
|
$reqData = $this->post('data');
|
|
$reqDetails = $this->post('requestDetails');
|
|
|
|
$time = date('Y-m-d H:i:s');
|
|
$dateTime = $time;
|
|
|
|
$count = count($reqData);
|
|
// echo $reqDetails['localUserID'];exit();
|
|
|
|
for($i=0; $i < $count; $i++) {
|
|
$data[] = array(
|
|
'StudentID' => $reqData[$i]['StudentID'],
|
|
'CourseID' => $reqData[$i]['CourseID'],
|
|
'BranchCode' => $reqData[$i]['BranchCode'],
|
|
'ListCode' => $reqData[$i]['ListCode'],
|
|
'CDate' => $reqData[$i]['SDate'],
|
|
'Coursedetail' => $reqData[$i]['Coursedetail'],
|
|
'Comments' => $reqData[$i]['Comments'],
|
|
'Sem' => $reqData[$i]['Sem'],
|
|
'CreatedBy' => $reqDetails['localUserID'],
|
|
'CreatedOn' => $dateTime,
|
|
// 'CertificationType' => $reqData[$i]['CertificateType'],
|
|
'CertificationType' => 'MARK CARD',
|
|
'CertificationNo' =>$reqData[$i]['CertificateNumber'],
|
|
);
|
|
}
|
|
|
|
$updateCertificateStatus = $this->statusupdation_model->update_certificateStatus($data);// Check if the employee exist
|
|
if ($updateCertificateStatus)
|
|
{
|
|
$updateCertificateStatus['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updateCertificateStatus, 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 application status
|
|
public function updateApplicationStatus_post() {
|
|
$reqData = $this->post('data');
|
|
$reqDetails = $this->post('requestDetails');
|
|
|
|
$time = date('Y-m-d H:i:s');
|
|
$dateTime = $time;
|
|
|
|
$count = count($reqData);
|
|
// echo $reqDetails['localUserID'];exit();
|
|
|
|
for($i=0; $i < $count; $i++) {
|
|
$data[] = array(
|
|
'StudentID' => $reqData[$i]['StudentID'],
|
|
'CourseID' => $reqData[$i]['CourseID'],
|
|
'BranchCode' => $reqData[$i]['BranchCode'],
|
|
'ListCode' => $reqData[$i]['ListCode'],
|
|
'AppDate' => $reqData[$i]['SDate'],
|
|
'Comments' => $reqData[$i]['Comments'],
|
|
'CreatedBy' => $reqDetails['localUserID'],
|
|
'CreatedOn' => $dateTime,
|
|
'CertificationType' => $reqData[$i]['CertificateType'],
|
|
'CertificationNo' =>$reqData[$i]['CertificateNumber'],
|
|
);
|
|
}
|
|
|
|
$updateApplicationStatus = $this->statusupdation_model->update_applicationStatus($data,$reqDetails);// Check if the employee exist
|
|
if ($updateApplicationStatus)
|
|
{
|
|
$updateApplicationStatus['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updateApplicationStatus, 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
|
|
}
|
|
}
|
|
|
|
// get Status list based on the required activity
|
|
public function getStatusListForUpdate_post() {
|
|
$reqData = $this->post('data');
|
|
$reqDetails = $this->post('statusFor');
|
|
|
|
$getStatusList = $this->statusupdation_model->get_status_list($reqData);// Check if the employee exist
|
|
if ($getStatusList)
|
|
{
|
|
$getStatusList['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getStatusList, 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 getPrevStatusDetailsForStu_post() {
|
|
$reqData = $this->post('data');
|
|
$reqDetailsFor = $this->post('statusFor');
|
|
$reqDetails = $this->post('getDetailsFor');
|
|
|
|
$getPrevStatusList = $this->statusupdation_model->get_prev_status_list($reqDetailsFor, $reqDetails);// Check if the employee exist
|
|
if ($getPrevStatusList)
|
|
{
|
|
$getPrevStatusList['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($getPrevStatusList, 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
|
|
}
|
|
|
|
}
|
|
|
|
}
|