Куча мелочей, в том числе по #42.

This commit is contained in:
lopar
2021-08-25 04:44:36 +03:00
parent cbbbb8a3c6
commit 1f38e6bd61
21 changed files with 223 additions and 378 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
<?php
use Battles\Bank;
use Battles\Database\DBPDO;
use Battles\Item;
use Battles\ShopItem;
use Battles\Template;
ob_start();
session_start();
require_once 'functions.php';
$saleItems = false;
@@ -71,12 +71,12 @@ switch ($shopCategoryTypeNumber) {
// MUST BE ARRAY!
$iteminfo = [];
if (!$saleItems) {
$shopItems = $db->ofetchAll("select * from items inner join trade_offers on id = shop_item_id where shop_id = 1 and shop_item_quantity !=0");
$shopItems = DBPDO::$db->ofetchAll("select * from items inner join trade_offers on id = shop_item_id where shop_id = 1 and shop_item_quantity !=0");
foreach ($shopItems as $shopItemObject) {
$iteminfo[] = new ShopItem($shopItemObject, 'buyshop');
}
} else {
$inventoryItems = $db->ofetchall("select * from inventory where on_sale = 0 and dressed_slot = 0 and durability > 0 and owner_id = ?", $user->getId());
$inventoryItems = DBPDO::$db->ofetchall("select * from inventory where on_sale = 0 and dressed_slot = 0 and durability > 0 and owner_id = ?", $user->getId());
foreach ($inventoryItems as $inventoryItemObject) {
$iteminfo[] = new ShopItem($inventoryItemObject, 'sellshop');
}