Файл: public_html/modules/towers/wizard.php
Строк: 44
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once ($root.'/core/base.php');
falseauth();
$header = "Башни";
include_once ($root.'/core/head.php');
?>
<style>
.mlra {
margin-left: auto;
margin-right: auto;
}
.mb10 {
margin-bottom: 10px;
}
.wings {
width: 75px;
padding: 0 57px;
font-size: 0;
background-image: url(/images/bg-wings.png);
background-repeat: no-repeat;
}
.img70 {
display: block;
width: 64px;
height: 70px;
font-size: 0;
background-repeat: no-repeat;
}
.w180x {
width: 85%;
}
</style>
<?
$tower = $db->query("SELECT * FROM `towers` WHERE `user` = '".$u['id']."'")->fetch_object();
$wizardParams = getWizardParams($tower->wizard_level);
if(isset($_GET['upgrade']))
{
if($u['gold'] < $wizardParams['nextLevelCost']) redirect('/towers/wizard', 'Недостаточно гемов!');
if($tower->wizard_level >= 40) redirect('/towers/wizard', 'Максимальное улучшение!');
$db->query("UPDATE `users` SET `gold` = `gold` - '".$wizardParams['nextLevelCost']."' WHERE `id` = '".$u['id']."'");
$db->query("UPDATE `towers` SET `wizard_level` = `wizard_level` + '1' WHERE `id` = '".$tower->id."'");
redirect('/towers/wizard', 'Успешное улучшение!');
}
echo '
<div class="notice_container"><div class="gborder notice_alert alert-success">Башня мага ('.$tower->wizard_level.' ур. из 40 ур.)</div></div>
<div class="b">
<div class="wings mlra mb10"><div class="brd70"><div class="img70"
style="background-image:url(/images/towers/wizard.jpg);
background-size: 100%;"></div></div></div>
<div class="w180x mlra bl">
<div class="pb10 fll nwr left"> +'.$wizardParams['currentParams'].' к параметрам и + <img src="/images/silver.png" width="16" height="16"> '.$wizardParams['currentIncome'].' к доходу </br>
</div>
</div>
</br><center> '.($tower->wizard_level < 40 ? '<a class = "btn _blue" href="/towers/wizard/upgrade">Улучшить за <img src="/images/ic-gem.png" width="16" height="16"> '.$wizardParams['nextLevelCost'] .'</a>' : 'Уровень башни мага максимален').'</center>
</center>
</div>';
echo '<div class="line"></div>
<a href = "/towers"><div class = "b"><center> Назад</center></div></a>
';
include_once ($root.'/core/foot.php');