<?php
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
$title->SetTitle('Панель управления - Модерация мошенников');

///Подключаем шапку
$title->GetHeader();
if ($b['level'] < 4) {
header('location:/');
die();
}
echo '<div class="container-fluid page_header"><div class="container"><div class="row"><div class="col-xs-12 col-sm-8 col-md-9 col-lg-9"><h1>Панель управления </h1><ol class="breadcrumb" xmlns:v="http://'.homeurl.'/#"><li typeof="v:Breadcrumb"><a href="/" rel="v:url" property="v:title">'.homeurl.'</a></li><li typeof="v:Breadcrumb"><a href="/panel" rel="v:url" property="v:title">Дата-центр</a></li><li class="active" typeof="v:Breadcrumb"><span property="v:title">Модерация мошенников</span></li></ol></div></div></div></div>';
echo'<div class="container page_body"><div class="row"><div class="col-xs-12 page_content col-lg-9"><div class="navbar page_content_navbar collapse hidden-lg"><div class="container-fluid"><div class="navbar-collapse"></div></div></div><div class="text_box hidden-lg pr_block_small hidden"></div><div class="container-fluid cols_table">';

echo '<div class="catSides"><a href="/panel"><i class="md-format-list-bulleted"></i> Админка</a> - Модерация мошенников</div>';

if (isset($_GET['da'])) {
$in = DB :: $dbs -> queryFetch("SELECT * FROM ked WHERE id = ? LIMIT 1",[intval($_GET['da'])]);
DB :: $dbs -> query ("UPDATE ked SET type = ? WHERE id = ?",array(1,abs(intval($_GET['da']))));
DB::$dbs -> query ("UPDATE blogger SET mosh = ? WHERE id = ?",array(1,$in['user_id']));
lenta(Nick($b['id']).' добавил '.Nick($in['user_id']).' в базу мошенников.');
header('location: ?');
}
if (isset($_GET['net'])) {
DB :: $dbs -> query ("DELETE FROM ked WHERE id = ?",array(abs(intval($_GET['net']))));
header('location: ?');
}
$look = DB :: $dbs -> querySingle("SELECT COUNT(id) FROM ked WHERE type = ?",[0]);
$num = 10;
$k_page = k_page($look, $num);
$page = page($k_page);
$start = $num*$page-$num;
if ($look == 0) {
echo '<div class="error">Нет мошенников модерации!</div>';
} else {
$query = DB :: $dbs -> query("SELECT * FROM ked WHERE type = ? ORDER BY id DESC LIMIT $start,$num",[0]);
while ($a = $query -> fetch()) {
echo '<div class="row text_box"><i class="md-shuffle"></i> <a href="/blacklist/view.php?id='.$a['id'].'"> Мошенник '.$a['nick'].'</a></br><i class="md-shuffle"></i> <a href="?da='.$a['id'].'"> [Подтвердить]</a> / <a href="?net='.$a['id'].'">[Отклонить]</a></div>';
}
if ($k_page>1) {
str('?', $k_page,$page);
}
}

///Подключаем меню
$title->GetMenu();


///Подключаем футер
$title->GetFooter();
?>
