<?php
session_start();

if(!isset($_SESSION["login"]))
	die("Доступ запрещен!");

define("PATH", $_SERVER['DOCUMENT_ROOT']);
include(PATH."/core/func.php");
include(PATH."/core/db.php");
include(PATH."/core/set.php");
include(PATH."/core/define.php");
include(PATH."/core/defineset.php");

db_connect();
$res = db_query("SELECT `status` FROM `".DBpref."users` WHERE `login` = '".db_string($_SESSION["login"])."'");
db_close();
$res = db_assoc($res);
if($res["status"] == 0)
	die("Доступ запрещен!");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="../admin/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../admin/jquery-1.9.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
</head>

<body>
<style type="text/css">
.table1 td{padding:2px;}
</style>
<table width="980px" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="250px">
		<a href="../admin/?p=users">Пользователи</a><br />
		<a href="../admin/?p=cesh">Вывод средств</a><br />
		<a href="../admin/?p=news">Новости</a><br />
		<a href="../admin/?p=tickets">Тикеты</a><br />
		<a href="../admin/?p=set">Настройка</a><br />
	</td>
	<td>
	<?php
		$page = isset($_GET["p"])?htmlspecialchars($_GET["p"]):"";
		
		switch ($page) {
    	
		case "":
        $page = "index.php";
        break;
		
		case "users":
        $page = "users.php";
        break;
		
		case "cesh":
        $page = "cesh.php";
        break;
		
		case "news":
        $page = "news.php";
        break;
		
		case "tickets":
        $page = "tickets.php";
        break;
		
		case "set":
        $page = "set.php";
        break;
    	
		default:
		$page = "404.php";
}

		include("page/".$page);
	?>
	</td>
  </tr>
</table>
</body>
</html>