diff --git a/bank.php b/bank.php
index 74f6cfa..251c30b 100644
--- a/bank.php
+++ b/bank.php
@@ -3,7 +3,10 @@ ob_start("ob_gzhandler");
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
require_once "functions.php";
-if ($user['room'] != 29) header("Location: main.php");
+if ($user['room'] != 29) {
+ header("Location: main.php");
+ die();
+}
if ($user['battle'] != 0) {
header('location: fbattle.php');
die();
@@ -140,10 +143,11 @@ if (!$_SESSION['bankid']) {
?>
Работа со счётом
diff --git a/shop.php b/shop.php
index 971c3fd..6c99016 100644
--- a/shop.php
+++ b/shop.php
@@ -1,11 +1,8 @@
query('SELECT * FROM `magic` WHERE `id` = ?i', $item['magic'])->fetch_assoc();
- $incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = "' . $item['includemagic'] . '" LIMIT 1'));
- $incmagic['name'] = $item['includemagicname'];
- $incmagic['cur'] = $item['includemagicdex'];
- $incmagic['max'] = $item['includemagicmax'];
- if (!$magic) {
- $magic['chanse'] = $incmagic['chanse'];
- $magic['time'] = $incmagic['time'];
- $magic['targeted'] = $incmagic['targeted'];
+ $item = db::c()->query('SELECT * FROM ?f WHERE `id` = ?i', $from, $it);
+ if ($item->getNumRows()) {
+ $item = $item->fetch_assoc();
+
+ if (!empty($item['magic'])) $magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $item['magic'])->fetch_assoc();
+ if (!empty($item['includemagic'])) {
+ $incmagic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $item['includemagic'])->fetch_assoc();
+ $incmagic['name'] = $item['includemagicname'];
+ $incmagic['cur'] = $item['includemagicdex'];
+ $incmagic['max'] = $item['includemagicmax'];
+ if (empty($magic)) {
+ $magic['chanse'] = $incmagic['chanse'];
+ $magic['time'] = $incmagic['time'];
+ $magic['targeted'] = $incmagic['targeted'];
+ }
}
- if ($item['destiny'] > 0) {
- $r .= "
{$item['name']}
(Масса: {$item['massa']})


";
- } else {
- $r .= "
{$item['name']}
(Масса: {$item['massa']})


";
- }
+ $r .= $item['name'];
+ $r .= " (Масса: {$item['massa']})";
+ if (!empty($item['nalign']))
+ $r .= "

";
+ if (!empty($item['artefact']))
+ $r .= "

";
- if ($item['ecost'] > 0) {
- $r .= "
Цена: {$item['ecost']} екр. ";
- } elseif ($item['point'] > 0) {
- $r .= "
Цена: {$item['point']} реп. ";
- } else {
- $r .= "
Цена: {$item['cost']} кр. ";
- }
- if ($item['zeton'] > 0) {
- $r .= "
Жетон: {$item['zeton']} 
";
- }
- if (@$item['count']) {
+ $r .= "
Цена: {$item['cost']} кр.";
+
+ if ($item['count']) {
$r .= "
(количество: {$item['count']})";
}
- if ($item['for_me'] > 0) {
- $r .= '
После покупки вещь будет привязана к персонажу.';
- }
- $r .= "
Долговечность: {$item['duration']}/{$item['maxdur']}";
+
+ $r .= "
Долговечность: {0/{$item['maxdur']}";
$r .= "
";
if (!$item['needident']) {
- if ($magic['chanse'] >= 98) {
- $magic['chanse'] = 99;
- }
+
$r .= (($magic['chanse']) ? "Вероятность срабатывания: " . $magic['chanse'] . "%
" : "") . "
" . (($magic['time']) ? "Продолжительность действия магии: " . $magic['time'] . " мин.
" : "") . "
" . (($item['goden']) ? "Срок годности: {$item['goden']} дн. " . ((!$item['count']) ? "(до " . date("Y.m.d H:i", $item['dategoden']) . ")" : "") . "
" : "") . "
@@ -172,52 +162,47 @@ function show_shop_items($it, $from = 'shop')
}
$r .= (($item['gmeshok']) ? "• Увеличивает рюкзак: +{$item['gmeshok']}
" : "") . "
- " . (($item['letter']) ? "Количество символов: " . strlen($item['letter']) . "
" : "") . "
- " . (($item['letter']) ? "На бумаге записан текст: " . nl2br($item['letter']) . "
" : "") . "
- " . (($item['opisan']) ? "• " . nl2br($item['opisan']) . "