<?
echo "<div class='event'><h1>Фермеры</h1></div>";
echo "<div class='content'>";
echo "<div class='block'>";
echo "<div class='feedback'>";
if(isset($_GET['teh']))
{
$sort='tehnika';
$sort2='&teh';
}
elseif(isset($_GET['dost']))
{
$sort='dostig';
$sort2='&dost';
}
elseif(isset($_GET['cook']))
{
$sort='cook_mas';
$sort2='&cook';
}
elseif(isset($_GET['rub']))
{
$sort='rubies';
$sort2='&rub';
}
elseif(isset($_GET['money']))
{
$sort='money';
$sort2='&money';
}
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,$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` ORDER BY $sort DESC, 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]'>".nc($post['id'])."</a> ";
if($post['coll']==0)
{
echo "<img alt='o' width='16' height='16' src='images/nocollective.png'>";
}
echo "<span class='title'>$post[$sort]</span></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>";
if($ku['status']>0)echo "<li><img width='16' height='16' src='images/icons/ruby.png' alt='o'> <a href='?rating&rub'>Рубинам</a></li>";
if($ku['status']>0)echo "<li><img width='16' height='16' src='images/icons/money.png' alt='o'> <a href='?rating&money'>Монетам</a></li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> <a href='?rating&cook'>Кулинарному мастерству</a></li>";
echo "</ul>";
echo "</div>";
include_once 'inc/foot.php';
?>