<?php
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
$title->SetTitle(homeurl.' - Админ состав');
$title->GetHeader();
if ($b['level'] == 0) {
header('location:/');
die();
}
//echo'<div class="row"><div class="col-sm-6">
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>';


echo'<div class="t-body"><div class="list-group lg-alt">';

//$sql = DB::$dbs->query("SELECT * FROM blogger WHERE level > ? AND id != ? ORDER BY level DESC", [0,1]);
$sql = DB::$dbs->query("SELECT * FROM blogger WHERE level > ? ORDER BY level DESC", [0]);

if ($sql->rowCount() == 0) {
err('никого нет!');
}
while($a = $sql->fetch()) {
$array = [1=>'Модератор', 2=>'Старший модератор', 3=>'Администратор', 4=>'Главный Администратор', 5=>'Разработчик'];

echo'<a href="/users/'.$a['id'].'" class="list-group-item media"><div class="pull-left"><img class="img-circle pull-left" src="/'.(user_inf($a['id'], 'ava') != NULL ? user_inf($a['id'], 'ava') : 'assets/img/4.jpg').'" alt="" width="40" height="40"></div><div class="media-body"><div class="list-group-item-heading">'.$a['name'].' '.$a['family'].'</div><small class="list-group-item-text">('. strtr($a['level'], $array) .')</small></div></a>';

}
                        echo'</div></div>';

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