<div class="event"><h1>Картели</h1></div>
<?
$sort='rating';
$sort2='&rating';
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 `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 `kolhoz_collective` ORDER BY `$sort` DESC, `time` 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> <a href='?collective=$post[id]'><span>".hsc($post['name'])."</span></a> <span class='title'>".rating($post["$sort"])."</span>
</div>";
}
echo "</ul>";
if ($k_page>1)str("?collectives$sort2&",$k_page,$page); // Вывод страниц
?>
<ul>
<?
?>
<div class='block'><img width="16" height="16" src="images/icons/plus_small.png" alt="o"> <a href="?collective_create">Создать новый Картель</a></div>
</ul>
</div>
<?
include_once 'inc/foot.php';
?>