<?
echo "<div class='event'><h1>Онлайн</h1></div>";
echo "<div class='content'>";
echo "<div class='block'>";

$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]");
echo "<ul>";

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 '<li>'.on_k($post['id']).' <a class="" href=?user='.$post['id'].'>'.nc($post['id']).'</a>'.($kh_info['id_collective']==''?'<img alt="o" width="16" height="16" src="images/nocollective.png"/>':null).'</li>'."\n";
}

echo "</ul>";
if ($k_page>1)str("?online".(isset($_GET['admin'])?"&admin":null)."&",$k_page,$page); // Вывод страниц
echo "<div class='pt'>".(isset($_GET['admin'])?"<a href='?online'>Все</a>":"<span>Все</span>")." | ".(isset($_GET['admin'])?"<span>Администрация</span>":"<a href='?online&admin'>Администрация</a>")."</div>";

echo '</div></div>';
include_once 'inc/foot.php';
?>