Фикс: Не открывается отдел продажи.
This commit is contained in:
parent
de2d24c2dd
commit
760bbe31be
9
shop.php
9
shop.php
@ -17,6 +17,7 @@ if ($user['battle'] != 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sellItemId = filter_input(INPUT_GET,'sellitem');
|
$sellItemId = filter_input(INPUT_GET,'sellitem');
|
||||||
|
$saleItems = false;
|
||||||
|
|
||||||
if ($sellItemId && is_numeric($sellItemId)) {
|
if ($sellItemId && is_numeric($sellItemId)) {
|
||||||
$dress = db::c()->query('SELECT `id`, `name`, `cost`, `type`, `duration`, `maxdur`, `goden`, `dategoden`, `koll` FROM `inventory` WHERE `dressed` = 0 AND `id` = ?i AND `owner` = ?i', $sellItemId, $user['id'])->fetch_assoc();
|
$dress = db::c()->query('SELECT `id`, `name`, `cost`, `type`, `duration`, `maxdur`, `goden`, `dategoden`, `koll` FROM `inventory` WHERE `dressed` = 0 AND `id` = ?i AND `owner` = ?i', $sellItemId, $user['id'])->fetch_assoc();
|
||||||
@ -175,13 +176,12 @@ 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();
|
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc();
|
||||||
|
|
||||||
$shopCategoryType = empty($_POST['sale']) ?: $_POST['sale'];
|
$shopCategoryType = empty($_POST['sale']) ?: $_POST['sale'];
|
||||||
$shopCategoryTypeNumber = empty($_GET['otdel']) ?: $_GET['otdel'];
|
$shopCategoryTypeNumber = empty($_GET['otdel']) ?: $_GET['otdel'];
|
||||||
switch ($shopCategoryTypeNumber) {
|
switch ($shopCategoryTypeNumber) {
|
||||||
default:
|
default:
|
||||||
$shopCategoryType = "Кастеты и ножи";
|
$shopCategoryType = "Скупка товара";
|
||||||
$_GET['otdel'] = 1;
|
$saleItems = true;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$shopCategoryType = "Кастеты и ножи";
|
$shopCategoryType = "Кастеты и ножи";
|
||||||
@ -294,7 +294,7 @@ switch ($shopCategoryTypeNumber) {
|
|||||||
<TD>
|
<TD>
|
||||||
<TABLE class="zebra" WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
|
<TABLE class="zebra" WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
|
||||||
<?php
|
<?php
|
||||||
if(isset($_REQUEST['sale']) && $_REQUEST['sale']!="") {
|
if($saleItems == true) {
|
||||||
// Выбираем всё потому что эту выборку потом использует showitem();
|
// Выбираем всё потому что эту выборку потом использует 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);
|
$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);
|
||||||
while ($row = $data->fetch_assoc()) {
|
while ($row = $data->fetch_assoc()) {
|
||||||
@ -359,6 +359,7 @@ switch ($shopCategoryTypeNumber) {
|
|||||||
<BR>У вас в наличии: <span style="color: #339900;"><?= $user['money'] ?></span> кр.</B>
|
<BR>У вас в наличии: <span style="color: #339900;"><?= $user['money'] ?></span> кр.</B>
|
||||||
<hr>
|
<hr>
|
||||||
<INPUT TYPE="submit" value="Продать вещи" name="sale"><BR><br/>
|
<INPUT TYPE="submit" value="Продать вещи" name="sale"><BR><br/>
|
||||||
|
<a href="shop.php?otdel=sale&rnd=<?= mt_rand() ?>">Продажа товаров</a>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><b>Оружие:</b></dt>
|
<dt><b>Оружие:</b></dt>
|
||||||
<dd><a href="shop.php?otdel=1&rnd=<?= mt_rand() ?>">кастеты,ножи</a></dd>
|
<dd><a href="shop.php?otdel=1&rnd=<?= mt_rand() ?>">кастеты,ножи</a></dd>
|
||||||
|
Loading…
Reference in New Issue
Block a user