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

require_once 'vendor/autoload.php';

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


		public function insert()
		{	
			$json = file_get_contents('php://input');
			$obj = json_decode($json);

			$params = $obj ;

			$url = 'LPK/insert';
			echo $this->HttpRequest("POST",$url,$params) ;		
		}

		public function update()
		{	
			$json = file_get_contents('php://input');
			$obj = json_decode($json);

			$params = $obj ;

			$url = 'LPK/update';
			echo $this->HttpRequest("PUT",$url,$params) ;		
		}

		
		public function delete()
		{	
			$json = file_get_contents('php://input');
			$obj = json_decode($json);

			$params = $obj ;

			$url = 'LPK/delete';
			echo $this->HttpRequest("DELETE",$url,$params) ;		
		}
		
		public function dataLembarPengajuanKlaim()
		{	
			$json = file_get_contents('php://input');
			$obj = json_decode($json);

			$tanggalMasuk = $this->GetJsonObject($obj->{'tanggalMasuk'}) ;
			$jenisPelayanan = $this->GetJsonObject($obj->{'jenisPelayanan'}) ;	
			$url = 'LPK/TglMasuk/'.$tanggalMasuk.'/JnsPelayanan/'.$jenisPelayanan;
			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 : ""; 
		}
	
	
	
	
	
	
	
	
	

}