This commit is contained in:
Igor Barkov [iwork] 2019-01-11 18:26:33 +02:00
parent d68f9b232a
commit 642fb82938
3 changed files with 9 additions and 1 deletions

View File

@ -64,6 +64,11 @@ class Item
public $mfuvorot; public $mfuvorot;
public $mfauvorot; public $mfauvorot;
/**
* Item constructor.
*
* @param $row
*/
public function __construct($row) public function __construct($row)
{ {
$this->name = $row['name']; $this->name = $row['name'];

View File

@ -8,6 +8,9 @@
class ItemClass extends Item class ItemClass extends Item
{ {
/**
*
*/
public function printItemStats() public function printItemStats()
{ {
echo $this->name ." (Масса: ". $this->massa .")<br>"; echo $this->name ." (Масса: ". $this->massa .")<br>";

View File

@ -17,7 +17,7 @@ require_once 'config.php';
$result = db::c()->query('SELECT * FROM `shop` WHERE count > 0'); $result = db::c()->query('SELECT * FROM `shop` WHERE count > 0');
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
$iteminfo[] = new Item($row); $iteminfo[] = new ItemClass($row);
} }
foreach ($iteminfo as $iinfo) { foreach ($iteminfo as $iinfo) {