apollodec/Apollo/api/application/controllers/Report.php
2020-11-27 10:50:31 +05:30

629 lines
20 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_filter_post()
{
$br = $this->post('branch');
// $userID = $this->post('userID');
$getStatus = $this->report_model->getUniversity2($br);
if ($getStatus)
{
$result = $this->report_model->getDefaultActivity('C001',$br);
if(!empty($result)){$getStatus['markcardstatus'] = $result;}
else{ $getStatus['markcardstatus'] = array();}
$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');
$sts = $this->post('status');
$fd = $this->post('from_date');
$td = $this->post('to_date');
$getStatus = $this->report_model->markcard($bat,$br,$u,$sts,$fd,$td);
//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_filter_post()
{
$br = $this->post('branch');
$getStatus = $this->report_model->getUniversity($br);
if ($getStatus)
{
$result = $this->report_model->getDefaultActivity('A001',$br);
if(!empty($result)){$getStatus['certificatestatus'] = $result;}
else{ $getStatus['certificatestatus'] = array();}
$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');
$st = $this->post('status');
$from = $this->post('from');
$to = $this->post('to');
$getStatus = $this->report_model->certificate_status($bat,$br,$u,$from,$to,$st);
//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_filter_post(){
$br = $this->post('branch');
$getStatus = $this->report_model->getUniversity($br);
if ($getStatus)
{ $cnt = count($getStatus['university']);
if($cnt>=0){
$getStatus['university'][$cnt]["universityID"] = "all";
$getStatus['university'][$cnt]["universityName"] = "ALL";
$getStatus['university'][$cnt]["batchDetails"]= [];}
$getStatus['rollnostatus'] = $this->report_model->getAppPendingStatus($br);
if(!empty($getStatus['rollnostatus'])){
$cnted = count($getStatus['rollnostatus']);
if($cnted>=0){
$getStatus['rollnostatus'][$cnted]["ListCode"] = "all";
$getStatus['rollnostatus'][$cnted]["ListName"] = "ALL";
$getStatus['rollnostatus'][$cnted]["BranchCode"]= $br;
}}
$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');
$st = $this->post('status');
$from = $this->post('from');
$to = $this->post('to');
$updateddate = $this->post('updateddate');
$getStatus = $this->report_model->app_pending($bat,$br,$u,$from,$st,$to,$updateddate);
if($getStatus['app_pendingList']){
$count = count($getStatus['app_pending_data']);
for ($i = 0;$i < $count;$i++) {
$getStatus['app_pending_data'][$i]->FormType = implode('-', array_map('ucfirst', explode('-', $getStatus['app_pending_data'][$i]->FormType)));
}
}
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);
}
}
}