Файл: weatut.ru/clanst.php
Строк: 42
<?php
require_once ('system/func.php');
$title = 'Статуя клана';
require_once ('system/header.php');
auth();
$clan = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$user['id_clan']."'"));
if($user['id_clan'] == $clan['id']){
if(!$clan && $user['clan_rang'] < 3) {
header('location:/main');
}
if($_GET['st'] == train) {
if($clan['gold'] < 10 OR $clan['stat_level'] > ($clan['level'])) {
$_SESSION['msg'] = 'Недостаточно золота в казне клана или статуя клана выше уровня клана!';
header('location:?');
}
else {
mysql_query("update `clans` set `st` = `st` + 10,`stat_level` = `stat_level` + 1, `gold` = `gold` - 10 where `id` = '".$user['id_clan']."'");
mysql_query("update `users` set `st_clan` = `st_clan` + 10 where `id_clan` = '".$user['id_clan']."'");
header('location:?');
}
}
}
if($user['id_clan'] == $clan['id'] and $user['clan_rang'] >= 4){
echo '<div class="block center">Статуя клана + '.$clan[st].' к параметрам!<br>';
if($user['id_clan'] == $clan['id']){
echo '<a href="?st=train" class="btn">Улучшить 10 <img src="/images/icons/gold.png"></a></div>';
}
}else{
header('Location: http://weatut.ru/clans/');
exit;
}
include ('./system/footer.php');
?>