battles/upgrade_items.php

76 lines
3.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php";
include "functions.php";
if ($user['room'] != 50) {
header("Location: main.php");
die();
}
if ($user['battle'] != 0) {
header('location: fbattle.php');
die();
}
if (isset($_GET['up'])) {
$ids = $_GET['up'];
$cur = db::c()->query('SELECT `id`,`name`,`nlevel` FROM `inventory` WHERE `owner` = ?i AND `id`= ?i AND `artefact`=1', $user['id'], $ids)->fetch_assoc();
if ($cur['id']) {
$up_level = $cur['nlevel'] + 1;
$cur_up = db::c()->query('SELECT * FROM `ashop_up` WHERE `name` = "?s" AND `level_up` = ?i', $cur['name'], $up_level)->fetch_assoc();
if ($cur_up['id']) {
//mysql_query("UPDATE `inventory` SET `upgrade`='" . $cur_up['level_up'] . "',`nlevel`='" . $cur_up['level_up'] . "',`minu`='" . $cur_up['minu'] . "',`maxu`='" . $cur_up['maxu'] . "',`gsila`='" . $cur_up['gsila'] . "',`glovk`='" . $cur_up['glovk'] . "',`ginta`='" . $cur_up['ginta'] . "',`gintel`='" . $cur_up['gintel'] . "',`ghp`='" . $cur_up['ghp'] . "',`mfkrit`='" . $cur_up['mfkrit'] . "',`mfakrit`='" . $cur_up['mfakrit'] . "',`mfuvorot`='" . $cur_up['mfuvorot'] . "',`mfauvorot`='" . $cur_up['mfauvorot'] . "',`gnoj`='" . $cur_up['gnoj'] . "',`gtopor`='" . $cur_up['gtopor'] . "',`gdubina`='" . $cur_up['gdubina'] . "',`gmech`='" . $cur_up['gmech'] . "',`bron1`='" . $cur_up['bron1'] . "',`bron2`='" . $cur_up['bron2'] . "',`bron3`='" . $cur_up['bron3'] . "',`bron4`='" . $cur_up['bron4'] . "' WHERE `owner`='" . $user['id'] . "' AND `id`='" . $cur['id'] . "'");
err('Услуга недоступна!');
//echo "<font color=green><b>Артефакт успешно улучшен!</b></font>";
} else {
err('Артефакт достиг максимального уровня!');
}
}
}
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id`=?i', $_SESSION['uid'])->fetch_assoc();
$artefactsList = db::c()->query('SELECT * FROM `inventory` WHERE `owner`=?i AND `artefact`=1', $user['id']);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
</head>
<body>
<h1>Магазин Берёзка</h1>
<div style="text-align: center">Зал улучшения артефактов.</div>
<table border=0 width=100% cellspacing="0" cellpadding="4">
<tr>
<td valign=top align=left>
<table border=0 width=100% cellspacing="1" cellpadding="2" bgcolor="#A5A5A5">
<?php
while ($row = $artefactsList->fetch_assoc()) {
if ($i == 0) {
$i = 1;
$color = '#C7C7C7';
} else {
$i = 0;
$color = '#D5D5D5';
}
showitem($row, 10);
}
?>
</table>
</td>
<td valign=top width=280>
<b>Масса всех ваших вещей: <?= getItemsMassaInfo() ?>
<br>У вас в наличии: <span style="color: #339900;"><?= $bank['ekr'] ?></span> екр.</b>
<hr>
<a href=ashop.php>Магазин Берёзка</a>
<hr>
</td>
</tr>
</table>
</body>
</html>