Ямка, <?
include_once \'../sys/inc/start.php\';
include_once \'../sys/inc/compress.php\';
include_once \'../sys/inc/sess.php\';
include_once \'../sys/inc/home.php\';
include_once \'../sys/inc/settings.php\';
include_once \'../sys/inc/db_connect.php\';
include_once \'../sys/inc/ipua.php\';
include_once \'../sys/inc/fnc.php\';
include_once \'../sys/inc/user.php\';
echo $user[\'level\'];
$set[\'title\']=\'Битва брендов\'; // заголовок страницы
include_once \'../sys/inc/thead.php\';
include_once \'ini/func.php\';
title();
echo \'<div align=\"center\">\';
$config = mysql_fetch_assoc(mysql_query(\"SELECT * FROM `brand_sett` WHERE `id` = \'1\'\"
);
switch ($_GET[\'act\']) {
# Вывод последней активной битвы
default:
$brand = mysql_fetch_array(mysql_query(\"SELECT * FROM brand WHERE `time` > \'\".$time.\"\'order by id desc LIMIT 1\"
);
if (!empty($brand[\'id\'])) {
include_once \'ini/brand.php\'; # Вывод брендов
echo \'<br/>\';
} else {
echo \"<div class=\'err\'>Активной битвы нет</div><br/>\";
}
echo \'<a href=\"index.php?act=all\">Активные битвы</a></b> [\'.mysql_result(mysql_query(\"SELECT count(*) FROM `brand` WHERE `time` > \'\".$time.\"\'\"
, 0).\']<br/>\';
echo \'<a href=\"index.php?act=end\">Завершенные битвы</a></b> [\'.mysql_result(mysql_query(\"SELECT count(*) FROM `brand` WHERE `time` < \'\".$time.\"\'\"
, 0).\']<br/>\';
if ($user[\'level\']>=3) echo \'<br/><a href=\"apanel.php\"><b>Админка</a></b><br/>\';
break;
# Все активные битвы
case \'all\':
$all = mysql_result(mysql_query(\"SELECT count(*) FROM `brand` WHERE `time` > \'\".$time.\"\'\"
, 0);
if($all == 0) {
echo \'Битвы еще не созданы\';
} else {
if($all){
$onpage = $config[\'pages\'];
$allpage = ceil($all/$onpage);
$this_page = (isset($_GET[\'p\'])) ? intval($_GET[\'p\']) : 1 ;
if($this_page < 1 || $this_page > $allpage)$this_page = 1;
$start = $this_page*$onpage - $onpage;
$result = mysql_query(\"SELECT * FROM brand `brand` WHERE `time` > \'\".$time.\"\' order by id desc limit \".num($start).\",\".num($onpage).\"\"
;
while($brand = mysql_fetch_assoc($result)){
include \'ini/brand.php\'; # Вывод брендов
echo \'<hr>\';
}
echo \'<br/><b>Страницы:</b> \' . navigation($allpage,\"index.php?act=all&p={p}\",1,1);
}
}
echo \'<br/><a href=\"index.php\">Основное меню</a></b><br/>\';
echo \'<a href=\"index.php?act=all\">Завершенные битвы</a></b> [\'.mysql_result(mysql_query(\"SELECT count(*) FROM `brand` WHERE `time` < \'\".$time.\"\'\"
, 0).\']<br/>\';
break;
# Все завершенные битвы
case \'end\':
$all = mysql_result(mysql_query(\"SELECT count(*) FROM `brand` WHERE `time` < \'\".$time.\"\'\"
, 0);
if($all == 0) {
echo \'Завершенных битв нет\';
} else {
if($all){
$onpage = $config[\'pages\'];
$allpage = ceil($all/$onpage);
$this_page = (isset($_GET[\'p\'])) ? intval($_GET[\'p\']) : 1 ;
if($this_page < 1 || $this_page > $allpage)$this_page = 1;
$start = $this_page*$onpage - $onpage;
$result = mysql_query(\"SELECT * FROM brand `brand` WHERE `time` < \'\".$time.\"\' order by id desc limit \".num($start).\",\".num($onpage).\"\"
;
while($brand = mysql_fetch_assoc($result)){
include \'ini/brand.php\'; # Вывод брендов
echo \'<hr>\';
}
echo \'<br/><b>Страницы:</b> \' . navigation($allpage,\"index.php?act=end&p={p}\",1,1);
}
}
echo \'<br/><a href=\"index.php\">Основное меню</a></b><br/>\';
echo \'<a href=\"index.php?act=all\">Активные битвы</a></b> [\'.mysql_result(mysql_query(\"SELECT count(*) FROM `brand` WHERE `time` < \'\".$time.\"\'\"
, 0).\']<br/>\';
break;
}
echo \'</div>\';
include_once \'../sys/inc/tfoot.php\';
?>
вот,