<?php
define('NTLCMS', 1);
$module = 'task';
include ('../system/start.php');
include ('../system/function.php');
include ('../system/antidos.php');
$page_title = 'Страница заданий - клик клуба ' . strtoupper($_SERVER['HTTP_HOST']);
include ('../system/head.php');
if (!$active){
header('Location: '.URL);
$_SESSION['fail'] = 'Вы не авторизированы!';
exit;
}
echo '<div class="title"><b>'.razd.' Задания пользователей</b></div></div>';
$alljobs = DB :: run() -> querySingle("select count(`id`) from `jobs`");
$alldone = DB :: run() -> querySingle("select count(`id`) from `jobs` where `done` = ?", array(1));
$allcanc = DB :: run() -> querySingle("select count(`id`) from `jobs` where `accept` = ?", array(3));
$allproc = DB :: run() -> querySingle("select count(`id`) from `jobs` where `accept` = ?", array(0));
$mytask = DB :: run() -> querySingle("select count(`id`) from `jobs` where `user` = '$ulogin' and `accept` = '1'"); 
$acttask = DB :: run() -> querySingle("select count(`id`) from `jobs` where `done` = '0' and `accept` = '1'"); 
$mycheck = DB :: run() -> querySingle("select count(`id`) from `jobs_use` where `author` = '$ulogin' and `pay` = '0'"); 
echo '<div class="menu2"><i class="fa fa-briefcase fa-fw"></i> <b>Рекламодателю</b></div>
<div class="menu"><p align="left"><img src="/task/img/rek.png" width="64" height="63" /></p></div>
<div class="menu"><i class="fa fa-angle-double-right fa-fw"></i> <a href="'.URL.'/addtask">Добавить задание</a></div>
<div class="menu"><i class="fa fa-angle-double-right fa-fw"></i> <a href="'.URL.'/checktask">Проверка выполнения</a> <sup class="badge badge-success ">'.$mycheck.'</sup></span></div>
<div class="menu"><i class="fa fa-angle-double-right fa-fw"></i> <a href="'.URL.'/mytask">Ваши задания</a> <span class="right2">'.$mytask.'</span></div>';
echo '<div class="menu2"><i class="fa fa-user-o fa-fw"></i> <b>Пользователю</b></div>
<div class="menu"><p align="left"><img src="/task/img/pol.png" width="64" height="63" /></p></div>
<div class="menu"><i class="fa fa-angle-double-right fa-fw"></i> <a href="'.URL.'/listtask">Список заданий</a> <span class="right2">'.$acttask.'</span></div>
<div class="menu"><i class="fa fa-angle-double-right fa-fw"></i> <a href="'.URL.'/stattask">Статистика выполнений</a></div>';
echo '<div class="menu2"><i class="fa fa-signal fa-fw"></i> <b>Статистика</b></div>
<div class="menu">
<i class="fa fa-angle-right fa-fw"></i> Всего заданий: <b>'.$alljobs.'</b><br/>
<i class="fa fa-angle-right fa-fw"></i> Выполнено заданий: <b>'.$alldone.'</b><br/>
<i class="fa fa-angle-right fa-fw"></i> Отклонено выполнений: <b>'.$allcanc.'</b><br/>
<i class="fa fa-angle-right fa-fw"></i> Ожидают подтверждения: <b>'.$allproc.'</b></div>';
if ($_USER['admin'] > '0' && $_USER['admin'] < '3') echo '<div class="menu"><i class="fa fa-adn fa-fw"></i> <a href="'.URL.'/admintask"><span style="color:red">Модерация заданий</span></a> <span class="right2">'.$allproc.'</span></div>';
echo '<div class="block"><i class="fa fa-home fa-fw"></i> <a href="'.URL.'/cabinet">В кабинет</a></div>';
include ('../system/foot.php');
?>