Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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 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 Phil Sturgeon, Chris Kacerguis
- * @license MIT
- * @link https://github.com/chriskacerguis/codeigniter-restserver
- */
- class Pembayaran 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
- }
- public function pembayaran_get()
- {
- $this->load->model('M_pembayaran_api');
- $data_pembayaran = $this->M_pembayaran_api->get_pembayaran();
- if ($data_pembayaran!= false) {
- $status = 'sukses';
- }else{
- $status = 'gagal';
- }
- $result = array(
- 'status' => $status ,
- 'data' => $data_pembayaran );
- $this->set_response($result, REST_Controller::HTTP_CREATED); // CREATED (201) being the HTTP response code
- }
- public function tagihan_get()
- {
- $this->load->model('M_pembayaran_api');
- $data_tagihan = $this->M_pembayaran_api->get_tagihan();
- if ($data_pembayaran!= false) {
- $status = 'sukses';
- }else{
- $status = 'gagal';
- }
- $result = array(
- 'status' => $status ,
- 'data' => $data_tagihan );
- $this->set_response($result, REST_Controller::HTTP_CREATED); // CREATED (201) being the HTTP response code
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement