<?php

/** SQL PANEL VER. 0.01 BETA */

$title = 'SQL';

include_once '../protected/sys.php';


if ($user['id']!=1)
{
	header("Location:/");
	exit;
}

if (isset($_GET['go']))
{
	$sql =  htmlspecialchars(strip_tags($_POST['sql']));

	

	if ($stmtSQLp = $db->noPrepared($sql))
	{
		$_SESSION['info']  = 'SQL  запрос выполнен!';
	} else {
		$_SESSION['error'] = 'Ошибка!';
	}

	header("Location:?");
	exit;
}

?>
<div class ='content'/>
	<center>
		<form action = "?go"  method="post"/>
			<textarea class ='input' name ='sql' placeholder ='SQL query '></textarea>
			<br/>
			<input type ='submit' class ='input' value ='SEND'/>
		</form>
	</center>
</div>

<?php

include_once '../protected/footermain.php'; 