<?php
	
	header('Content-type: application/json');
	$path="./../../";
	include_once($path."db/conn.php");
	if(isset($_GET["q"]) ){
		include_once($path."inc/".trim($_GET["q"]).".php");
		$result = $conn->query($sql);
		$outp=array();
		while($rs = $result->fetch_array(MYSQLI_ASSOC)) {
			array_push($outp,$rs);
		}
		echo json_encode($outp);
	}
	if(isset($_GET["v"]) ){
		include_once($path."inc/".trim($_GET["v"]).".php");
		$result = $conn->query($sql);
		$outp=array();
		//while(
		$rs = $result->fetch_array(MYSQLI_ASSOC);//) {
		//	array_push($outp,$rs);
		//}
		echo($rs['json']);
	}
	if(isset($_GET["i"]) ){
		include_once($path."inc/".trim($_GET["q"]).".php");
		$result = $conn->query($sql);
	}
	
	include_once($path."db/conn.php");
	if(isset($_GET["d"]) ){
		include_once($path.trim($_GET["d"]).".php");
		$result = $conn->query($sql);
	}
	
	$conn -> close();

?>
