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

194 lines
5.9 KiB
PHP

<?php
/**
* Date: 04/09/18
* Time: 11:24 AM
*/
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 DataCorrection_Controller extends REST_Controller {
function __construct()
{
// Construct the parent class
parent::__construct();
// load the model
$this->load->model('Data_correction', 'Data_correction');
}
public function StudMerge_post()
{
$name = $this->post('name');
$getStatus = $this->Data_correction->Student_Merge($name);
//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 getMob_post()
{
$deleteNo = $this->post('deleteNo');
$mergeNo = $this->post('mergeNo');
$getStatus = $this->Data_correction->getMobile($deleteNo,$mergeNo);
//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 getAllstudentcoursedetail_post()
{
$search['Firstname'] = $this->post('studentName');
$search['MobileNumber'] = $this->post('mobileNumber');
$search['receipt'] = $this->post('receipt');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$search['University'] = $this->post('University');
$stucourse = $this->Data_correction->GetAllCourseDetails($search);
if($stucourse)
{
$stucourse['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($stucourse, 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 getAllfeedetail_post()
{
$search['University'] = $this->post('University');
$search['courseId'] = $this->post('courseId');
$search['studentId'] =$this->post('studentId');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$feedetails = $this->Data_correction->GetFeeDetails($search);
if($feedetails)
{
$feedetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($feedetails, 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 updateCourseDetails_post()
{
$search['University'] = $this->post('universityid');
$search['courseId'] = $this->post('courseId');
$search['studentId'] =$this->post('studentid');
$search['requestedtBy'] =$this->post('requestedtBy');
$search['branchId']=$this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$search['Reason'] = $this->post('Reason');
$search['IsActive'] = $this->post('IsActive');
$updatedetails = $this->Data_correction->UpdateCouseandfee($search);
$allfeeid = $this->Data_correction->GetAllfeeid($search);
if(!empty($allfeeid))
{
foreach($allfeeid as $fi)
{
$feeid = $fi->FeesID;
$feedeact = $this->Data_correction->feedetailupdate($search,$feeid);
}
}
// if($updatedetails)
// {
// $updatedetails['status'] = REST_Controller::HTTP_OK;
// // Set the response and exit
// $this->response($updatedetails, 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);
// }
}
}