Изменено поле в БД, вынесены лишние функции их functions в профильные файлы. Оказывается, давно не работал логин и плохо работали сессии. Проверяется. Прочие мелкие баги и чистка самых хвостов.

This commit is contained in:
Igor Barkov (iwork)
2021-08-27 18:55:18 +03:00
parent 9c7fcda600
commit 7434f28fa6
36 changed files with 293 additions and 341 deletions
+6 -4
View File
@@ -1,6 +1,8 @@
<?php
use Battles\Database\DBPDO;
use Battles\GameLogs;
use Battles\InventoryItem;
use Battles\ShopItem;
use Battles\Template;
@@ -13,7 +15,7 @@ $byingItemId = (int)filter_input(INPUT_GET, 'set', FILTER_VALIDATE_INT, ['option
if ($putItemId) {
$query = 'select name from inventory where dressed_slot = 0 and owner_id = ? and item_id = ?';
\Battles\Database\DBPDO::INIT()->ofetch($query, [$_SESSION['uid'], $putItemId]);
DBPDO::INIT()->ofetch($query, [$_SESSION['uid'], $putItemId]);
$dress = db::c()->query('SELECT `name`,`duration`,`maxdur`,`cost` FROM `inventory` WHERE `dressed` = 0 AND `id` = ?i AND `owner` = ?i', $putItemId, $_SESSION['uid'])->fetch_assoc();
if (empty($putItemCost)) {
$putItemCost = $dress['cost'];
@@ -89,10 +91,10 @@ if ($get === 'sale') {
}
if (isset($search)) {
$data = \Battles\Database\DBPDO::INIT()->ofetchAll($query, $search);
$data = DBPDO::INIT()->ofetchAll($query, $search);
unset($search);
} else {
$data = \Battles\Database\DBPDO::INIT()->ofetchAll($query);
$data = DBPDO::INIT()->ofetchAll($query);
}
$iteminfo = [];
@@ -141,7 +143,7 @@ Template::header('Рынок');
</table>
<TD valign=top width=280>
<div style="margin-left:15px; margin-top: 10px;">
<b>Масса всех ваших вещей: <?= getItemsMassaInfo() ?>
<b>Масса всех ваших вещей: <?= InventoryItem::getWeightData() ?>
<br>У вас в наличии: <span style="color: darkgreen;"><?= $user['money'] ?></span> кр.</b>
<hr>
<br>