89 lines
3.1 KiB
PHP
89 lines
3.1 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: karthi
|
|
* Date: 8/28/18
|
|
* Time: 11:01 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 Receive_Enrolment_Fees_Univ_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
|
|
$this->methods['receiveEnrolmentFromUniv_post']['limit'] = 500; // 500 requests per hour per user/key
|
|
// load the model
|
|
$this->load->model('Receive_Enrolment_Fees_Univ_model', 'receive_model');
|
|
|
|
}
|
|
|
|
/*
|
|
* This method used to add received enrolment details
|
|
* created by kms
|
|
* */
|
|
|
|
public function receiveEnrolmentFromUniv_post()
|
|
{
|
|
$enrolmentDetails = $this->post('details');
|
|
$localDetails = $this->post('localDetails');
|
|
$updatedDetails = $this->receive_model->updateEnrolmentDetails($enrolmentDetails,$localDetails);// Check if the users data store contains users (in case the database result returns NULL)
|
|
if ($updatedDetails)
|
|
{
|
|
$updatedDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updatedDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
|
}
|
|
else
|
|
{
|
|
// Set the response and exit
|
|
$this->response([
|
|
'message' => 'Something went wrong.please try again!',
|
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public function insertFormIdUnivFeeDetails_post(){
|
|
$formIdDetails = $this->post('details');
|
|
$localDetails = $this->post('localDetails');
|
|
$updatedDetails = $this->receive_model->formIdFeeDetails($formIdDetails,$localDetails);// Check if the users data store contains users (in case the database result returns NULL)
|
|
if ($updatedDetails)
|
|
{
|
|
$updatedDetails['status'] = REST_Controller::HTTP_OK;
|
|
// Set the response and exit
|
|
$this->response($updatedDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
|
}
|
|
else
|
|
{
|
|
// Set the response and exit
|
|
$this->response([
|
|
'message' => 'Something went wrong.please try again!',
|
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
|
}
|
|
|
|
}
|
|
|
|
} |