<?php
if(count(get_included_files()) ==1) exit("Direct access not permitted.");
if(isset($_POST['ikdata'])){
	if (!isset($_SESSION)) session_start();
	$db=pDatabase::getInstance();
	$datafungsi=[
		"simpannomorsurat"=>"simpannomorsurat"
	];
	
	if(!$db->ceckmodule($cl)) exit;
	$data=$_POST['ikdata'];
	$ex=false;
	if(isset($datafungsi[$data[0]])) $ex=$datafungsi[$data[0]]($data,$cl);
	echo $ex;
}else{
	echo false;
}

function simpannomorsurat($data){
	$db=pDatabase::getInstance();
	$datanomor=json_encode($data['datanomor'],true);
	
	$query="insert into tb_setting (id,setting) values (15,?) on duplicate key update setting=?";
	$rs=$db->query($query,array($datanomor,$datanomor));
	return $rs;
}


?>