Стандартизация имён переменных
This commit is contained in:
parent
6508ec4935
commit
9019d86514
50
shop.php
50
shop.php
@ -176,69 +176,68 @@ if (isset($_GET['set']) OR isset($_POST['set'])) {
|
||||
}
|
||||
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
|
||||
|
||||
$shopItemType = empty($_POST['sale']) ?: $_POST['sale'];
|
||||
$shopItemTypeNumber = empty($_GET['otdel']) ?: $_GET['otdel'];
|
||||
switch ($shopItemTypeNumber) {
|
||||
$shopCategoryType = empty($_POST['sale']) ?: $_POST['sale'];
|
||||
$shopCategoryTypeNumber = empty($_GET['otdel']) ?: $_GET['otdel'];
|
||||
switch ($shopCategoryTypeNumber) {
|
||||
default:
|
||||
$shopItemType = "кастеты,ножи";
|
||||
$shopCategoryType = "Кастеты и ножи";
|
||||
$_GET['otdel'] = 1;
|
||||
break;
|
||||
case 1:
|
||||
$shopItemType = "кастеты,ножи";
|
||||
$shopCategoryType = "Кастеты и ножи";
|
||||
break;
|
||||
case 11:
|
||||
$shopItemType = "топоры";
|
||||
$shopCategoryType = "Топоры";
|
||||
break;
|
||||
case 12:
|
||||
$shopItemType = "дубины,булавы";
|
||||
$shopCategoryType = "Дубины и булавы";
|
||||
break;
|
||||
case 13:
|
||||
$shopItemType = "мечи";
|
||||
$shopCategoryType = "Мечи";
|
||||
break;
|
||||
case 14:
|
||||
$shopItemType = "луки и арбалеты";
|
||||
$shopCategoryType = "Луки и арбалеты";
|
||||
break;
|
||||
case 2:
|
||||
$shopItemType = "сапоги";
|
||||
$shopCategoryType = "Сапоги";
|
||||
break;
|
||||
case 21:
|
||||
$shopItemType = "перчатки";
|
||||
$shopCategoryType = "Перчатки";
|
||||
break;
|
||||
case 22:
|
||||
$shopItemType = "легкая броня";
|
||||
$shopCategoryType = "Легкая броня";
|
||||
break;
|
||||
case 23:
|
||||
$shopItemType = "тяжелая броня";
|
||||
$shopCategoryType = "Тяжелая броня";
|
||||
break;
|
||||
case 24:
|
||||
$shopItemType = "шлемы";
|
||||
$shopCategoryType = "Шлемы";
|
||||
break;
|
||||
case 3:
|
||||
$shopItemType = "Щиты";
|
||||
$shopCategoryType = "Щиты";
|
||||
break;
|
||||
case 4:
|
||||
$shopItemType = "Ювелирные товары: серьги";
|
||||
$shopCategoryType = "Серьги";
|
||||
break;
|
||||
case 41:
|
||||
$shopItemType = "Ювелирные товары: ожерелья";
|
||||
$shopCategoryType = "Ожерелья";
|
||||
break;
|
||||
case 42:
|
||||
$shopItemType = "Ювелирные товары: кольца";
|
||||
$shopCategoryType = "Кольца";
|
||||
break;
|
||||
case 5:
|
||||
$shopItemType = "Заклинания: нейтральные";
|
||||
$shopCategoryType = "Заклинания: нейтральные";
|
||||
break;
|
||||
case 51:
|
||||
$shopItemType = "Заклинания: боевые и защитные";
|
||||
$shopCategoryType = "Заклинания: боевые и защитные";
|
||||
break;
|
||||
case 6:
|
||||
$shopItemType = "Амуниция";
|
||||
$shopCategoryType = "Амуниция";
|
||||
break;
|
||||
case 52:
|
||||
$shopItemType = "Руны";
|
||||
$shopCategoryType = "Руны";
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@ -288,14 +287,14 @@ switch ($shopItemTypeNumber) {
|
||||
<TABLE border=0 width=100% cellspacing="0" cellpadding="0" bgcolor="#A5A5A5">
|
||||
<TR>
|
||||
<TD align=center>
|
||||
<h3>Отдел "<?= $shopItemType ?>"</h3>
|
||||
<h3><?= $shopCategoryType ?></h3>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>
|
||||
<TABLE class="zebra" WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
|
||||
<?php
|
||||
$sale = filter_input(INPUT_REQUEST,'sale');
|
||||
$sale = $_REQUEST['sale'];
|
||||
if ($sale) {
|
||||
// Выбираем всё потому что эту выборку потом использует showitem();
|
||||
$data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0 AND `cost` > 0 AND `present` = "?s" AND `tradesale` = 0 AND `podzem` = 0 ORDER BY `update` DESC', $user['id'], null);
|
||||
@ -383,6 +382,7 @@ switch ($shopItemTypeNumber) {
|
||||
<dd><a href="shop.php?otdel=5&rnd=<?= mt_rand() ?>">разные</a></dd>
|
||||
<dt><b>Разное:</b></dt>
|
||||
<dd><a href="shop.php?otdel=6&rnd=<?= mt_rand() ?>">амуниция</a></dd>
|
||||
<dd><a href="shop.php?otdel=52&rnd=<?= mt_rand() ?>">руны</a></dd>
|
||||
</dl>
|
||||
<div id="hint3" class="ahint"></div>
|
||||
</TD>
|
||||
|
Loading…
Reference in New Issue
Block a user