<?Error_Reporting (E_ALL & ~E_NOTICE);
echo "</div>";
echo "</div>";

echo '<div class="content">';
echo '<div class="block">';
echo "<ul class='block'>";
echo "<li>";
echo "<img width='16' height='16' src='images/icons/plants.png' alt='o'> <a href='?myfarm'>Огород</a> ".(mysql_result(mysql_querll("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_querll("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)."</li>";
if($ku['level']>=10)
{
$count_mon=mysql_result(mysql_querll("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_querll("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*4);
$mezh_time=$max_time-$post['time'];
if($mezh_time>=4*3600)$count_gol++;
}
$q=mysql_querll("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']/(4*3600));
if($d_money>0)$count_mon++;
}
if($count_gol>$count_mon)$count_zag=$count_mon;else $count_zag=$count_mon;
echo "<li><img width='16' height='16' src='images/icons/animal.png' alt='o'> <a href='?mypetfarm'>Загоны</a> ".($count_zag?"<span class='title'>($count_zag)</span>":null)."</li>";
}

if($ku['level']>=2)echo "<li><img width='16' height='16' src='images/fish/fishs.png' alt='o'> <a href='?ozero'>Пруды</a> ".(mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_pond` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = 'time()' OR `time` = 'time()' OR `time_water` < 'time()' OR `time` < 'time()')"),0)!=0?"<span class='title'>(".mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_pond` WHERE `id_user` = '$ku[id]' AND (`id_plant` = '0' OR `time_water` = 'time()' OR `time` = 'time()' OR `time_water` < 'time()' OR `time` < 'time()')"),0).")</span>":null)."</li>";
if($ku['level']>=20)
{
$count_mon=mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_treeground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0' AND (`time_money` = '$time' OR `time_money` < '$time')"),0);
$q=mysql_querll("SELECT * FROM `kolhoz_treeground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
$count_gol=0;
while($post=mysql_fetch_array($q))
{
$max_time=$time+$post['level']*(3600*4);
$mezh_time=$max_time-$post['time'];
if($mezh_time>=4*3600)$count_gol++;
}
$q=mysql_querll("SELECT * FROM `kolhoz_treeground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
$count_mon=0;
while($post=mysql_fetch_array($q))
{
$d_money=floor($post['time_money2']/(4*3600));
if($d_money>0)$count_mon++;
}
if($count_gol>$count_mon)$count_zag=$count_mon;else $count_zag=$count_mon;
if($ku['level']>=20)echo "<li><img width='16' height='16' src='images/icons/tree.png' alt='o'> <a href='?mytreefarm'>Садок</a> ".($count_zag?"<span class='title'>($count_zag)</span>":null)."</li>";
}
if($ku['level']>=35)echo "<img width='16' height='16' src='images/icons/last_recipes.png' alt='o'> <a href='?mycellar'>Погреб</a> ".(mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ku[id]' AND (`id_plant2` = '0' OR `cultivator2` = '0' OR `time` = '$time' OR `time` < '$time')"),0)!=0?"<span class='title'>(".mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_polka2` WHERE `id_user` = '$ku[id]' AND (`id_plant2` = '0' OR `time_water2` = '$time' OR `time` = '$time' OR `cultivator2` = '0' OR `time` = '$time' OR `time` < '$time')"),0).")</span>":null)."</li>";
echo "<li><img width='16' height='16' src='images/icons/dig.png' alt='o'> <a href='?mywork'>Работа</a></li>";
echo '<li><img width="16" height="16" src="images/icons/warehouse.png" alt="o"> <a href="?warehouse">Амбар</a></li>';
if($ku['level']>=25)echo
'<li><img width="16"
height="16" src="images/icons/cart_remove.png" alt="o"> <a
href="?market">Рынок</a></
li>';
echo '<li><img width="16" height="16" src="images/icons/cart.png" alt="o"> <a href="?shop">Магазин</a></li><li><img width="16" height="16" src="images/icons/center.png" alt="o"> <a href="?center">Город</a></li><br>';


echo "<li><img width='16' height='16' src='images/icons/almaz.png' alt='o'> <a href='?tur'><b>Турнир</b></a><br>";
echo '<li><img alt="" width="16" height="16" src="images/icons/trophy.png"> <a href="?gos">Госзаказ</a><br>';
$count_chat=mysql_result
(mysql_querll("SELECT COUNT(*) FROM `kolhoz_chat` "),0);
$count_forum=mysql_result (mysql_querll("SELECT COUNT(*) FROM `kolhoz_forum` "),0);
echo '</li><div class="title"><img width="16" height="16" src="images/icons/forum.png" alt="o"> <a href="?forum">Форум</a> ('.$count_forum.')</div></li><li>
<img width="16" height="16" src="images/icons/ruby.png" alt="o"> <a href="?payment">Банк</a></li></li><li><li><div class="title"><img width="16" height="16" src="images/icons/chat.png" alt="o"> <a href="?chat">Чат</a> ('.$count_chat.')</div>
</li>';
echo "<br><li><img width='16' height='16' src='images/icons/mails.png' alt='o'> <a href='?mail'>Почта</a> ".(mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0?"<span class='title'>(".mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0).")</span>":null)."</li>";
echo "<li><img width='16' height='16' src='images/icons/favorite.png' alt='o'> <a href='?friends'>Друзья</a></li>";
echo "<li>";
echo "".on_k($ku['id'])."";
echo ' <a href="?user='.$ku['id'].'">Профиль</a></li>';
if(isset($mc))
{


echo '<li><div class="title"><img alt="" width="16" height="16" src="images/icons/guild.png"> <a href="?mycollective">Колхоз</a></div></li>';
$count_selsovet = mysql_result(mysql_querll("SELECT COUNT(*) FROM `kolhoz_collective_chat` WHERE `id_collective` = '$mc[id]'"),0);
echo "<li><div class='title'><img width='16' height='16' src='images/icons/chat.png' alt='o'> <a href='?collective=".$mc['id']."&selsovet'>Сельсовет</a> ($count_selsovet)</div></li>";

}
echo '</div></div>';

echo "<font color='yellow'><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/almaz.png' alt='o'> <span>$ku[almaz]</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></font>";
echo "<div></div><div style='text-align:center;'><div class='pt'>Вы вошли как <span class='epic'>$ku[nick]</span>, <a href='?out'>выйти</a>?<br><br></div><div class='small minor'><div><a href='?forum=1775'>Помощь</a> | <a href='?rules'>Правила</a><br><a href='?support'>Тех. поддержка</a>".($ku['status']==3?" <br><a href='?admin'>Админка</a> | <a href='?mailr'>Рассылка</a>":null)."</div></div>";
session_start();

ob_start();

$page_size = ob_get_length();

ob_end_flush();

if(!isset($_SESSION['traf'])){ $_SESSION['traf'] = 0; }

$_SESSION['traf'] += $page_size;
echo '<div style="text-align:center;" class="pt minor">';
echo " <a href='http://mkolhoz.ru' class='epic'><span class='epic'>mkolhoz.ru</span><br></a>© Все права защищены.<br><span>Онлайн-игра вколхозик</span><br>".date("d.m.y")." | <font color='orange'>".vremja($time)."</font><br>";
echo "<div>Рассказать о нас:</div>";
echo "<script type='text/javascript' src='//yandex.st/share/share.js' charset='utf-8'></script>
<div class='yashare-auto-init' data-yashareL10n='ru' data-yashareType='none' data-yashareQuickServices='yaru,vkontakte,facebook,twitter,odnoklassniki,moimir'></div>";


echo "<div style='text-align:center;' class='pt small minor'>От создателей онлайн игры mkolhoz.ru";


{
include_once 'inc/next_level_collective.php';
include_once 'inc/station_act.php';
include_once 'inc/count_cash.php';
}
mysql_querll("UPDATE `kolhoz_user` SET `flowerbed` = '12' WHERE `flowerbed` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `cultivator` = '12' WHERE `cultivator` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `irregate` = '12' WHERE `irregate` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `soiler` = '12' WHERE `soiler` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `conveyor` = '12' WHERE `conveyor` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `seeder` = '12' WHERE `seeder` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `fooder` = '12' WHERE `fooder` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `fooder` = '12' WHERE `fooder2` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `harvester` = '12' WHERE `harvester` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `conveyor2` = '12' WHERE `conveyor` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `sponder` = '12' WHERE `sponder` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `catchfish` = '12' WHERE `catchfish` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `harvester2` = '12' WHERE `harvester2` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `seeder2` = '12' WHERE `seeder2` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `cultivator2` = '12' WHERE `cultivator2` > '12'");
mysql_querll("UPDATE `kolhoz_user` SET `conveyor2` = '12' WHERE `conveyor2` > '12'");
$count=$ku['flowerbed']+$ku['cultivator']+$ku['cultivator2']+$ku['irregate']+$ku['soiler']+$ku['conveyor2']+$ku['conveyor']+$ku['catchfish']+$ku['sponder']+$ku['seeder']+$ku['seeder2']+$ku['fooder2']+$ku['fooder']+$ku['harvester2']+$ku['harvester'];
mysql_querll("UPDATE `kolhoz_user` SET `tehnika` = '$count' WHERE `id` = '$ku[id]'");
if($ku['time_start']==0 || $ku['time_start']==NULL)mysql_querll("UPDATE `kolhoz_user` SET `time_start` = '$time' WHERE `id` = '$ku[id]'");
mysql_querll("UPDATE `kolhoz_user` SET `count_cp` = '0' WHERE `time_cp` < '$time'");
mysql_querll("UPDATE `kolhoz_user` SET `money` = '".floor($ku['money'])."' WHERE `id` = '$ku[id]'");
mysql_querll("UPDATE `kolhoz_user` SET `rating` = '".floor($ku['rating'])."' WHERE `id` = '$ku[id]'");
mysql_querll("UPDATE `kolhoz_collective_user` SET `rubies` = '0' WHERE `rubies` = ''");
include_once 'inc/dostig2.php';
echo "</div></div></div>";
exit;
?>