EMPTY_SLOT; use Rooms; public function __construct($user) { $user_query = db::c()->query('SELECT * FROM users WHERE id = "?s" OR login = "?s"', $user, $user)->fetch_assoc(); foreach ($this as $key => $value) { if (isset($user_query[$key])) { $this->$key = $user_query[$key]; } } } protected function showItem($item = 0) { $itemSlot = $item['dressed_slot'] ?? 0; $itemName = $item['name'] ?? ''; $itemImage = $item['image'] ?? ''; if ($itemSlot) { echo << {$itemName} SLOT; } else { echo << EMPTY_SLOT; } } public function showUserInfo() { $dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->id); while ($row = $dressed_items->fetch_assoc()) { $dressed_item[$row['dressed_slot']] = $row; } echo ''; echo '
'; echo ''; } }