<?
$ct['next_level']=$ct['level']+1;
$ct['flowerbed_max']=$ct['level']*10;
$ct['users_max']=($ct['level']*5)+10+$ct['users_add'];
$ct['users']=mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_user` WHERE `id_collective` = '$ct[id]'"),0);
if(isset($_GET['cash']) && isset($mc) && $ct['id']==$mc['id'])include_once 'inc/cash.php';
if(isset($_GET['hangar']))include_once 'inc/hangar.php';
if(isset($_GET['station']))include_once 'inc/station.php';
if(isset($_GET['flowerbed']) && isset($mc) && $mc['id']==$ct['id'])include_once 'inc/flowerbed_ct.php';
if(isset($_GET['rating']) && isset($_GET['selsovet']))include_once 'inc/rat_ct.php';
if(isset($_GET['rename']) && isset($_GET['selsovet']) && isset($mc) && $mc['id']==$ct['id'])include_once 'inc/collective_rename.php';
if(isset($_GET['enlarge']) && isset($_GET['selsovet']) && isset($mc) && $mc['id']==$ct['id'])include_once 'inc/collective_enlarge.php';
if(isset($_GET['history']) && isset($_GET['selsovet']))include_once 'inc/history_ct.php';
if(isset($_GET['selsovet']))include_once 'inc/selsovet.php';
if(isset($_GET['mailing']) && isset($mc) && $mcu['status']<=3 && $mc['id']==$ct['id'])include_once 'inc/mailing_ct.php';
if(isset($_GET['club']))include_once 'inc/club.php';
if(isset($_GET['buildings']))include_once 'inc/buildings.php';
if(isset($_GET['nalog']) && isset($mc) && $mc['id']==$ct['id'] && $mcu['status']==1)include_once 'inc/nalog.php';
?>
<div class="event"><h1>
<? echo hsc($ct['name']); ?>
</h1></div>
<div class="content">
<div class="block">
<div>
<img src="images/kolhoz310.jpg" alt="kolhoz"></a>
</div>
<ul class="minor">
<li>Уровень: <span class="title">
<? echo $ct['level']; ?>
</span></li>
<li>Опыт: <span class="title"><? echo rating($ct['rating']); ?> </span>/<span>
<?
$rating_need=pow(2.73,$ct['level']+1)*1000;
echo rating($rating_need);
?>
</span></li>
</ul>
<?
?>
<h3>Здания</h3>
<ul>
<li><img width="16" height="16" src="images/icons/ruby.png" alt="o"> <a class="epic" href="?collective=<? echo $ct['id'];?>&cash">Казна</a> <span class="minor"><span> <span class="title"></span></span></span> <span class="small minor"></span></li>
<li><img width="16" height="16" src="images/icons/guild.png" alt="o"> <a class="epic" href="?collective=<? echo $ct['id'];?>&buildings">Постройки</a></li>

<?
if(isset($mc) && $mc['id']==$ct['id'])
{
$count_max=$ct['level']*10;
$time_rubies=floor(86400/$count_max);
$time_mezh=$time-$ct['time_obmen'];
$count_rubies=floor($time_mezh/$time_rubies);
if($count_rubies>$count_max)$count_rubies=$count_max;
echo "<li> <a class='epic' href='?collective=$ct[id]&flowerbed'></a>";
if($ct['flowerbed']==1)
{
echo '<span class="minor">(<span>';
$count_flowerbed=$count_rubies;
echo $count_flowerbed;
echo '</span>/<span>';
echo $ct['flowerbed_max'];
echo '</span>)</span>';
}
echo ' <span class="small minor"></span></li>';
}
?>
<li><img width="16" height="16" src="images/icons/forum.png" alt="o"> <a class="epic" href="?collective=<? echo $ct['id'];?>&club">Форум</a></span> <span class="small minor"></span></li>
<li><img width="16" height="16" src="images/icons/favorite.png" alt="o"> <a class="epic" href="?collective=<? echo $ct['id']; ?>&selsovet">Состав</a> <span class="minor">(<span><? echo $ct['users'];?></span>/<span><? echo $ct['users_max'];?></span>)</span> <span class="minor small"></span></li>
<?
if(isset($mc) && $mc['id']==$ct['id'])
{
echo "<li><img width='16' height='16' src='images/icons/mails.png' alt='o'> ".($mcu['status']<=3?"<a class='epic' href='?collective=$ct[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>";
}
?>

<?
?>



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


?>