diff --git a/ashop.php b/ashop.php index 18d9571..0290205 100644 --- a/ashop.php +++ b/ashop.php @@ -24,7 +24,7 @@ $shopItems = db::c()->query('SELECT `ashop`.*, `magic`.`needcharge` AS `magic_needcharge`, `magic`.`img` AS `magic_img` -FROM `ashop` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `count` > 0 AND `cost` > 0 AND `razdel` = ?i ORDER by `nlevel` ASC, `id` ASC', $_GET['otdel']); +FROM `ashop` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `count` > 0 AND `ecost` > 0 AND `razdel` = ?i ORDER by `nlevel` ASC, `id` ASC', $_GET['otdel']); $iteminfo = []; while ($row = $shopItems->fetch_assoc()) { @@ -74,69 +74,65 @@ if (!empty($_GET['buy'])) { } } $shopCategory = ''; -if ($_REQUEST['compare'] && !$_REQUEST['common'] && !$_REQUEST['present']) { - $shopCategory = "Составление подарочного букета"; -} else { - switch ($_GET['otdel']) { - default: - $shopCategory = "Кастеты и ножи"; - $_GET['otdel'] = 1; - break; - case 1: - $shopCategory = "Кастеты и ножи"; - break; - case 11: - $shopCategory = "Топоры"; - break; - case 12: - $shopCategory = "Дубины и булавы"; - break; - case 13: - $shopCategory = "Мечи"; - break; - case 14: - $shopCategory = "Луки и арбалеты"; - break; - case 2: - $shopCategory = "Сапоги"; - break; - case 21: - $shopCategory = "Перчатки"; - break; - case 22: - $shopCategory = "Легкая броня"; - break; - case 23: - $shopCategory = "Тяжелая броня"; - break; - case 24: - $shopCategory = "Шлемы"; - break; - case 3: - $shopCategory = "Щиты"; - break; - case 4: - $shopCategory = "Серьги"; - break; - case 41: - $shopCategory = "Ожерелья"; - break; - case 42: - $shopCategory = "Кольца"; - break; - case 5: - $shopCategory = "Заклинания: нейтральные"; - break; - case 51: - $shopCategory = "Заклинания: боевые и защитные"; - break; - case 6: - $shopCategory = "Амуниция"; - break; - case 7: - $shopCategory = "Букеты"; - break; - } +$shopCategoryTypeNumber = empty($_GET['otdel']) ?: $_GET['otdel']; +switch ($shopCategoryTypeNumber) { + default: + $shopCategory = "Кастеты и ножи"; + break; + case 1: + $shopCategory = "Кастеты и ножи"; + break; + case 11: + $shopCategory = "Топоры"; + break; + case 12: + $shopCategory = "Дубины и булавы"; + break; + case 13: + $shopCategory = "Мечи"; + break; + case 14: + $shopCategory = "Луки и арбалеты"; + break; + case 2: + $shopCategory = "Сапоги"; + break; + case 21: + $shopCategory = "Перчатки"; + break; + case 22: + $shopCategory = "Легкая броня"; + break; + case 23: + $shopCategory = "Тяжелая броня"; + break; + case 24: + $shopCategory = "Шлемы"; + break; + case 3: + $shopCategory = "Щиты"; + break; + case 4: + $shopCategory = "Серьги"; + break; + case 41: + $shopCategory = "Ожерелья"; + break; + case 42: + $shopCategory = "Кольца"; + break; + case 5: + $shopCategory = "Заклинания: нейтральные"; + break; + case 51: + $shopCategory = "Заклинания: боевые и защитные"; + break; + case 6: + $shopCategory = "Амуниция"; + break; + case 7: + $shopCategory = "Букеты"; + break; } ?> @@ -197,7 +193,7 @@ if ($_REQUEST['compare'] && !$_REQUEST['common'] && !$_REQUEST['present']) {
разные
Разное:
амуниция
-
букеты
+
букеты