<?
echo "<div style='padding-top:4px'>";
echo "<div class='event' style='height:2px'>";
echo "<div class='eventlight' style='height:2px;width:".rand(99,99)."%'>";
echo "</div>";
echo "</div>";
echo "<ul class='block'>";

echo "<div class='small ptm'>";

echo "<center><img '25' height='25' src='style/footer.png' alt='city'></a></div></center>";
echo "<img width='16' height='16' src='images/taxi.ico' 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)."</li>";
if($ku['level']>=5)
{
$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 "<li><img width='16' height='16' src='images/perevoz/avtobus.png' alt='o'> <a href='?mypetfarm'>Автовокзал</a> ".($count_zag?"<span class='title'>($count_zag)</span>":null)."</li>";
}
//echo "<li><img width='16' height='16' src='images/icons/last_recipes.png' alt='o'> <a href='?mycellar'>Погреб</a><span class='title'>(70)</span></li>";
echo "<ul><li><img width='16' height='16' src='images/icons/cart.png' alt='o'> <a href='?shop'>Магазин</a></li><li>";
echo '<li><img width="16" height="16" src="images/perevoz/024.jpg" alt="o"> <a href="?warehouse">Отчет</a></li><li><img width="16" height="16" src="images/perevoz/center.png" alt="o"> <a href="?center">Город</a></li>';
echo ' <a class="epic" href="?gos"></a><br>';
echo '<li class="pt"><img alt="" width="16" height="16" src="images/icons/abilities.png"> <a class="epic" href="?forum=1">Газета</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `mother` = '1'"),0).')<br>';
echo ' <a href="?payment"></a></li><li><img width="16" height="16" src="images/icons/forum.png" alt="o"> <a href="?forum">Форум</a></li><li><img width="16" height="16" src="images/perevoz/rac_32.png" alt="o"> <a href="?chat">Рация</a></li>';
echo "<div><img width='16' height='16' src='images/perevoz/bank.png' alt='o'> <a href='?payment'>Банк</a></li><li> <a href='?buy_plant'></a>";
echo "<br><li class='pt'><img width='16' height='16' src='images/perevoz/054.jpg' 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)."</li>";
echo "<li>";
echo ' <a href="?
payment"></a></li><li><img
width="16" height="16"
src="images/icons/favorite.png" alt="o"> <a href="?friends">Друзья</a></li><li>';
echo "".on_k($ku['id'])."";
echo ' <a href="?user='.$ku['id'].'">Профиль</a></li>';
if(isset($mc))
{
echo '<li><img alt="" width="16" height="16" src="images/icons/kompania.png"> <a href="?mycollective='.$mc['id'].'&kolhoz">Компания<a href="?mycollective"></a></li>
<li><img width="16" height="16" src="images/icons/chat.png" alt="o"> <a href="?collective='.$mc['id'].'&selsovet">Переговорная</a> <span class="title">('.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_chat` WHERE `id_collective` = '$mc[id]'"),0).')</span></li>';
}

echo "<div class='small ptm'><div
<div><div class='event'><h2><img width='16' height='16' src='images/perevoz/bank.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> уровень";
echo "</ul></div>";
if($ku['polosa']==0)
{
$max = $level['rating'];
$tek = $kr;
$forl = ($tek/$max)*100;
echo '<div style="border:2px solid #FF0000;border-radius:6px;margin-top:2px;">';
echo '<div class="expline" style="width:'.$forl.'%;"/></div>';
echo "</div>";
}
echo "<div class='small ptm'>";
echo "<ul class='block'>";
echo "<li>";
echo "<ul class='block'>";
echo "<div></div><div style='text-align:center;'><div class='pt'>";
$arrayData = array(1 => 'Января',
					   2 => 'Февраля',
					   3 => 'Марта',
					   4 => 'Апреля',
					   5 => 'Мая',
					   6 => 'Июня',
					   7 => 'Июля',
					   8 => 'Августа',
					   9 => 'Сентября',
					   10 => 'Октября',
					   11 => 'Ноября',
					   12 => 'Декабря');

	$chas = date('H', time());
	if ($chas > 24) $chas = round($chas - 24);
	if ($chas < 0) $chas = round($chas + 24);
	if ($chas <= 4 or $chas >= 23) $hallo = '<span style="color:#FF0000;">Доброй ночи, ' . $ku['nick'] . '</span><br/>';
	elseif ($chas >= 5 and $chas <= 10) $hallo = '<span style="color:#FF8C00;">Доброе утро, ' . $ku['nick'] . '</span><br/>';
	elseif ($chas >= 11 and $chas <= 17) $hallo = '<span style="color:#FF0000;">Добрый день, ' . $ku['nick'] . '</span><br/>';
	elseif ($chas >= 18 and $chas <= 22) $hallo = '<span style="color:#FF0000;">Добрый вечер, ' . $ku['nick'] . '</span><br/>';

echo $hallo . '<b>' . date('j') . '</b> ' . $arrayData[date('n')]  ;

echo "<a href='?vixod'>  <img width='16' height='16' src='images/icons/cross.png' alt='o'></a>  ?</div><div><a href='?rules'>Правила игры</a> | <a href='?support'>Тех. поддержка</a> ".($ku['status']==1 || $ku['status']==3?" | <a href='?tikets'>Тикеты".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_tikets` WHERE `read` = '0'"),0)!=0?" (+".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_tikets` WHERE `read` = '0'"),0).")":null)."</a>":null)." | <a href='?settings'>Настройки</a> ".($ku['dostup']==1?" | <a href='?admin'>Админка</a>":null)."</div></div>";
 if($ku['status']>0)echo "<br><center><a class='epic blok' href='?jalob'>Жалобы <span class='title'>(".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_jalob` WHERE `read` = '1'"),0)."/<font color='red'>+".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_jalob` WHERE `read` = '0'"),0)."</font>)</span></a></center>";
echo "<div style='text-align:center;' class='pt small minor'>
<br><div>Рассказать о нас:</div>
<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></br>

<span class='epic'>© 2о13 Онлайн-игра ПеревозчиК</span><div>".date('d.m.Y')."</div><div>".vremja($time)."<div style='color:#555555'';

class='pt'>0 ms, v.7,14+ </div></div>";

echo "</div>";
echo "<div class='wm'><marquee behavior='scroll' direction='up' scrollamount='1' height='25px'><center> 
<a href='http://waplog.net/c.shtml?502193'><img src='http://c.waplog.net/502193.cnt' alt='waplog' />
<a href='http://fatop.ru/go/26'><img src='http://fatop.ru/image/26' alt='FaTop.Ru'/></a>
<a href='http://topiz.ru/?
uid=10928'><img src='http://topiz.ru/count.php?uid=10928' alt='TOPIZ.RU'/></a></marquee></center></div>";
if(isset($mc))
{
include_once 'inc/next_level_collective.php';
include_once 'inc/count_cash.php';
}
mysql_query("UPDATE `kolhoz_user` SET `coll` = '$mc[id]' WHERE `id` = '$ku[id]'");
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;
?>