notice fixes

This commit is contained in:
Igor Barkov [iwork] 2019-01-15 18:05:19 +02:00
parent 016e5a9ccd
commit e2ca31b543

126
ashop.php
View File

@ -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;
}
?>
<!DOCTYPE html>
@ -197,7 +193,7 @@ if ($_REQUEST['compare'] && !$_REQUEST['common'] && !$_REQUEST['present']) {
<dd><a href="?otdel=5&rnd=<?= mt_rand() ?>">разные</a></dd>
<dt><b>Разное:</b></dt>
<dd><a href="?otdel=6&rnd=<?= mt_rand() ?>">амуниция</a></dd>
<dd><a href="?otdel=7rnd=<?= mt_rand() ?>">букеты</a></dd>
<dd><a href="?otdel=7&rnd=<?= mt_rand() ?>">букеты</a></dd>
</dl>
</td>
</tr>