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

if(isset($_GET['admin']))
{
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `status` > '0'"),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_query("SELECT * FROM `kolhoz_user` WHERE `status` > '0' LIMIT $start, $set[p_str]");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
echo "<li><span>";
echo "".on_k($post['id'])."";
echo " <a class='' href='?user=$post[id]'><span>".nc($post['id'])."</span></a>";
if($post['zvezda']==0)$zvezda='';
if($post['zvezda']>0)
{
echo "<font class='minor'><img  src='images/z/".$post[zvezda].".png'>  $zvezda</font>";
}
else
echo  "<font class='minor'><img width='0' height='0' src='images/avatar/0.png'>$zvezda</font>";
 if($post['coll']==0){echo "<img alt='o' width='16' height='16' src='images/nocollective.png'>";}
echo " <span class='title'>$post[level]</span></li></li>";
}
echo "</ul>";
if ($k_page>1)str("?admins&",$k_page,$page); // Вывод страниц
echo "<div class='pt'>".(isset($_GET['admin']) || isset($_GET['guildFree'])?"<a href='?online'>Все</a>":"<span>Все</span>")." | ".(isset($_GET['guildFree'])?"<span>Не в колхозе</span>":"<a href='?online&guildFree'>Не в колхозе</a>")." | ".(isset($_GET['admin'])?"<span>Администрация</span>":"<a href='?online&admin'>Администрация</a>")."</div>";
echo "</div>";
include_once 'inc/foot.php';
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."'"),0);
if ($k_post==0)
{
echo "Список пуст...";
}
$k_page=k_page($k_post,$pet['s_str']);
$page=page($k_page);
$start=$pet['s_str']*$page-$pet['s_str'];
$num=($page-1)*$pet['s_str'];

$q=mysql_query("SELECT * FROM `kolhoz_user` WHERE  `date_last` > '".(time()-600)."' ".(isset($_GET['guildFree'])?" AND `kolhoz_user`.`coll` = ''":null)." ORDER BY rating DESC LIMIT $start, $pet[s_str]");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
$num++;
echo "<li><span class='minor'><span>$num.</span></span> <span>";
echo "".on_k($post['id'])."";
echo " <a class='' href='?user=$post[id]'><span>".nc($post['id'])."</span></a>";
if($post['zvezda']==0)$zvezda='';
if($post['zvezda']>0)
{
echo "<font class='minor'><img  src='images/z/".$post[zvezda].".png'>$zvezda</font>";
}
else
echo  "<font class='minor'><img width='0' height='0' src='images/avatar/0.png'>$zvezda</font>";
 if($post['coll']==0){echo "<img alt='o' width='16' height='16' src='images/nocollective.png'>";}
echo "  <span class='title'>$post[level]</span> <a href='?mail&new_msg=$post[id]'><img width='16' height='16' src='images/icons/mail_filter_all.png' alt=''></a>";
if($post['stat']!=NULL) echo "<li class='small minor pr'><li>";
echo '</span></li>';
}
echo "</ul>";
if ($k_page>1)str("?online".(isset($_GET['admin'])?"&admin":null)."&",$k_page,$page); // Вывод страниц
echo "<div class='pt'>".(isset($_GET['admin']) || isset($_GET['guildFree'])?"<a href='?online'>Все</a>":"<span>Все</span>")." | ".(isset($_GET['guildFree'])?"<span>Не в колхозе</span>":"<a href='?online&guildFree'>Не в колхозе</a>")." | ".(isset($_GET['admin'])?"<span>Администрация</span>":"<a href='?online&admin'>Администрация</a>")."</div>";
echo "</div>";
include_once 'inc/foot.php';
?>