Файл: rayb.me/clanst.php
Строк: 47
<?php
require_once ('system/func.php');
$title = 'Статуя Корпорации';
require_once ('system/header.php');
auth();
echo'<div class="lent mlra w80">';
$clan = $db->query("SELECT * FROM `clans` WHERE `id` = '".$user['id_clan']."'")->fetch_assoc();
function cost($i) {
switch($i) {
case 0:
$cost = 1000;
break;
case 1:
$cost = 2000;
break;
case 2:
$cost = 3000;
break;
case 3:
$cost = 4000;
break;
case 4:
$cost = 5000;
break;
case 5:
$cost = 6000;
break;
case 6:
$cost = 7000;
break;
case 7:
$cost = 8000;
break;
case 8:
$cost = 9000;
break;
case 9:
$cost = 10000;
break;
case 10:
$cost = 15000;
break;
case 11:
$cost = 20000;
break;
case 12:
$cost = 25000;
break;
case 13:
$cost = 30000;
break;
case 14:
$cost = 35000;
break;
case 15:
$cost = 40000;
break;
case 16:
$cost = 45000;
break;
case 17:
$cost = 50000;
break;
case 18:
$cost = 55000;
break;
case 19:
$cost = 60000;
break;
case 20:
$cost = 65000;
break;
case 21:
$cost = 70000;
break;
case 22:
$cost = 75000;
break;
case 23:
$cost = 80000;
break;
case 24:
$cost = 85000;
break;
case 25:
$cost = 90000;
break;
case 26:
$cost = 95000;
break;
case 27:
$cost = 100000;
break;
case 28:
$cost = 110000;
break;
case 29:
$cost = 120000;
break;
case 30:
$cost = 130000;
break;
case 31:
$cost = 140000;
break;
case 32:
$cost = 150000;
break;
case 33:
$cost = 160000;
break;
case 34:
$cost = 170000;
break;
case 35:
$cost = 180000;
break;
case 36:
$cost = 190000;
break;
case 37:
$cost = 200000;
break;
case 38:
$cost = 220000;
break;
case 39:
$cost = 240000;
break;
case 40:
$cost = 260000;
break;
case 41:
$cost = 280000;
break;
case 42:
$cost = 300000;
break;
case 43:
$cost = 330000;
break;
case 44:
$cost = 360000;
break;
case 45:
$cost = 390000;
break;
case 46:
$cost = 430000;
break;
case 47:
$cost = 470000;
break;
case 48:
$cost = 520000;
break;
case 49:
$cost = 570000;
break;
case 50:
$cost = 630000;
break;
}
global $user;
return $cost;
}
if($user['id_clan'] == $clan['id']){
if(!$clan && $user['clan_rang'] < 3) {
header('location:/main');
}
if($_GET['stat'] == train) {
if($clan['stat_level'] != 50) {
if($clan['sclad_ruby'] < cost($clan['stat_level'])) {
$_SESSION['msg'] = 'Недостаточно рубинов в складе клана!';
header('location:?');
}
else {
$db->query("update `clans` set `stat` = `stat` + 2,`stat_level` = `stat_level` + 1, `sclad_ruby` = `sclad_ruby` - '".cost($clan['stat_level'])."' where `id` = '".$user['id_clan']."'");
header('location:?');
}
}
}
}
$pms = ($money_updater[0]*$p);
$cst = ($clan['stat']);
$pcms = (($pms*$cst)/100);
if($user['id_clan'] == $clan['id'] and $user['clan_rang'] >= 4){
echo '<div class="feedback">В складе '.$clan['sclad_ruby'].' <img width="24" height="24" src="/img/ruby.png"> <br>Статуя клана '.$clan['stat_level'].' ур. из 50<br> + '.$clan['stat'].' % к доходу. <br> ';
if($user['id_clan'] == $clan['id']){
echo '<a href="?stat=train" class="btni">Улучшить '.cost($clan['stat_level']).' <img width="20" height="20" src="/img/ruby.png"></a>';
}
}else{
header('Location: /corp/');
exit;
}
echo "<br><a href='/corp/' class='btni'> Вернуться</a>";
echo "</div></div>";
require_once ('system/footer.php');
?>