<?
$max = $level['rating'];
$tek = $kr;
$forl = ($tek/$max)*100;
echo '<div style="border:1px solid #55A855;margin-top:2px;">';
echo '<div class="expline" style="width:'.$forl.'%;"/>';
echo "</div>";
echo "</div>";
echo "</div>";
echo "<div class='block'>";
echo "<img width='16' height='16' src='images/icons/seat.png' alt='o'> <a href='?myfarm'>Плантации</a> ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `time_water` < '$time' OR `time` < '$time' OR (`time_soil` = '$time' AND `soil` = '0') OR (`time_soil` < '$time' AND `soil` = '0'))"),0)!=0?"<span class='title'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_ground` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = '$time' OR `time` = '$time' OR `time_water` < '$time' OR `time` < '$time' OR (`time_soil` = '$time' AND `soil` = '0') OR (`time_soil` < '$time' AND `soil` = '0'))"),0).")</span>":null)."</div>";
{
$count_mon=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0' AND (`time_money` = '$time' OR `time_money` < '$time')"),0);
$q=mysql_query("SELECT * FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
$count_gol=0;
while($post=mysql_fetch_array($q))
{
$max_time=$time+$post['level']*(3600*1);
$mezh_time=$max_time-$post['time'];
if($mezh_time>=1*3600)$count_gol++;
}
$q=mysql_query("SELECT * FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
$count_mon=0;
while($post=mysql_fetch_array($q))
{
$d_money=floor($post['time_money2']/(1*3600));
if($d_money>0)$count_mon++;
}
if($count_gol>$count_mon)$count_zag=$count_mon;else $count_zag=$count_mon;
echo "<div class='block'><img width='16' height='16' src='images/polka.png' alt='o'> <a href='?mypetfarm'>Черный Рынок</a></div>";
}
echo '<div class="block"><img width="16" height="16" src="images/zavod/zavod.png" alt="o"> <a href="?myzavod">Завод Раста-Шапок</a></div>';
echo '<div class="block"><img width="16" height="16" src="images/icons/warehouse.png" alt="o"> <a href="?warehouse">Склад</a></div><div class="block"><img width="16" height="16" src="images/icons/center.png" alt="o"> <a href="?center">Главная</a></div>';
echo '<div class="block"><img width="16" height="16" src="images/icons/forum.png" alt="o"> <a href="?forum">Форум</a></div><div class="block"><img width="16" height="16" src="images/icons/chat.png" alt="o"> <a href="?chat">Чат</a></div>';
echo "<div class='block'><img width='16' height='16' src='images/icons/mails.png' alt='o'> <a href='?mail'>Почта</a>".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0?" <span class='title'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0).")</span>":null)."</div>";
echo "<div class='block'>";
echo "".on_k($ku['id'])."";
echo ' <a href="?user='.$ku['id'].'">Мой Гровер</a></div>';
if(isset($mc))
{
echo '<div class="block"><img alt="" width="16" height="16" src="images/icons/guild.png"> <a href="?mycollective">Картель</a></div>
<div class="block"><img width="16" height="16" src="images/icons/chat.png" alt="o"> <a href="?collective='.$mc['id'].'&selsovet">Чат Картеля</a></div>';
}
echo '</ul></div>';

echo "<div class='block small event'><img width='16' height='16' src='images/icons/money.png' alt='o'> <span>$ku[money]</span> <img width='16' height='16' src='images/icons/ruby.png' alt='o'> <span>$ku[rubies]</span> <img width='16' height='16' src='images/icons/".(isset($dexp)?"doubleexp":"experience").".png' alt='o'> <span> ".($ku['level']<$bigl?"".rating($kr)."/".rating($level['rating'])."":"".rating($ku['rating'])."")." </span> ";
echo "".on_k($ku['id'])."";
echo " <span>$ku[level]</span> </div>";
echo "<div></div><div style='text-align:center;'><div class='pt'>Вы вошли как <span>$ku[nick]</span>, <a href='?outlogin=$ku[mdp]'>выйти</a>?</div><div><a href='?teg'>Теги</a> | <a href='?rules'>Правила игры</a> | <a href='?support'>Тех. поддержка</a>".($ku['dostup']==1?" | <a href='?admin'>Админка</a>":null)."</div></div>";
if($ku['status']>=1)echo "<center><a href='/?mod'>Модерирование</a></center>";
echo "<center>Онлайн-игра <span class='epic'>Ганджубасовая ферма</span></center>";
echo "<br><div class='smalltext'><center>Мы не занимаемся пропагандой наркотических веществ.<br>
Мы напоминаем вам, что их нельзя употреблять и тем более распространять.<br><br><img src='images/18+.png'> </center></div>";
echo "</div>";
if(isset($mc))
{
include_once 'inc/next_level_collective.php';
include_once 'inc/count_cash.php';
}
mysql_query("UPDATE `kolhoz_user` SET `flowerbed` = '12' WHERE `flowerbed` > '7'");
mysql_query("UPDATE `kolhoz_user` SET `cultivator` = '12' WHERE `cultivator` > '7'");
mysql_query("UPDATE `kolhoz_user` SET `irregate` = '12' WHERE `irregate` > '7'");
mysql_query("UPDATE `kolhoz_user` SET `soiler` = '12' WHERE `soiler` > '7'");
mysql_query("UPDATE `kolhoz_user` SET `conveyor` = '12' WHERE `conveyor` > '7'");
mysql_query("UPDATE `kolhoz_user` SET `seeder` = '12' WHERE `seeder` > '7'");
mysql_query("UPDATE `kolhoz_user` SET `fooder` = '12' WHERE `fooder` > '7'");
mysql_query("UPDATE `kolhoz_user` SET `harvester` = '12' WHERE `harvester` > '7'");
$count=$ku['flowerbed']+$ku['cultivator']+$ku['irregate']+$ku['soiler']+$ku['conveyor']+$ku['seeder']+$ku['fooder']+$ku['harvester'];
mysql_query("UPDATE `kolhoz_user` SET `tehnika` = '$count' WHERE `id` = '$ku[id]'");
if($ku['time_start']==0 || $ku['time_start']==NULL)mysql_query("UPDATE `kolhoz_user` SET `time_start` = '$time' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `count_cp` = '0' WHERE `time_cp` < '$time'");
mysql_query("UPDATE `kolhoz_user` SET `money` = '".floor($ku['money'])."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_user` SET `rating` = '".floor($ku['rating'])."' WHERE `id` = '$ku[id]'");
mysql_query("UPDATE `kolhoz_collective_user` SET `rubies` = '0' WHERE `rubies` = ''");
include_once 'inc/dostig2.php';
exit;
?>