<?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'] < 3) {
header('location:/');
die();
}
if ($b == false){
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'])) {
DB::$dbs->query("UPDATE blogger SET activ = ?, activ_who = ? WHERE id = ? LIMIT 1", [0,$b['id'],abs((int)$_GET['da'])]);
header('location: ?');
die();
}
if (isset($_GET['no'])) {
DB::$dbs->query("UPDATE blogger SET activ = ?, activ_who = ? WHERE id = ? LIMIT 1", [2,$b['id'],abs((int)$_GET['no'])]);
header('location: ?');
die();
}
$total = DB::$dbs->querySingle("SELECT COUNT(id) FROM blogger WHERE activ = ?", [1]);
if ($total == 0) echo '<div class="error">Никого на модерации нет!</div>';
$sql = DB::$dbs->query("SELECT * FROM blogger WHERE activ = ? ORDER BY id DESC", [1]);
while($a = $sql ->fetch()) {
$tst = DB::$dbs->querySingle("SELECT COUNT(id) FROM blogger WHERE ip = ?", [$a['ip']]);
$IP = ($tst > 0) ? '<span class="color:#FF3030;"><a href="klon.php?ip='.$a['ip'].'">' .$a['ip'] . '</a></span>' : $a['ip'];
echo '<div class="row text_box"><i class="md-shuffle"></i>  '.Nick($a['id']).'</br> &#187; '.$IP.' <strong><span style="color:#ff0000;">[Обязательно!]</span></strong><br/>'.$a['soft'].'</br> <i class="md-shuffle"></i> <a href="?da='.$a['id'].'">[Допустить]</a> / <a href="?no='.$a['id'].'">[Отклонить]</a><br/></div>';
}

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


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