apollodec/Apollo/api/application/controllers/Report.php
rajasekar f40e5aacb0 1692
2019-03-11 14:44:04 +05:30

532 lines
16 KiB
PHP
Executable File

<?php
/**
* Created by Visual Studio Code.
* User: Surendiran
* Date: 12/05/17
* Time: 01:05 PM
*/
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 Report extends REST_Controller {
function __construct()
{
// Construct the parent class
parent::__construct();
// load the model
$this->load->model('Reports_model', 'report_model');
}
public function status_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->status($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function markcard_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->markcard($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function certificate_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$from = $this->post('from');
$to = $this->post('to');
$getStatus = $this->report_model->certificate_status($bat,$br,$u,$from,$to);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function mark_cert_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$from = $this->post('from');
$to = $this->post('to');
$getStatus = $this->report_model->mark_cert_status($bat,$br,$u,$from,$to);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function expense_post()
{
$from = $this->post('from');
$to = $this->post('to');
$br = $this->post('branch');
$getStatus = $this->report_model->expense($from,$to,$br);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function answer_booklet_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->answer_booklet($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function app_pending_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->app_pending($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function app_pending_old_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->app_pending_old($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function doc_pending_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->doc_pending($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function wav_ref_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->wav_ref($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function examfee_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->examfee($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function balfee_post()
{
$bat = $this->post('batch');
$br = $this->post('branch');
$u = $this->post('university');
$getStatus = $this->report_model->balfee($bat,$br,$u);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function lead_post()
{
$univ = $this->post('university');
$act = $this->post('activity');
$sta = $this->post('status');
$ass = $this->post('assigned');
$from = $this->post('from');
$to = $this->post('to');
$br = $this->post('branch');
$getStatus = $this->report_model->lead($univ,$act,$sta,$ass,$from,$to,$br);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function filters_post()
{
$br = $this->post('branch');
$getStatus = $this->report_model->getUniversity($br);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function filter_post()
{
$br = $this->post('branch');
$getStatus['Univ'] = $this->report_model->getUniv($br);
$getStatus['Activity'] = $this->report_model->getActivity($br);
$getStatus['Staff'] = $this->report_model->getStaff($br);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function BatchName_post()
{
$br = $this->post('branch');
$batch = $this->post('batch');
$getStatus = $this->report_model->BatchName($br,$batch);
//print_r($getStatus);
if ($getStatus)
{
$getStatus['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getStatus, 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
}
}
public function getAllUniversity_post()
{
//echo 'in';
$branchId = $this->post('branchId');
// echo $branchId;
// die();
$univlist = $this->report_model->GetAllUniversity($branchId);
if($univlist)
{
$univlist['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($univlist, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function NewregDetails_post()
{
$det['from'] = $this->post('from');
$det['to'] = $this->post('to');
$det['university'] = $this->post('university');
$det['branch'] = $this->post('branch');
// print_r($det);
$newlist = $this->report_model->GetNewRegList($det);
if($newlist)
{
$newlist['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($newlist, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
public function feepaidDetails_post()
{
$det['from'] = $this->post('from');
$det['to'] = $this->post('to');
$det['university'] = $this->post('university');
$det['branchId'] = $this->post('branchId');
$feelist = $this->report_model->GetFeePaidDetails($det);
if($feelist)
{
$feelist['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($feelist, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
}