apollosc/api/application/controllers/Masters_Controller.php
2018-09-21 15:09:06 +05:30

57 lines
1.7 KiB
PHP

<?php
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 Masters_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['add_fees_post']['limit'] = 100; // 100 requests per hour per user/key
$this->methods['get_fees_get']['limit'] = 100;
$this->load->model('master_model', 'master_model');
}
//This method used to get Login
public function add_fees_post()
{
$data = json_decode(file_get_contents('php://input'), true);
$feesdes = $data['Feesdes'];
$active = $data['active'];
$feesName = $data['feesName'];
$feesdetails= array('FeesName'=>$feesName,'FeesDescription'=>$feesdes,'Active'=>$active);
$res = $this->master_model->addfees($feesdetails);
return $res;
}
public function get_fees_get()
{
$data = json_decode(file_get_contents('php://input'), true);
$getfees = $this->master_model->getfees();
//print_r($getfees);
return $getfees;
}
}