<?
echo "<div class='event'><h1>Онлайн</h1></div>";
echo "<div class='content'>";
echo "<div class='block'>";
echo "<div class='block'>".(isset($_GET['admin'])?"<a href='?online'>Все</a>":"<span>Все</span>")." | ".(isset($_GET['admin'])?"<span>Админы онлайн</span>":"<a href='?online&admin'>Админы онлайн</a>")."";

echo "| <a href='?admin_list'>Список админов</a></div>";
$k_post = mysql_result(mysql_querll("SELECT COUNT(`id`) FROM `kolhoz_user` WHERE `date_last`>'".(time()-600)."'"),0);
if ($k_post==0){echo 'Список пуст...';}

$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];

$q = mysql_querll("SELECT `id` FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."'".(isset($_GET['admin'])?" AND `kolhoz_user`.`status` > '0'":null)." ORDER BY `id` LIMIT $start, $set[p_str]");

while($post = mysql_fetch_array($q)){
$kh_info = mysql_fetch_assoc(mysql_querll('SELECT `id_collective` FROM `kolhoz_collective_user` WHERE `id_user`="'.$post['id'].'"'));
//echo '<div class="block">'.on_k($post['id']).' <a class="" href=?user='.$post['id'].'>'.nc($post['id']).'</a>';
//=============Тест



$ban = mysql_fetch_array(mysql_querll("SELECT * FROM `kolhoz_ban` WHERE `id_user` = '$post[id]' AND (`time` > '$time' OR `izg` = '1') ORDER BY `id` DESC LIMIT 1"));
$us_ban = mysql_fetch_array(mysql_querll("SELECT * FROM `kolhoz_user` WHERE `id` = '$ban[id_who]'"));

if($ban['id']){
//echo on_k($post['id']);
echo '<div class="block">'.on_k($post['id']).' <a class="" href=?user='.$post['id'].'><STRIKE>'.nc($post['id']).'</STRIKE></a>';
//echo med($post['id']);
}
else
if($post['id']){



//========================Итог
echo '<div class="block">'.on_k($post['id']).' <a class="" href=?user='.$post['id'].'>'.nc($post['id']).'</a>';
}//Тест
echo " ".med($post['id'])."";
echo ''.($kh_info['id_collective']==''?'<img alt="o" width="16" height="16" src="img/nocollective.png"/>':null).''."\n";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `id` = '$post[id]' AND `date_last` > '".(time()-600)."' LIMIT 1"),0)==1)
echo " <img src='img/icons/online.gif' alt='' class='*'/> ";

echo " [<a href='?mail&new_msg=$post[id]'>Написать</a>]";

echo "</div>";
}

if ($k_page>1)str("?online".(isset($_GET['admin'])?"&admin":null)."&",$k_page,$page); // Вывод страниц
echo '</div></div>';
include_once 'inc/foot.php';
?>