Файл: app/admin/list/admins.php
Строк: 19
<?php
Core::only('level', 1);
$smarty->header('Администрация');
$all = $db->query("SELECT `id` FROM `users` WHERE `level` != '0'")->rowCount();
$pages = new Pages($all, $config['pages']);
$query = $db->query("SELECT * FROM `users` WHERE `level` != '0' ORDER BY `level` DESC LIMIT " . $start . ", " . $config['pages']);
while ($list = $query->fetch())
{
$options = null;
if (isset($user) && $user['id'] != $list['id'])
{
$options[] = [
'url' => '/mail/chat?id=' . $list['id'],
'title' => Lang::word('Написать сообщение')
];
}
if (isset($user) && $user['level'] > $list['level'])
{
$options[] = [
'url' => '/admin/user/control?id=' . $list['id'],
'title' => Lang::word('Управление профилем')
];
}
$level = [
1 => 'Модератор',
2 => 'Администратор',
3 => 'Главный администратор',
4 => 'Создатель'
];
$posts[] = [
'image' => User::photo($list['id']),
'title' => User::login($list['id']),
'post' => Lang::word($level[$list['level']]),
'options' => $options
];
}
if ($all == 0)
$posts[] = [
'title' => 'Нет пользователей.'
];
$smarty->assign([
'post' => $posts
]);
$smarty->display('posts.tpl');
$pages->view('?');
$smarty->footer();