<?php
if(count(get_included_files()) ==1) exit("Direct access not permitted.");
header("Content-type: application/json");
if(isset($_POST['ikdata'])){
	if (!isset($_SESSION)) session_start();
	$db=pDatabase::getInstance();
	$datafungsi=[
		"cekStatus"=>"cekStatus"
	];
	
	$data=$_POST['ikdata'];
	$ex=false;
	if(isset($datafungsi[$data[0]])) $ex=$datafungsi[$data[0]]($data);
	echo $ex;
}else{
	echo false;
}

function cekStatus($data){
	$db=pDatabase::getInstance();
	$query="select * from tb_update_status where kode=?";
	$rs=$db->loadAssoc($query,array($data['kode']));
	return json_encode($rs,true);
}
?>