From 9137912c9fb805f7dce46dc9d6c83fc45e629871 Mon Sep 17 00:00:00 2001 From: lopar Date: Sat, 12 Jan 2019 11:34:24 +0200 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BC=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Item.php | 19 ++++++++++++++++--- test.php | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/classes/Item.php b/classes/Item.php index dde06c1..cd7353d 100644 --- a/classes/Item.php +++ b/classes/Item.php @@ -8,7 +8,7 @@ abstract class Item public $maxdur; public $img; - public $type; + public $type; # эти. что есть что нет... private $typename; public $nlevel; @@ -125,8 +125,21 @@ abstract class Item $this->mfauvorot = $row['mfauvorot']; switch ($this->type) { - case 1: $this->typename = 'Шлем'; break; - default: $this->typename = 'Нечто'; + case 1: $this->typename = 'Серьги'; break; + case 2: $this->typename = 'Ожерелье'; break; + case 3: $this->typename = 'Оружие'; break; + case 4: $this->typename = 'Серьги'; break; + case 5: $this->typename = 'Кольцо'; break; + + case 8: $this->typename = 'Шлем'; break; + case 9: $this->typename = 'Перчатки'; break; + case 10: $this->typename = 'Щит'; break; + case 11: $this->typename = 'Обувь'; break; + case 12: $this->typename = 'Магический свиток'; break; + case 22: $this->typename = 'Рубашка'; break; + case 50: $this->typename = 'Волшебное зелье'; break; + case 200: $this->typename = 'Сувенир'; break; + default: $this->typename = 'Хлам'; } } diff --git a/test.php b/test.php index b8897d8..bd5511c 100644 --- a/test.php +++ b/test.php @@ -14,9 +14,9 @@ require_once 'config.php'; //print_r($items); # $items = []; foreach(фетч того ебучего массива as $value) {$items[$value['id']] = $value} +$iteminfo =[]; $result = db::c()->query('SELECT * FROM `shop` WHERE count > 0'); $result2 = db::c()->query('SELECT * FROM `inventory` WHERE owner = 11263'); - while ($row = $result->fetch_assoc()) { $iteminfo[] = new ShopItem($row); } @@ -25,7 +25,7 @@ while ($row = $result2->fetch_assoc()) { $iteminfo[] = new InventoryItem($row); } -echo ""; +echo "
Товары магазина
"; foreach ($iteminfo as $ii) { echo "
"; $ii->printImage();