<?php
define('NTLCMS', 1);
$module = 'panel';
include ('../system/start.php');
include ('../system/function.php');
include ('../system/antidos.php');
include ('../system/head.php');
################################################################################
if ($active && $_USER['admin'] == '1'){
################################################################################
echo '<div class="title"><b>'.razd.' Админ-Панель</b></div>';
################################################################################

$news = DB :: run() -> queryFetch("select (`date`) from `news` where `id` order by `id` desc limit 1");
$inpayment = DB :: run() -> querySingle("select count(`id`) from `inmoney`");
$outpayment = DB :: run() -> querySingle("select count(`id`) from `payment` where `status` = ?", array('moder'));
$siteall = DB :: run() -> querySingle("select count(`id`) from `sites`");
$banners = DB :: run() -> querySingle("select count(`id`) from `banner`");
$managers = DB :: run() -> querySingle("select count(`id`) from `manager`");
$banip = DB :: run() -> querySingle("select count(`id`) from `banip`");
$banlist = DB :: run() -> querySingle("select count(`id`) from `ban`");
//$multi = DB :: run() -> query("SELECT ip, COUNT(ip) FROM users GROUP BY ip");
$sitemod = DB :: run() -> querySingle("select count(`id`) from `sites` where `status` = ?", array(2));
$ver_core =  VERSION ;

echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_news">Новости клуба</a> <span class="count">'.date('d.m.Y', $news['date']).'</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_syslog">Логи клуба</a> <span class="count">10</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_multi">Мультиаккаунты</a> <span class="count">?</span></div>';

echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_members">Пользователи</a> <span class="count">'.USERS().'</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_settings">Настройки клуба</a> <span class="count">12</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_spam">Массовая рассылка</a> <span class="count">!</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_delete">Удаление юзера</a> <span class="count">FULL</span></div>';

echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_banip">Бан по IP</a> <span class="count">'.$banip.'</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_ban">Бан/Разбан</a> <span class="count">'.$banlist.'</span></div>';

echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_deposit">Ввод средств</a> <span class="count">'.$inpayment.'</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_withdrawal">Заявки на вывод</a> <span class="count">'.$outpayment.'</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_sitelist">Список сайтов</a> <span class="count">'.$siteall.'</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_modsites">Модерация сайтов</a> <span class="count">'.$sitemod.'</span></div>';

echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_modules">Модули клуба</a> <span class="count">4</span></div>';
echo '<div class="menu"><i class="fa fa-dot-circle-o fa-fw"></i> <a href="'.URL.'/_truncate">Очистка модулей</a> <span class="count">8</span></div>';

echo '<div class="block"><i class="fa fa-home fa-fw"></i> <a href="'.URL.'/cabinet">В кабинет</a></div>';
################################################################################
} else {
echo '<div class="title"><center>Проверка прав доступа</center></div>';
echo '<div class="menu"><center><i class="fa fa-close fa-fw"></i> Доступ запрещен!</center></div>';
echo '<div class="block"><i class="fa fa-home fa-fw"></i> '.(isset($active) ? '<a href="'.URL.'/cabinet">В кабинет</a>' : '<a href="'.URL.'">На главную</a>').'</div>';
}

include ('../system/foot.php');
?>