Файл: zfarm.mobi/inc/center/collectives.php
Строк: 77
<?
$title='Рейтинг колхозов';
include_once '../system/config.php';
echo"<div class='rzd2'></div><div class='menuin2'>";
echo'<div class="title">Колхозы</h2></div>
<div class="content">
<div class="div">';
echo "<li><img src='/img/icons/search.png' alt='o'> <a href='/SearchKolhoz'>Поиск колхоза</a></li></div>";
echo'<div class="block">';
?>
<?
$sort='rating';
$sort2='ratings';
if(isset($_GET['tehnika'])){$sort='tehnika';$sort2='tehnika';}
if(isset($_GET['rating_gos'])){$sort='rating_gos';$sort2='rating_gos';}
if(isset($_GET['MedalRating'])){$sort='MedalRating';$sort2='MedalRating';}
$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 "<li>
<span class='minor'><span>$num.</span></span>";
if($post['medal']>0)echo "<img alt='o' src='/img/medal/$post[medal].png'>";
echo"
<a href='/kolhoz/$post[id]'><span>".hsc($post['name'])."</span></a> <span class='n'>".rating($post["$sort"])."</span>
</li>";
}
echo "</ul>";
if ($k_page>1)str("/RatingKolhoz/$sort2/",$k_page,$page); // Вывод страниц
?>
<h3>Рейтинг по:</h3>
<ul>
<?
echo "<li><img src='/img/icons/rating.png' alt='o'> ".($sort!='rating'?"<a href='/RatingKolhoz/'>":"<span>")."Опыту".($sort!='rating'?"</a>":"</span>")."</li>";
echo "<li><img src='/img/icons/rating.png' alt='o'> ".($sort!='tehnika'?"<a href='/RatingKolhoz/tehnika'>":"<span>")."Механизации".($sort!='tehnika'?"</a>":"</span>")."</li>";
echo "<li><img src='/img/icons/rating.png' alt='o'> ".($sort!='rating_gos'?"<a href='/RatingKolhoz/ratingGos'>":"<span>")."Госзаказам".($sort!='ratingGos'?"</a>":"</span>")."</li>";
echo "<li><img src='/img/icons/rating.png' alt='o'> ".($sort!='MedalRating'?"<a href='/RatingKolhoz/MedalRating'>":"<span>")."Медалям".($sort!='MedalRating'?"</a>":"</span>")."</li>";
?>
<li><img src="/img/icons/plus_small.png" alt="o"> <a href="/CreateKolhoz">Создать новый колхоз</a></li>
</ul>
</div>
<?
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
?>