<div class="event"><h1>Колхозы</h1></div>
<div class="content">
<div class="block">
<ul>
<?
$sort='rating';
$sort2='';
if(isset($_GET['tehnika'])){$sort='tehnika';$sort2='&tehnika';}
if(isset($_GET['rating_gos'])){$sort='rating_gos';$sort2='&rating_gos';}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `$db_base`.`kolhoz_collective`"),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_collective` ORDER BY `$sort` DESC, `time` DESC LIMIT $start, $set[p_str]");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
$num++;
echo "<li>
<span class='minor'><span>$num.</span></span> <a href='?collective=$post[id]'><span>".hsc($post['name'])."</span></a> <span class='title'>".rating($post["$sort"])."</span>
</li>";
}
echo "</ul>";
if ($k_page>1)str("?collectives$sort2&",$k_page,$page); // Вывод страниц
?>
<h3>Рейтинг по:</h3>
<ul>
<?
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> ".($sort!='rating'?"<a href='?collectives'>":"<span>")."Опыту".($sort!='rating'?"</a>":"</span>")."</li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> ".($sort!='tehnika'?"<a href='?collectives&tehnika'>":"<span>")."Механизации".($sort!='tehnika'?"</a>":"</span>")."</li>";
echo "<li><img width='16' height='16' src='images/icons/rating.png' alt='o'> ".($sort!='rating_gos'?"<a href='?collectives&rating_gos'>":"<span>")."Госзаказам".($sort!='rating_gos'?"</a>":"</span>")."</li>";
?>
<li class="pt"><img width="16" height="16" src="images/icons/search.png" alt="o"> <a href="?search_collective">Поиск колхоза</a></li>
<li><img width="16" height="16" src="images/icons/plus_small.png" alt="o"> <a href="?collective_create">Создать новый колхоз</a></li>
</ul>
</div>
<?
include_once 'inc/foot.php';
?>