Файл: vkolhoze.com/inc/collective.php
Строк: 261
<?
$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';
else if(isset($_GET['hangar']))include_once 'inc/hangar.php';
else if(isset($_GET['station']))include_once 'inc/station.php';
else if(isset($_GET['lab']) && isset($mc) && $mc['id']==$ct['id']){include_once 'inc/lab/index.php';}
else if(isset($_GET['flowerbed']) && isset($mc) && $mc['id']==$ct['id'])include_once 'inc/flowerbed_ct.php';
else if(isset($_GET['rating']) && isset($_GET['selsovet']))include_once 'inc/rat_ct.php';
else if(isset($_GET['rename']) && isset($_GET['selsovet']) && isset($mc) && $mc['id']==$ct['id'])include_once 'inc/collective_rename.php';
else if(isset($_GET['enlarge']) && isset($_GET['selsovet']) && isset($mc) && $mc['id']==$ct['id'])include_once 'inc/collective_enlarge.php';
else if(isset($_GET['history']) && isset($_GET['selsovet']))include_once 'inc/history_ct.php';
else if(isset($_GET['selsovet']))include_once 'inc/selsovet.php';
else if(isset($_GET['mailing']) && isset($mc) && $mcu['status']<=3 && $mc['id']==$ct['id'])include_once 'inc/mailing_ct.php';
else if(isset($_GET['club']))include_once 'inc/club.php';
else if(isset($_GET['zags']))include_once 'inc/zags.php';
else if(isset($_GET['buildings']))include_once 'inc/buildings.php';
else 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>
<?
if (file_exists('images/gerb/'.$ct['id'].'.png'))
{
echo "<img width='100%'style='border-radius:5px' src='images/gerb/$ct[id].png' alt='o'>";
}
else
{
echo "<img src='images/nogerb.png' alt='o'>";
}
//echo "<li> ".($mcu['status']<=1?"<a class='epic' href='/avakx'>":"<span class='epic'>")."Сменить герб колхоза".($mcu['status']<=1?"</a>":"</span>")."".($mcu['status']>1?" <span class='small minor'>(доступно для председателя)</span>":null)." <span class='small minor'></span></li>";
?>
</div>
<ul class="minor">
<li>Уровень: <span class="title">
<? echo $ct['level']; ?>
</span></li>
<?
if($ct['level']<=5 AND $ct['level']>=1)$liga ='Без лиги';
if($ct['level']<=10 AND $ct['level']>=5)$liga ='2-ая лига';
if($ct['level']<=15 AND $ct['level']>=10)$liga ='3-ая лига';
if($ct['level']<=20 AND $ct['level']>=15)$liga ='4-ая лига';
if($ct['level']<=25 AND $ct['level']>=20)$liga ='5-ая лига';
if($ct['level']<=30 AND $ct['level']>=25)$liga ='Серебряная Лига';
if($ct['level']<=35 AND $ct['level']>=30)$liga ='Золотая Лига';
if($ct['level']<=40 AND $ct['level']>=35)$liga ='Лига Профессионалов';
echo '<li>'.$liga.'</li>';
?>
<li>Опыт: <span class="title"><? echo rating($ct['rating']); ?></span>/<span>
<?
$rating_need=pow(2.71,$ct['level']+1)*1000;
echo rating($rating_need);
echo '</span></li>
<li>Механизация: <span class="title"> '.$ct['tehnika'].'</span><span>(<span>'.(round($ct['tehnika']/20,2)).'</span>%)</span></li>
<li>Арена рейтинг: <span class="title"> '.$ct['arena_rate'].'</span>
</ul>';
if(isset($mc) && $ct['id']==$mc['id'])
{
if($mcu['status']<=3 && $ct['titleText']==NULL || $ct['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` = '$ct[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($ct['titleText'])."</textarea></div>n
<input type='submit' value='Сохранить'>n
</form>n";
}
if($ct['titleText']!=NULL)
{
$uk=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$ct[titleText_user]'"));
echo "<li><span>";
echo "".on_k($uk['id'])."";
echo " <a class='' href='/user/$uk[id]'><span>".nc($ct['titleText_user'])."</span></a> <span class='minor'>".vremja($ct['titleText_time'])."<span></span></span></span></li>";
echo "<li><span class='title'><p>".output_text($ct['titleText'])."</p></span></li>";
}
if($mcu['status']<=3 && !isset($_GET['titleText']))echo "<li><a".($ct['titleText']!=NULL?" class='minor'":null)." href='/mycollective/titleText'>".($ct['titleText']!=NULL?"изменить":"Дать объявление")."</a></li>";
if($mcu['status']<=3 && $ct['titleText']==NULL || $ct['titleText']!=NULL)echo "</ul></div><div></div></div>
";
}
?>
<h3>Здания</h3>
<ul>
<li><img width="16" height="16" src="/images/icons/favorite.png" alt="*"> <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'])
{
$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><img width='16' height='16' src='/images/icons/flowerbed.png' alt='*'> <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/new/forum.png" alt="*"> <a class="epic" href="/collective-<? echo $ct['id'];?>/club">Дом культуры</a><?echo (mysql_result(mysql_query("SELECT COUNT(*) FROM `club_ct_see` WHERE `id_ct` = '$ct[id]' AND `id_club` = '0' AND `id_them` = '0' AND `id_user` = '$ku[id]'"), 0)==0?" <span class='minor'>(*)</span>":null);?></span> <span class="small minor">Колхозные форумы.</span></li>
<?
if(isset($mc) && $mc['id']==$ct['id'])
{
echo "<li><img width='16' height='16' src='/images/icons/mails.png' alt='*'> ".($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>";
echo '<li><img width="16" height="16" src="/images/icons/ruby.png" alt="*"> <a class="epic" href="/collective-'.$ct['id'].'/cash">Касса</a> <span class="minor"><span><img width="16" height="16" src="images/icons/ruby.png" alt="o"> <span class="title">'.$ct['rubies'].'</span></span> <span><img width="16" height="16" src="/images/icons/money.png" alt="o"> <span class="title">'.$ct['money'].'</span></span></span> <span class="small minor">Пополнение кассы, рейтинги плательщиков.</span></li>';
}
?>
<?
if(!isset($mcu['status']))$mcu['status']='';
echo "<li><img width='16' height='16' src='images/icons/money.png' alt='o'> ".($mcu['status']==1 && isset($mc) && $mc['id']==$ct['id']?"<a class='epic' href='?collective=$ct[id]&nalog'>":"<span class='epic'>")."Налоговая".($mcu['status']==1 && isset($mc) && $mc['id']==$ct['id']?"</a>":"</span>")."".($ct['nalog']>0?" <span class='minor'><span>$ct[nalog]</span>%</span>":null)." <span class='small minor'>Колхозный налог на монеты.</span></li>";
?>
<li><img width="16" height="16" src="images/icons/heli4n.png" alt="o"> <a class="epic" href="/collective-<? echo $ct['id'];?>/hangar">Ангар</a> <span class="minor">(<span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$ct[id]' AND `heli` = '1'"),0);?></span>, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$ct[id]' AND `heli` = '2'"),0);?></span>, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$ct[id]' AND `heli` = '3'"),0);?></span>, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$ct[id]' AND `heli` = '4'"),0);?>
, <span><? echo mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective_heli` WHERE `id_collective` = '$ct[id]' AND `heli` = '5'"),0);?></span>)</span> <span class="small minor">Колхозные вертолеты.</span></li>
<li><img width="16" height="16" src="images/icons/bank.png" alt="o"> <a class="epic" href="/collective-<? echo $ct['id'];?>/zags">Загс</a> <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']){echo"<li><img width='16' height='16' src='/images/icons/1lab.png' alt='o'> <a class='epic' href='/collective-$ct[id]/lab'>Лаборатория</a> <span class='small minor'>Селекция растений.</span></li>";}
echo '
</ul>
</div>';
include_once 'inc/foot.php';
?>