<?
echo "<div style='padding-top:4px'>";
echo "<div class='event' style='height:2px'>";
echo "<div class='eventlight' style='height:2px;width:".rand(75,95)."%'>";
echo "</div>";
echo "</div>";
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_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']>=10)
{
$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*4);
$mezh_time=$max_time-$post['time'];
if($mezh_time>=4*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']/(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']>=10)
{
$count_mon=mysql_result(mysql_query("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_query("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_query("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']>=15)echo "<img width='16' height='16' src='images/icons/last_recipes.png' alt='o'> <a href='?mycellar'>Погреб</a></li>";
echo '<li><img width="16" height="16" src="images/icons/warehouse.png" alt="o"> <a href="?warehouse">Амбар</a></li>';
if($ku['level']>=15)echo
'<li><img width="16"
height="16" src="images/icons/cart_remove.png" alt="o"> <a
href="?market">Рынок</a></
li>';
echo '<li><a href="http://4topik.ru/go.php?id=5"><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>';
echo '<li class="pt"><img alt="" width="16" height="16" src="images/icons/trophy.png"> <a href="?gos">Госзаказ</a><br>';
echo '<img width="16" height="16" src="images/icons/news.png" alt="o"> <a href="?forum=1">Новости</a></li></li><img width="16" height="16" src="images/icons/ruby.png" alt="o"> <a href="?payment">Рубины</a></li></li><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/icons/chat.png" alt="o"> <a href="?chat">Чат</a></li>';
echo "<li class='pt'><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)."</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><img alt="" width="16" height="16" src="images/icons/guild.png"> <a href="?mycollective">Колхоз</a></li>';
echo '<li><img width="16" height="16" src="images/icons/chat.png" alt="o"> <a href="?collective='.$mc['id'].'&selsovet">Сельсовет</a></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/".(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='?outlogin=$ku[mdp]'>выйти</a>?<br><br></div><div><a href='?forum=35'>Помощь</a> | <a href='?rules'>Правила</a><br><a href='?support'>Тех. поддержка</a><br>".($ku['id']==1?" <a href='?admin'>Админка</a>":null)."</div></div>";
echo "<div></div><div style='text-align:center;' class='pt small minor'>Добавь в закладки";
echo " <a href='http://kollxoz.ru' class='epic'><span class='epic'> kollxoz.ru</span></a><br><span>Онлайн-игра Фермер</span>";
echo "<div>".date('d.m.y')." | <font color='orange'>".vremja($time)."</font></div><br><br>";
echo "</div>";
?>