<?php

@ ini_set("max_execution_time", "600");
define('_IN_JOHNCMS', 1);
define('_IN_JOHNADM', 1);

$textl = 'Админ панель';
require_once ('../incfiles/core.php');

if ($rights < 1) {
    header('Location: http://gazenwagen.com/?err');
    exit;
}

require_once ('../incfiles/head.php');
$array = array('usr_reg', 'mod_znak', 'mod_blogs', 'mod_stol','mod_votes','mod_rules', 'usr_adm', 'usr_list', 'usr_del', 'usr_ban', 'usr_search_nick', 'usr_search_ip', 'mod_ads', 'mod_counters', 'mod_news', 'mod_forum', 'mod_chat', 'sys_set', 'sys_smileys', 'sys_access', 'sys_antispy', 'sys_ipban', 'mod_karma', 'sys_flood');
if (in_array($act, $array) && file_exists($act . '.php'))
{
    require_once ($act . '.php');
}
else
{
    echo '<div class="phdr"><b>Админ панель</b></div>';
    echo '<div class="menu">Пользователи</div><div>';
    $regtotal = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `preg`='0'"), 0);
    if ($regtotal)
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <span class="red"><b><a href="index.php?act=usr_reg">На регистрации</a>&nbsp;(' . $regtotal . ')</b></span><br />';
    echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=usr_adm">Администрация</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `rights` >= '1'"), 0) . ')<br />';
    //TODO: Написать показ числа новых
    echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=usr_list">Пользователи</a>&nbsp;(' . mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0) . ')<br />';
    $bantotal = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_ban_users` WHERE `ban_time` > '$realtime'"), 0);
    echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=usr_ban">Бан-панель</a>&nbsp;(' . $bantotal . ')<br />';
    echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=usr_search_nick">Поиск по Нику</a><br />';
    echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=usr_search_ip">Поиск по IP</a><br />';
    echo '</div>';
    echo '<div class="menu">';
    // Блок модулей
    if ($rights >= 7)
	{
        echo 'Модули</div><div>';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_ads">Реклама</a><br />';
        if ($rights == 9)
            echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_counters">Счетчики</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_news">Новости</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_forum">Форум</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_chat">Чат</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_karma">Карма</a><br />';
		echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_blogs">Блоги</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_znak">Знакомства</a><br />';
		echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_stol">Стол заказов</a><br />';
		echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_votes">Опросы</a><br />';
		echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=mod_rules">Правила сайта</a><br />';
        echo '';
    }
    echo '</div>';
    // Блок системных настроек
    if ($rights >= 7)
	{
        echo '<div class="menu">Система</div><div>';
        if ($rights == 9)
            echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=sys_set">Настройки сайта</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=sys_smileys">Обновить смайлы</a><br />';
        //echo '<li><a href="">Очистка</a></li>';
        echo '</div>';
        echo '<div class="menu">Безопасность</div><div>';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=sys_flood">Антифлуд</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=sys_access">Права доступа</a><br />';
        echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=sys_antispy">Сканер антишпион</a><br />';
        if ($rights == 9)
            echo '<img src="' . $home . '/images/act2.gif" width="9" height="9" alt="-" /> <a href="index.php?act=sys_ipban">Бан по IP</a><br />';
        echo '</div>';
    }
}

require_once ('../incfiles/end.php');

?>