<div class="event"><h1>

<?

if(!isset($mc)){
$_SESSION['msg_err']='Произошла ошибка';
header("Location:/myfarm/".passgen());
exit;
}else{
echo hsc($mc['name']);
} 
?>
</h1></div>
<div class="content">
<div class="block">
<div>
<a target="_blank" href="images/kolhoz480.jpg"><img src="/images/kolhoz310.jpg" alt="kolhoz"></a>
</div>
<ul class="minor">
<li>Уровень: <span class="title">
<? echo $mc['level']; ?>
</span></li>
<li>Опыт: <span class="title"><? echo rating($mc['rating']); ?></span>/<span>
<?
$rating_need=pow(2.71,$mc['level']+1)*1000;
echo rating($rating_need);
echo '</span></li>
<li>Механизация: <span class="title"> '.$mc['tehnika'].'</span><span>(<span>'.(round($mc['tehnika']/20,2)).'</span>%)</span></li>
<li>Арена рейтинг: <span class="title"> '.$mc['arena_rate'].'</span>
</ul>';
if($mcu['status']<=3 && $mc['titleText']==NULL || $mc['titleText']!=NULL)echo "<div><h3>Объявление</h3><div><ul>";
if($mcu['status']<=3 && isset($_GET['titleText']))
{
if(isset($_POST['titleText']) && strlen2($_POST['titleText'])<=64)
{
mysql_query("UPDATE `kolhoz_collective` SET `titleText` = '".my_esc($_POST['titleText'])."', `titleText_user` = '$ku[id]', `titleText_time` = '$time' WHERE `id` = '$mc[id]'");
header("Location:/mycollective");
}
else echo "<form method='post'><div><label for='titleText'>Текст объявления:</label></div>\n
<div><textarea id='titleText' class='wide' rows='2' name='titleText'>".hsc($mc['titleText'])."</textarea></div>\n
<input type='submit' value='Сохранить'>\n
</form>\n";
}
if($mc['titleText']!=NULL)
{
$uk=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$mc[titleText_user]'"));
echo "<li><span>";
echo "".on_k($uk['id'])."";
echo " <a class='' href='/user/$uk[id]'><span>".nc($mc['titleText_user'])."</span></a> <span class='minor'>".vremja($mc['titleText_time'])."<span></span></span></span></li>";
echo "<li><span class='title'><p>".output_text($mc['titleText'])."</p></span></li>";
}
if($mcu['status']<=3 && !isset($_GET['titleText']))echo "<li><a".($mc['titleText']!=NULL?" class='minor'":null)." href='/mycollective/titleText'>".($mc['titleText']!=NULL?"изменить":"Дать объявление")."</a></li>";
if($mcu['status']<=3 && $mc['titleText']==NULL || $mc['titleText']!=NULL)echo "</ul></div>";
?>
<div></div>
</div>
<h3>Здания</h3>
<ul>
<li><img width="16" height="16" src="/images/new/favorite.png" alt="*"> <a class="epic" href="/collective-<? echo $mc['id']; ?>/selsovet">Сельсовет</a> <span class="minor">(<span><? echo $mc['users'];?></span>/<span><? echo $mc['users_max'];?></span>)</span> <span class="minor small">Чат, колхозники, рейтинги, история колхоза.</span></li>
<?
$count_max=$mc['level']*10;
if($count_max==0){$count_max=1;}
$time_rubies=floor(86400/$count_max);
$time_mezh=$time-$mc['time_obmen'];
if($time_rubies==0){$time_rubies=1;}
$count_rubies=floor($time_mezh/$time_rubies);
if($count_rubies>$count_max)$count_rubies=$count_max;
?>
<li><img width="16" height="16" src="/images/new/guild_flowerbed.png" alt="*"> <a class="epic" href="/collective-<? echo $mc['id'];?>/flowerbed">Цветник</a>
<?
if($mc['flowerbed']==1)
{
echo '<span class="minor">(<span>';
$count_flowerbed=$count_rubies;
echo $count_flowerbed;
echo '</span>/<span>';
echo $mc['flowerbed_max'];
echo '</span>)</span>';
}
?>
 <span class="small minor">Обмен колхозных монет на рубины.</span></li>

<li><img width="16" height="16" src="/images/new/forum.png" alt="*"> <a class="epic" href="/collective-<? echo $mc['id'];?>/club">Дом культуры</a></span> <span class="small minor">Колхозные форумы.</span></li>
<?
echo "<li><img width='16' height='16' src='/images/new/mails.png' alt='*'> ".($mcu['status']<=3?"<a class='epic' href='/collective-$mc[id]/mailing'>":"<span class='epic'>")."Почтамт".($mcu['status']<=3?"</a>":"</span>")."".($mcu['status']>3?" <span class='small minor'>(доступно начиная с агронома)</span>":null)." <span class='small minor'>Рассылка жителям колхоза.</span></li>";
?>
<li><img width="16" height="16" src="/images/new/ruby.png" alt="*"> <a class="epic" href="/collective-<? echo $mc['id'];?>/cash">Касса</a> <span class="minor"><span><img width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title"><? echo $mc['rubies'];?></span></span> <span><img width="16" height="16" src="images/icons/money.png" alt="o"> <span class="title"><? echo $mc['money'];?></span></span></span> <span class="small minor">Пополнение кассы, рейтинги плательщиков.</span></li>

<?
echo "<li><img width='16' height='16' src='images/new/tax.png' alt='o'> ".($mcu['status']==1?"<a class='epic' href='/collective-$mc[id]/nalog'>":"<span class='epic'>")."Налоговая".($mcu['status']==1?"</a>":"</span>")."".($mc['nalog']>0?" <span class='minor'><span>$mc[nalog]</span>%</span>":null)." <span class='small minor'>Колхозный налог на монеты.</span></li>";
?>
<li><img width="16" height="16" src="images/new/heli4n.png" alt="o"> <a class="epic" href="/collective-<? echo $mc['id'];?>/hangar">Ангар</a> <span class="minor">(<span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$mc[id]' AND `heli` = '1'"),0);?></span>, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$mc[id]' AND `heli` = '2'"),0);?></span>, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$mc[id]' AND `heli` = '3'"),0);?></span>, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$mc[id]' AND `heli` = '4'"),0);?>
, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$mc[id]' AND `heli` = '5'"),0);?></span>)</span> <span class="small minor">Колхозные вертолеты.</span></li>

<li><img width="16" height="16" src="images/new/zags.png" alt="o"> <a class="epic" href="/collective-<? echo $mc['id'];?>/zags">Загс</a> <span class="small minor">Заключение браков.</span></li>
<li><img width="16" height="16" src="images/new/guild.png" alt="o"> <a class="epic" href="/collective-<? echo $mc['id'];?>/buildings">Постройки</a></li>

</ul>
</div>
<?
include_once 'inc/foot.php';
?>