Файл: zfarm.mobi/inc/collective/rat_ct.php
Строк: 94
<?
$title='Рейтинг';
include_once '../system/config.php';
$mcu =mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective_user` WHERE `id_user` = '$ku[id]'"));
$ct =mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective` WHERE `id` = '".intval($_GET['rat_ct'])."'"));
if(isset($_GET['rat_ct']) && ($_GET['rat_ct'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective` WHERE `id` = '".($_GET['rat_ct'])."' LIMIT 1"),0)!=0){
$sort='rating';
$sort2='&rating';
if(isset($_GET['rating_week'])){$sort='rating_week';$sort2='&rating_week';}
if(isset($_GET['tehnika'])){$sort='tehnika';$sort2='&tehnika';}
if(isset($_GET['rating_gos'])){$sort='rating_gos';$sort2='&rating_gos';}
echo"<div class='rzd2'></div><div class='menuin2'>";
echo "<div class='title'><a href='/kolhoz/$ct[id]'>Рейтинг по ".($sort=='rating'?"опыту за всё время":null)."".($sort=='rating_week'?"опыту за неделю":null)."".($sort=='tehnika'?"механизации":null)."".($sort=='rating_gos'?"урожаю на госзаказ":null)."</a></h2></div>";
?>
<div class="content">
<div class="div">
<ul>
<?
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_user` WHERE `id_collective` = '$ct[id]'"),0);
if ($k_post==0)
{
echo "Список пуст...";
}
$k_page=450000;
$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_user` WHERE `id_collective` = '$ct[id]' ORDER BY `$sort` DESC LIMIT $start, $set[p_str]");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
$num++;
$uuk=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$post[id_user]'"));
echo "<li><span class='minor'><span>$num</span>.</span><span>";
echo "".on_k($uuk['id'])."";
echo " <a class='' href='/user/$uuk[id]'>".nc($uuk['id'])."</a> <span class='n'><span class='n'>".rating($post[$sort])."</span></span></li>";
}
echo "</ul>";
echo "<div class='pt'>n
<ul><br>n
<li><img src='/img/icons/clock.png' alt='o'> ".($sort!='rating'?"<a href='/kolhoz/info/$ct[id]/rating'>":"<span>")."Опыт за всё время".($sort!='rating'?"</a>":"</span>")."</li>n
<li><img src='/img/icons/clock_week.png' alt='o'> ".($sort!='rating_week'?"<a href='/kolhoz/info/$ct[id]/rating/RatingWeek'>":"<span>")."Опыт за неделю".($sort!='rating_week'?"</a>":"</span>")."</li>n
<li><img src='/img/icons/rating.png' alt='o'> ".($sort!='tehnika'?"<a href='/kolhoz/info/$ct[id]/rating/tehnika'>":"<span>")."Механизация".($sort!='tehnika'?"</a>":"</span>")."</li>n
<li><img src='/img/icons/rating.png' alt='o'> ".($sort!='rating_gos'?"<a href='/kolhoz/info/$ct[id]/rating/RatingGos'>":"<span>")."Урожай на госзаказ".($sort!='rating_gos'?"</a>":"</span>")."</li>n
</ul>n
</div>n
</div>n";
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
}
?>