* Project name: Battles-Game */ use Battles\Database\Db; use Battles\DressedItems; use Battles\Template; use Battles\User; require_once "../functions.php"; if (!User::getInstance()->getAdmin()) { header("HTTP/1.0 404 Not Found"); exit; } $player = $_POST['player'] ?? null; $undress_char = $_POST['undress_char'] ?? null; $end = $_POST['end'] ?? null; $del = $_POST['del'] ?? null; $inv = []; if ($player) { $row = Db::getInstance()->ofetch('select id, login from users where id = ? or login = ?', [$player, $player]); $_SESSION['player_id'] = $row->id; $_SESSION['player_name'] = $row->login; unset($row); } if ($undress_char) { DressedItems::undressAllItems($_SESSION['player_id']); } if ($end) { unset($_SESSION['player_id']); unset($_SESSION['player_name']); } if (isset($_SESSION['player_id'])) { $inv = Db::getInstance()->fetchAll('SELECT item_id, name, image FROM inventory WHERE owner_id = ? ORDER BY item_id DESC', $_SESSION['player_id']); } if ($del) { $itemdel = Db::getInstance()->fetch('SELECT item_type, dressed_slot FROM inventory WHERE item_id = ?', $del); if ($itemdel['dressed_slot'] == 1) { $item = new DressedItems($del); $item->undressItem($itemdel['item_type']); if ($itemdel['item_type'] == 5) { $item->undressItem(6); $item->undressItem(7); } } Db::getInstance()->execute('delete from inventory where item_id = ?', $del); } Template::header('ᐰdminка инвентаря'); ?>
ID | Название | Количество | Картинка | |
---|---|---|---|---|
= $row['id'] ?> | = $row['name'] ?> | = $row['koll'] ?> | ' alt=""> |