<?

include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/adm_check.php';
include_once '../sys/inc/user.php';

user_access('adm_show_adm',null,'index.php?'.SID);
adm_check();

$set['title']='Администрация';
include_once '../sys/inc/thead.php';
title();
aut();

$k_post=mysql_result(mysql_query("SELECT COUNT(`user`.`id`) FROM `user` LEFT JOIN `user_group` ON `user`.`group_access` = `user_group`.`id` WHERE `user_group`.`level` != 0 AND `user_group`.`level` IS NOT NULL"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];

echo "<table class='post'>\n";

if ($k_post==0){
echo '<div class="block">Нет администрации</div>';
}

$q=mysql_query("SELECT `user`.`id` FROM `user` LEFT JOIN `user_group` ON `user`.`group_access` = `user_group`.`id` WHERE `user_group`.`level` != 0 AND `user_group`.`level` IS NOT NULL ORDER BY `user_group`.`level` DESC LIMIT $start, $set[p_str]");

while ($ank = mysql_fetch_assoc($q)){
$ank=get_user($ank['id']);

echo '<table class="block2">';
echo '<td class="block_avatar">';
echo ''.avatar($ank['id']).'</a> <span class="avatar_icon">'.online($ank['id']).'</span>';
echo '</td>';
echo '<td class="block_info">';
echo '<span class="nick">'.user::nick($ank['id']).'</span>';
echo '<div class="block_msg">';
echo '<span style="color: #828282; font-size: 14px;">';
echo ''.$ank[group_name].'';
echo '</span>';
echo '</div>';
echo '</td>';
echo '</table>';

}

//Вывод страниц
if ($k_page>1)str("?",$k_page,$page); 

if (user_access('adm_panel_show')){
echo '<a class="link3" href="/adm_panel/"><i class="material-icons icon">keyboard_arrow_left</i> Админ панель</a>';
}

include_once '../sys/inc/tfoot.php';

?>