<?php
defined('BASEPATH') or exit('No direct script access allowed');

require_once 'vendor/autoload.php';

class Wsbpjspeserta extends CI_Controller
{	
   
		public function __construct()
		{
			parent::__construct();
			$this->load->model('data_menu');		
            $this->load->library('LibHttpRequest');		
		}


		public function noKartuBpjs()
		{

			$json = file_get_contents('php://input');
			$obj = json_decode($json);

			$noKartu = $this->GetJsonObject($obj->{'noKartu'}) ;
			$tanggalSep= $this->GetJsonObject($obj->{'tanggalSep'}) ;	
			$url = 'Peserta/nokartu/'.$noKartu.'/tglSEP/'.$tanggalSep;
			echo $this->HttpRequest("GET",$url) ;		
		}

		public function nik()
		{

			$json = file_get_contents('php://input');
			$obj = json_decode($json);

			$nik = $this->GetJsonObject($obj->{'nik'}) ;
			$tanggalSep= $this->GetJsonObject($obj->{'tanggalSep'}) ;	
			
			$url = 'Peserta/nik/'.$nik.'/tglSEP/'.$tanggalSep;
			echo $this->HttpRequest("GET",$url) ;		
		}
	
        public function HttpRequest($method,$endPoint,$params="",$contentType="application/x-www-form-urlencoded")
		{			
			echo $this->libhttprequest->vclaim($method,$endPoint,$params,$contentType);
			exit();			
		}
	
		function GetJsonObject($obj){
			return isset($obj) ? $obj : ""; 
		}
	
	
	
	
	
	
	
	
	

}