diff --git a/comission.php b/comission.php index 8a5bb3c..4c8afc7 100644 --- a/comission.php +++ b/comission.php @@ -101,13 +101,9 @@ if ($get === 'sale') { 0 AS `maxdur` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `setsale` = 0 AND `dressed` = 0 AND `present` = "?s" AND `owner` = ?i ORDER BY `update` DESC ', '', $_SESSION['uid']); - $iteminfo = []; - while ($row = $data->fetch_assoc()) { - $iteminfo[] = new ShopItem($row); - } } -if ($get === 'unsale') { +elseif ($get === 'unsale') { $data = db::c()->query('SELECT `inventory`.*, `magic`.`name` AS `magic_name`, `magic`.`chanse` AS `magic_chanse`, @@ -119,13 +115,9 @@ if ($get === 'unsale') { 0 AS `maxdur` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `setsale` > 0 AND `dressed` = 0 AND `owner` = ?i ORDER BY `update` DESC', $_SESSION['uid']); - $iteminfo = []; - while ($row = $data->fetch_assoc()) { - $iteminfo[] = new ShopItem($row); - } } -if (isset($_GET['max'])) { +else if (!empty($_POST['search'])) { $data = db::c()->query('SELECT `inventory`.*, `magic`.`name` AS `magic_name`, `magic`.`chanse` AS `magic_chanse`, @@ -136,11 +128,26 @@ if (isset($_GET['max'])) { `magic`.`img` AS `magic_img`, 0 AS `maxdur` -FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `dressed` = 0 AND `inventory`.`name` LIKE "?S%" AND `setsale` > 0 ORDER BY `setsale` ASC', $_GET['max']); - $iteminfo = []; - while ($row = $data->fetch_assoc()) { - $iteminfo[] = new ShopItem($row); - } +FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `dressed` = 0 AND `inventory`.`name` LIKE "%?S%" AND `setsale` > 0 ORDER BY `setsale` ASC', $_POST['search']); +} + +else { + $data = db::c()->query('SELECT `inventory`.*, + `magic`.`name` AS `magic_name`, + `magic`.`chanse` AS `magic_chanse`, + `magic`.`time` AS `magic_time`, + `magic`.`file` AS `magic_file`, + `magic`.`targeted` AS `magic_targeted`, + `magic`.`needcharge` AS `magic_needcharge`, + `magic`.`img` AS `magic_img`, + 0 AS `maxdur` + +FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `dressed` = 0 AND `setsale` > 0 ORDER BY `setsale` ASC'); +} + +$iteminfo = []; +while ($row = $data->fetch_assoc()) { + $iteminfo[] = new ShopItem($row); } ?> @@ -169,7 +176,9 @@ FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `dressed` = 0 else { echo << - +
+ +
MARKET; } ?> @@ -178,17 +187,7 @@ MARKET; "; - echo ""; - } - } elseif ($get === 'sale') { + if ($get === 'sale') { foreach ($iteminfo as $ii) { echo ""; } } else { - $data = db::c()->query('SELECT DISTINCT `img`, `name`, `nalign`, `massa` FROM `inventory` WHERE `dressed` = 0 AND `setsale` > 0 AND `present` = "?s" GROUP BY `img` ORDER BY `cost` ASC', ''); - $replacements = ['+1', '+2', '+3', '+4', '+5', ' (мф)']; - while ($row = $data->fetch_assoc()) { - $item_name = str_replace($replacements, '', $row['name']); - $item = db::c()->query('SELECT COUNT(`id`), MIN(`duration`), MIN(`maxdur`), MAX(`duration`), MAX(`maxdur`), MIN(`setsale`), MAX(`setsale`) FROM `inventory` WHERE `dressed` = 0 AND `setsale` > 0 AND `present` = "?s" AND `name` LIKE "?S%"', '', $item_name)->fetch_row(); - ?> - - - - - "; + echo ""; } } ?>
"; - $ii->printImage(); - $ii->printControls('marketbuy'); - echo ""; - $ii->printInfo(); - echo "
"; $ii->printImage(); @@ -209,26 +208,14 @@ MARKET; echo "
- -
подробнее -
- - - (Масса: )
(количество: )
- Цена: - кр. -
Долговечность: -/-
-
"; + $ii->printImage(); + $ii->printControls('marketbuy'); + echo ""; + $ii->printInfo(); + echo "