battles/upgrade_items.php

76 lines
3.5 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php";
include "functions.php";
2018-06-22 20:59:02 +00:00
if ($user['room'] != 50) {
header("Location: main.php");
die();
}
if ($user['battle'] != 0) {
header('location: fbattle.php');
die();
}
2018-01-28 16:40:49 +00:00
2018-06-22 20:59:02 +00:00
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();
2018-06-22 20:59:02 +00:00
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();
2018-06-22 20:59:02 +00:00
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>";
2018-01-28 16:40:49 +00:00
2018-06-22 20:59:02 +00:00
} else {
err('Артефакт достиг максимального уровня!');
2018-06-22 20:59:02 +00:00
}
}
2018-01-28 16:40:49 +00:00
}
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
2018-06-22 20:59:02 +00:00
$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']);
2018-01-28 16:40:49 +00:00
?>
2018-06-22 20:59:02 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
2018-01-28 16:40:49 +00:00
</head>
2018-06-22 20:59:02 +00:00
<body>
<h1>Магазин Берёзка</h1>
<div style="text-align: center">Зал улучшения артефактов.</div>
2018-01-28 16:40:49 +00:00
<table border=0 width=100% cellspacing="0" cellpadding="4">
2018-06-22 20:59:02 +00:00
<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>Масса всех ваших вещей: <?=$itemWeight['m']?>/<?= get_meshok() ?>
<br>У вас в наличии: <span style="color: #339900;"><?= $bank['ekr'] ?></span> екр.</b>
<hr>
<a href=ashop.php>Магазин Берёзка</a>
<hr>
</td>
2018-06-22 20:59:02 +00:00
</tr>
2018-01-28 16:40:49 +00:00
</table>
</body>
</html>