<?
echo "<div class='event'><h1>Гроверы</h1></div>";
if(isset($_GET['teh']))
{
$sort='tehnika';
$sort2='&teh';
}
elseif(isset($_GET['dost']))
{
$sort='dostig';
$sort2='&dost';
}
else
{
$sort='level';
$sort2=NULL;
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user`"),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'];
$num=($page-1)*$set['p_str'];

$q=mysql_query("SELECT * FROM `kolhoz_user` ORDER BY $sort DESC, rating DESC LIMIT $start, $set[p_str]");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
$num++;
echo "<div class='block'><span class='minor'><span>$num.</span></span> <span>";
echo "<a class='' href='?user=$post[id]'>".nc($post['id'])."</a> <a href='?mail&new_msg=$post[id]'><img src='images/icons/mails.png'></a> <img src='images/level.png'> $post[level]</span></div>";
}
echo "</ul>";
if ($k_page>1)str("?rating$sort2&",$k_page,$page); // Вывод страниц
echo "<div class='block'><h3>Рейтинг по:</h3></div>";
echo "<div class='block'><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating'>Опыту</a></div>";
echo "<div class='block'><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating&dost'>Достижениям</a></div>";
echo "<div class='block'><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating&teh'>Механизации</a></div>";
echo "</div>";
include_once 'inc/foot.php';
?>