<?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="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>';
$k_post = DB::$dbs->querySingle("SELECT COUNT(id) FROM `down_votes`");
if ($k_post == 0) {
err('Голосовавших нет!');
}
$num = 10;
$k_page = k_page($k_post, $num);
$page = page($k_page);
$start = $num*$page-$num;
$array = DB::$dbs->query("SELECT * FROM `down_votes` ORDER BY time DESC LIMIT $start,$num");
while($arr = $array -> fetch()) {
$tst = DB::$dbs->queryFetch("SELECT * FROM downs WHERE id = ? LIMIT 1", [$arr['id_file']]);
echo '<div class="list-group-item media"> '.Nick($arr['user_id']).' ('.vr($arr['time']).') '. ($arr['type'] == 'za' ? '<font color="green"><b>+1</b></font>':'<font color="red"><b>-1</b></font>').'<br/>Комментарий: '.text($arr['text']).'<br/>Файл: <a href="/downs/file.html?id='.$tst['id'].'">'.$tst['name'].'</a></div>';
}
if ($k_page > 1) {
str('?',$k_page,$page);
}
$title->GetMenu();
$title->GetFooter();
?>