<?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();
}
echo '<div class="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i><a href="/"style="text-decoration:none; color:white;"> Главная</a> :: <a href="/administration/"style="text-decoration:none; color:white;"> Дата-центр</a> :: Подтверждение регистрации</div></div></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="alert alert-danger">Никого на модерации нет!</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="list-group-item media"><i class="zmdi zmdi-shuffle"></i>  '.Nick($a['id']).'</br> &#187; '.$IP.' <strong><span style="color:#ff0000;">[Обязательно!]</span></strong><br/>'.$a['soft'].'</br> <i class="zmdi zmdi-shuffle"></i> <a href="?da='.$a['id'].'">[Допустить]</a> / <a href="?no='.$a['id'].'">[Отклонить]</a><br/></div>';
}


$title->GetMenu();
$title->GetFooter();
?>
