From 730c016367aef63a5f5e5362a6d3ee87653e0cc9 Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Fri, 11 Jan 2019 18:17:45 +0200 Subject: [PATCH] tests --- admin/test.php | 9 +++++++-- classes/Item.php | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/admin/test.php b/admin/test.php index abf9886..ed56709 100644 --- a/admin/test.php +++ b/admin/test.php @@ -30,6 +30,11 @@ print_r($items); # $items = []; foreach(фетч того ебучего массива as $value) {$items[$value['id']] = $value} $result = db::c()->query('SELECT * FROM `shop` WHERE count > 0'); + while ($row = $result->fetch_assoc()) { - $iteminfo[] = new Item($row); -} \ No newline at end of file + $iteminfo[] = new ItemStats($row); +} + +foreach ($iteminfo as $iinfo) { + $iinfo->printItemStats(); +} diff --git a/classes/Item.php b/classes/Item.php index 528e8f3..5f7d0fd 100644 --- a/classes/Item.php +++ b/classes/Item.php @@ -122,7 +122,10 @@ class Item $this->mfuvorot = $row['mfuvorot']; $this->mfauvorot = $row['mfauvorot']; } +} +class ItemStats extends Item +{ public function printItemStats() { echo $this->name ." (Масса: ". $this->massa .")
";