apollodec/Apollo/api/application/controllers/Reregister_Controller.php

78 lines
2.3 KiB
PHP

<?php
/**
* Created by Visual Studio.
* User: sriram
* Date: 6/12/18
*/
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';
class Reregister_Controller extends REST_Controller {
function __construct()
{
// Construct the parent class
parent::__construct();
// Configure limits on our controller methods
// Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php
// load the model
$this->load->model('Reregister_model', 'Reregister_model');
}
// For Get University and Batch Details for PROMOTE BATCH MODULE
public function getUniversityBatchDetails_post()
{
$branchId = $this->post('branchId');
$getUnivBatchDetails = $this->Reregister_model->getUniversityBatchDetails($branchId);
if ($getUnivBatchDetails)
{
$getUnivBatchDetails['status'] = REST_Controller::HTTP_OK;
$this->response($getUnivBatchDetails, 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
}
}
//Get student list for promote Batch Listing Screen
public function getStudentListForPromoteBatch_post()
{
$UID = $this->post('university');
$batch = $this->post('batch');
$branchId = $this->post('branchId');
$res = $this->Reregister_model->getStudentListForPromoteBatchmodal($UID,$batch,$branchId);
if(count($res) > 0)
{
$data['status'] = REST_Controller::HTTP_OK;
$data['studentStatus'] = true;
$data['studentDetails'] = $res;
$this->response($data, REST_Controller::HTTP_OK);
}
else
{
$this->response([
'message' => 'Something Went Wrong!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
}