<? 
echo "</div>"; 
echo "</div>"; 

if($ku['polosa']==1){
$max = $level['rating'];
$tek = $kr;
$forl = ($tek/$max)*100;
echo '<div class="block">'; 
echo '<div style="border:1px solid #495E24;border-radius:6px;margin-top:2px;">';
echo '<div class="expline" style="width:'.number_format($forl,10,'.','').'%;"></div>';
echo "</div>";
echo "</div>";
}



echo '<div class="content">'; 
echo "<div class='block'>";


echo "<a href='?myfarm'><div class='block'><img width='16' height='16' src='/img/icons/plants.png' alt='o'> Огород ".(mysql_result(mysql_querll("SELECT COUNT(`id`) 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(`id`) 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></a>"; 

 
echo "<a href='?f_myfarm'><div class='block'><img width='16' height='16' src='/img/fish/fishs.png' alt='o'> Пруды ".(mysql_result(mysql_querll("SELECT COUNT(`id`) FROM `kolhoz_ground_f` 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(`id`) FROM `kolhoz_ground_f` 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></a>"; 








//загоны
$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=null;
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_money']/(4*3600));
if($d_money>0)$count_mon++;
}
if($count_gol>$count_mon)$count_zag=$count_mon;else $count_zag=$count_mon;


echo "<a href='?mypetfarm'><div class='block'><img width='16' height='16' src='/img/icons/animal.png' alt='o'> Загоны ".($count_gol?"<span class='title'>($count_gol)</span>":null)."</div></a>"; 


$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_golz=null;
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_golz++;
}
$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_money']/(4*3600));
if($d_money>0)$count_mon++;
}
if($count_golz>$count_mon)$count_zag=$count_mon;else $count_zag=$count_mon;








echo "<a href='?mytreefarm'><div class='block'><img width='16' height='16' src='/img/icons/tree.png' alt='o'> Садок ".($count_golz?"<span class='title'>($count_golz)</span>":null)."</div></a>"; 

echo "<a href='?mycellar'><div class='block'><img width='16' height='16' src='/img/icons/last_recipes.png' alt='o'> Погреб ".(mysql_result(mysql_querll("SELECT COUNT(`id`) 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(`id`) 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)."</div></a>"; 
echo "<a href='?sh_myfarm'><div class='block'><img width='16' height='16' src='/img/shaht/harvest.png' alt='o'> Шахты ".(mysql_result(mysql_querll("SELECT COUNT(`id`) FROM `kolhoz_ground_sh` 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(`id`) FROM `kolhoz_ground_sh` 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></a>"; 
echo "<a href='?rubalka'><div class='block'><img width='16' height='16' src='/img/icons/fish.png' alt='o'> Рыбалка</div></a>"; 
echo "<a href='?almaznaya'><div class='block'><img width='16' height='16' src='/img/admm/diamond.png' alt='o'> Алмазная</div></a>";
echo "<a href='?mywork'><div class='block'><img width='16' height='16' src='img/icons/dig.png' > Работа</div></a>";
echo '<a href="?warehouse"><div class="block"><img width="16" height="16" src="/img/icons/warehouse.png" alt="o"> Амбар</div></a>'; 



echo '<a href="?market"><div class="block"><img width="16" height="16" src="/img/icons/cart_remove.png" alt="o"> Рынок</div></a>'; 
echo '<a href="?shop"><div class="block"><img width="16" height="16" src="/img/icons/cart.png" alt="o"> Магазин</div></a>';
echo '<a href="?center"><div class="block"><img width="16" height="16" src="/img/icons/center.png" alt="o"> Город</div></a>'; 

echo "<br/></div><div class='xr'></div><div class='block'>";
$news=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_news` WHERE `id` >= '1'"),0);
echo '<a href="?news"><div class="block"><img src="img/icons/new.gif" alt="o"> Новости <font color="orange">(<b>'.$news.'</b>)</font></div></a>';


echo '<a href="?payment"><div class="block"><img width="16" height="16" src="/img/icons/ruby.png" alt="o"> Акции и покупки</div></a>';
echo '<a href="?elysium"><div class="block"><img width="16" height="16" src="img/space.png" alt="o"> Элизиум</div></a>'; 
//echo '<a href="?gos"><div class="block"><img alt="" width="16" height="16" src="/img/icons/trophy.png"> Госзаказ</div></a>'; 

$chat_time=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_chat` WHERE `time` > '".(time()-100)."'"), 0);
$chat_room=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_chat` WHERE `id` >= '1' AND `type` = 'room'"),0);
$chat_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_chat` WHERE `id` >= '1' AND `type` = 'komm'"),0);

$forum_razdel=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `type` = 'razdel'"),0);
$forum_tema=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `type` = 'tema'"),0);
$forum_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `type` = 'komm'"),0);

$g_razdel=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gazeta` WHERE `id` >= '1' AND `type` = 'razdel'"),0);
$g_tema=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gazeta` WHERE `id` >= '1' AND `type` = 'tema'"),0);
$g_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_gazeta` WHERE `id` >= '1' AND `type` = 'komm'"),0);
$vop=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= '1' AND `mother` = '1'"),0);

//echo '<a href="?forum"><div class="block"><img width="16" height="16" src="/img/icons/forum.png" alt="o"> Форум <font color="orange">'.$forum_razdel.'/'.$forum_tema.'/'.$forum_komm.'</font></div></a>'; 
//echo '<a href="?chat"><div class="block"><img width="16" height="16" src="/img/icons/chat.png" alt="o"> Чат <font color="orange">('.$chat_time.'/'.$chat_room.'/'.$chat_komm.')</font></div></a>';


echo '<a href="?forum"><div class="block"><img width="16" height="16" src="/img/icons/forum.png" alt="o"> Форум (<span style="color: tomato">'. mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."' AND `url` like '?forum%'"), 0).'</span> <font color="green">чел</font>)</div></a>'; 
echo '<a href="?chat"><div class="block"><img width="16" height="16" src="/img/icons/chat.png" alt="o"> Чат (<span style="color: tomato">'. mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."' AND `url` like '?chat%'"), 0).'</span> <font color="green">чел</font>)</div></a>';




echo "<a href='?gazeta'><div class='block'><img width='16' height='16' src='img/gazeta/icons.gif' alt='o'> Газета <font color='orange'>(".$g_razdel."/".$g_tema."/".$g_komm.")</font></div></a>";
echo '<a href="?forum=1"><div class="block"><img width="16" height="16" src="img/icons/err.png" alt="o"> Предложения/Пожелания/Ошибки <font color="tomato">('.$vop.')</font></div></a>';


echo '<div class="block">';
echo '<span class="epic">Последние темы на форуме:</span>';
$q=mysql_query("SELECT * FROM `kolhoz_forum` WHERE `type` = 'tema' ORDER BY `time_obnov` DESC LIMIT 3");
while($post=mysql_fetch_array($q))
{
echo '<br/>';
$visit_array=explode(',',$post['visit']);
$visit_num=count($visit_array)+$sum_num;
if(!in_array($ku['id'],$visit_array)){echo"<img width='16' height='16' src='img/icons/forum_topic_new.png' alt='x' title='x'>";
} else {
if($post['locked']==1){echo"<img width='16' height='16' src='img/icons/forum_topic_closed.png' alt='x' title='x'>";
} else {
echo"<img width='16' height='16' src='img/icons/forum_topic.png' alt='*' title='*'>";
}
}
echo" <a href='?forum=$post[id]'><span style='font-weight:bold'>".hsc($post['name'])."</span></a> ";
echo ' <font color="orange">('.mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_forum` WHERE `id` >= $post[id] AND `mother` = $post[id]"),0).')</font>';

echo "<a href='?forum=$post[id]&page=end'><b>&raquo;&raquo;</b></a>";
}
echo "</div>";//пос.темы форума
echo "</div><div class='xr'></div><div class='block'>";

echo "<a href='?mail'><div class='block'><img width='16' height='16' src='img/icons/mails.png' alt='o'> Почта ".(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)!=0?"<font color='violet'>+</font><font color='tomato'><b>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_mail` WHERE `id_user` = '$ku[id]' AND `read` = '0'"),0)."</b></font>":null)."</div></a>";
echo "<a href='?friends'><div class='block'><img width='16' height='16' src='/img/icons/favorite.png' alt='o'> Друзья</div></a>"; 
echo "<a href='?user=".$ku['id']."'><div class='block'>";
echo "".on_k($ku['id']).""; 
echo ' Профиль</div></a>'; 
if(isset($mc)) 
{ 


echo '<a href="?mycollective"><div class="block"><img alt="" width="16" height="16" src="/img/icons/guild.png"> Колхоз</div></a>'; 
$count_selsovet = mysql_result(mysql_querll("SELECT COUNT(`id`) FROM `kolhoz_collective_chat` WHERE `id_collective` = '$mc[id]'"),0); 
echo "<a href='?collective=".$mc['id']."&selsovet'><div class='block'><img width='16' height='16' src='/img/icons/village_council.png' alt='o'> Сельсовет <font color='orange'>($count_selsovet)</font></div></a>"; 
echo '<a class="epic" href="?collective='.$mc['id'].'&club"><div class="block">';
$visit_array=explode(',',$post['visit']);
$visit_num=count($visit_array)+$sum_num;
if(!in_array($ku['id'],$visit_array)){echo"<img width='16' height='16' src='img/icons/forum_new.png' alt='*' title='*'>";} else {echo"<img width='16' height='16' src='img/icons/forum.png' alt='*' title='*'>";}
echo ' Дом культуры (<span style="color: tomato">'. mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."' AND `url` like '?collective=".$mc['id']."&club%'"), 0).'</span> <font color="green">чел</font>)</span>';
$visit_array=explode(',',$post['visit']);
$visit_num=count($visit_array)+$sum_num;
if(!in_array($post['id'],$visit_array)){echo"<font color='snow'>*</font>";} else {echo"";}
echo "</div></a>";
} 
echo '</div></div>';
echo "<div class='block'><center><b>Акция:</b> <u><a href='?payment&ACT'><font color='#33FFCC'><b>Бонусы за покупки</b></font></a></u></center></div>";

//нижняя панель (Деньги опыт и прочее)
echo "<font color='yellow'><div class='event'>
<img width='16' height='16' src='/img/icons/money.png' alt='o'> <span>".$money_new."</span>
| <img width='16' height='16' src='/img/icons/ruby.png' alt='o'> <span>".$rubies_new."</span> 
| <img width='16' height='16' src='/img/icons/zkl.png' alt='o'> <span>".$zkl_new."</span><br> 
| <img width='16' height='16' src='/img/euro.png' alt='o'> <span>".$euro_new."</span>
| <img src='/img/icons/baks.png' alt='o'> <span>".$almaz_new."</span>
| <img width='16' height='16' src='img/snewka.png' alt='o'> <span>$ku[turnir]</span>
<br/> <img src='/img/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 class='block'><center>";
echo "".on_k($ku['id'])."";
echo "<span class='epic'>$ku[nick]</span> ";
echo "<img src='img/icons/".(isset($dexp)?"doubleexp":"experience").".png' alt='o'><span>$ku[level]</span> уровень</center></div>";

echo "<div class='block'><center><a href='?forum=1775'>Помощь</a> | <a href='?online'>Онлайн: <b><font color='snow'>".mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_user` WHERE `date_last` > '".(time()-600)."'"), 0)."</font></b></a> | <a href='?exit'><font color='orangered'>выход</font></a></center></div>";
echo "<div class='block'><center>Оформление: <a href='?user=$ku[id]&themes'>";
if ($ku['theme'] == 1){echo "Стандартная";}
if ($ku['theme'] == 2){echo "Темная";}
if ($ku['theme'] == 3){echo "Простая";}
if ($ku['theme'] == 4){echo "Темно зеленая";}
if ($ku['theme'] == 5){echo "Неплохая темка";}
if ($ku['theme'] == 6){echo "В разработке";}
if ($ku['theme'] == 7){echo "В разработке";}
if ($ku['theme'] == 8){echo "В разработке";}
if ($ku['theme'] == 9){echo "В разработке";}
if ($ku['theme'] == 10){echo "В разработке";}

echo "</a></center>";
echo "<center><a href='?support'>Служба поддержки</a></center></div>";



echo "Ссылка на страничку:<br/><input class='wide' rows='2' type='text' value='[url=?$_SERVER[QUERY_STRING]]Ссылка[/url]' />";

echo '<div style="text-align:center;" class="pt minor">';
echo " <a href='http://VcityNett.tk' class='epic'><span class='epic'> VcityNett.tk</span><br></a>".date("d.m.y")." | <font color='orange'>".date("H:i")." МСК</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>";





$page_size = ob_get_length();
ob_end_flush();
/*
if(!isset($_SESSION['traf'])){ $_SESSION['traf'] = 0; }
$_SESSION['traf'] += $page_size;
//if($ku['status']>0)echo 'Вес страницы: '.round($page_size / 1024, 2).' Kb<br/>';
//if($ku['status']>0)echo 'Трафик: '.round($_SESSION['traf'] / 1024, 2).' Kb';
*/


include_once 'inc/next_level_collective.php'; 

if($_SESSION['foot_sys']>=25){
include_once 'inc/station_act.php'; 
include_once 'inc/count_cash.php'; 
$count = $ku['hydropinics']+$ku['scarecrow']+$ku['vetriak']+$ku['flowerbed']+$ku['cultivator']+$ku['cultivator_sh']+$ku['f_cultivator']+$ku['cultivator2']+$ku['irregate']+$ku['irregate_sh']+$ku['f_irregate']+$ku['soiler']+$ku['soiler_sh']+$ku['f_soiler']+$ku['conveyor2']+$ku['conveyor']+$ku['seeder']+$ku['seeder_sh']+$ku['seeder2']+$ku['f_seeder']+$ku['fooder2']+$ku['fooder']+$ku['harvester2']+$ku['harvester']+$ku['harvester_sh']+$ku['f_harvester'];
mysql_querll('UPDATE `kolhoz_user` SET `tehnika`="'.$count.'" WHERE `id`="'.$ku['id'].'"'); 
//mysql_querll('UPDATE `kolhoz_user` SET `count_cp`="0" WHERE `time_cp`<"'.$time.'"'); 
include_once 'inc/dostig2.php'; 
$_SESSION['foot_sys']=1;
}
$_SESSION['foot_sys']++;

if($ku['time_start']==0 || $ku['time_start']==NULL)mysql_querll("UPDATE `kolhoz_user` SET `time_start` = '$time' WHERE `id` = '$ku[id]'"); 







mysql_close($db);
exit;
?>