<?php

/*
* @package BANANA WARS
* @copyright: (c) 2017 G.P. aka Mvcshka (mvcshka@yandex.ru)
* @license: GNU General Public License version 2; see LICENSE.txt
* @files:
*
*/

ob_start();
@session_start();
define("PATH", $_SERVER['DOCUMENT_ROOT']);
include(PATH."/lib/connect.php");
include(PATH."/lib/func.php");

if(!isset($_SESSION['id']) == 1)
{
	Header("Location: /developer/login.php");
	exit;
}

include (PATH."/developer/theme/head.php");

if(isset($_GET['admpage']))
{
	$page = clean($_GET['admpage']);
	switch($page)
	{
		case 'index': include (PATH."/developer/page/index.php"); break;
		case 'login': include (PATH."/developer/page/login.php"); break;
		case 'users': include (PATH."/developer/page/users.php"); break;
		case '404': include (PATH."/developer/page/404.php"); break;
		case 'statvivod': include (PATH."/developer/page/statvivod.php"); break;
		case 'statenter': include (PATH."/developer/page/statenter.php"); break;
		case 'news': include (PATH."/developer/page/news.php"); break;
		case 'konkurs': include (PATH."/developer/page/konkurs.php"); break;
		case 'konkursinv': include (PATH."/developer/page/konkursinv.php"); break;
		default: include (PATH."/developer/page/404.php"); break;
	}
	
}
else
{
	include (PATH."/developer/page/index.php");
}

include (PATH."/developer/theme/foot.php");
?>