diff --git a/classes/InventoryItem.php b/classes/InventoryItem.php index 65359c5..c7c1667 100644 --- a/classes/InventoryItem.php +++ b/classes/InventoryItem.php @@ -43,4 +43,9 @@ NAME; onclick="location='/admin.php'"> BTN; } + + public function getId() + { + return $this->id; + } } \ No newline at end of file diff --git a/post.php b/post.php index 5cef336..e82c8cd 100644 --- a/post.php +++ b/post.php @@ -32,7 +32,7 @@ if ($_SESSION['receiverName']) { } else { $receiverId = $receiver['id']; $submit = filter_input(INPUT_POST, 'action'); - $sendItemId = filter_input(INPUT_POST,'item_id'); + $sendItemId = filter_input(INPUT_POST, 'item_id'); $telegraphText = filter_input(INPUT_POST, 'message'); if ($submit == 'sendMessage' && $telegraphText && $user['money'] >= 1) { @@ -52,8 +52,8 @@ if ($_SESSION['receiverName']) { db::c()->query('UPDATE `users` SET `money` = `money` - 1 WHERE id=?i', $user['id']); db::c()->query('UPDATE `inventory` SET `owner` = ?i WHERE `id`= ?i AND `owner`= ?i', $receiverId, $sendItemId, $_SESSION['uid']); //TODO: Добавить логи и статистику. - $statusMessage = 'Предмет "' . $res['name'] . '" передан персонажу ' . $receiverId; - db::c()->query('INSERT INTO `telegraph` (`receiver`,`text`) VALUES (?i,"?s")', $receiverId, 'Почтовый перевод: '. $res['name'] .' от персонажа ' .$user['login']. '.'); + $statusMessage = 'Предмет "' . $res['name'] . '" передан персонажу ' . $receiverId; + db::c()->query('INSERT INTO `telegraph` (`receiver`,`text`) VALUES (?i,"?s")', $receiverId, 'Почтовый перевод: ' . $res['name'] . ' от персонажа ' . $user['login'] . '.'); } } $queryItems = db::c()->query('SELECT `inventory`.*, @@ -64,6 +64,10 @@ if ($_SESSION['receiverName']) { `magic`.`targeted` AS `magic_targeted`, `magic`.`needcharge` AS `magic_needcharge`, `magic`.`img` AS `magic_img` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0 AND `present` = "?s" AND `artefact` = 0 ORDER BY `update` DESC', $_SESSION['uid'], null); + $iteminfo = []; + while ($row = $queryItems->fetch_assoc()) { + $iteminfo[] = new InventoryItem($row); + } } } ?> @@ -107,22 +111,22 @@ if ($_SESSION['receiverName']) {
Передача предметов | - fetch_assoc()): ?> +|||
---|---|---|---|
- + | + printImage(); ?> | -- + | + printInfo(); ?> |
Нечего передавать... |