<?php

class GetBatalAntrian extends CI_Controller {

	public function __construct()
	{
		parent::__construct();

		$this->load->model('api_bpjs_model');
		$this->load->model('data_pasien_model');
		$this->load->model('mjkn_model');
	}

	public function index()
	{
		$header = apache_request_headers();
		$konten = trim(file_get_contents("php://input"));
		$decode = json_decode($konten, true);

		$cek_token = $this->mjkn_model->cek_token($header);

		if(isset($cek_token['metadata']))
		{
			$data['response'] = $cek_token;
		}
		else $data['response'] = $this->mjkn_model->batal_antrian($decode);

		$this->load->view('mjkn/page', $data);
	}
}

?>