<?
echo "<div class='event'><h1>Фермеры</h1></div>";
echo "<div class='content'>";
echo "<div class='block'>";
if(isset($_GET['status']) && ($ank['status']>0))
{
$sort='status';
$sort2='&status';
}
elseif(isset($_GET['al']))
{
$sort='almaz';
$sort2='&al';
}
elseif(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 `$db_base`.`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 `$db_base`.`kolhoz_user` ORDER BY $sort DESC, rating DESC LIMIT $start, $set[p_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]'>".nc($post['id'])."</a> <span class='title'><span class='title'>".rating($post[$sort])."</span></li>";
}
echo "</ul>";
if ($k_page>1)str("?rating$sort2&",$k_page,$page); // Вывод страниц
echo "<h3>Рейтинг по:</h3>";
echo "<ul>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating'>Опыту</a></li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating&dost'>Достижениям</a></li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating&teh'>Механизации</a></li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating&al'>Кристаллам</a></li>";
echo "</ul>";
echo "</div>";
include_once 'inc/foot.php';
?>