This commit is contained in:
Igor Barkov [iwork] 2019-02-15 17:25:53 +02:00
parent 313870a1fc
commit f2d18665a5
2 changed files with 5 additions and 18 deletions

View File

@ -37,7 +37,7 @@ class ShopItem extends Item
if ($shopType === 'marketput') { if ($shopType === 'marketput') {
echo <<<BTN echo <<<BTN
<form method="post"> <form method="post">
<input placeholder="Цена" name="cost"> <input placeholder="{$this->cost}" name="cost">
<input type="hidden" name="putId" value="{$this->id}"> <input type="hidden" name="putId" value="{$this->id}">
<br><input type="submit" name="putToMarket" value="ать в магазин"> <br><input type="submit" name="putToMarket" value="ать в магазин">
</form> </form>

View File

@ -18,13 +18,9 @@ if ($user['battle'] != 0) {
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING')); $get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
$itemCost = (int)filter_input(INPUT_GET, 'kredit', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]); $itemCost = (int)filter_input(INPUT_POST, 'cost', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
$itemId = (int)filter_input(INPUT_GET, 'n', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]); $itemId = (int)filter_input(INPUT_POST, 'putId', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
$returningItemId = (int)filter_input(INPUT_GET, 'back', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]); $returningItemId = (int)filter_input(INPUT_GET, 'back', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
$puttingItemPrice = (int)filter_input(INPUT_POST, 'cost', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
//if (isset($_GET['kredit'])) $itemCost = checkIntInRange($_GET['kredit']);
//if (isset($_GET['n'])) $itemId = checkIntInRange($_GET['n']);
//if (isset($_GET['back'])) $returningItemId = checkIntInRange($_GET['back']);
if ($itemCost && $itemId) { if ($itemCost && $itemId) {
$commission = ceil($itemCost / 10); # 10% от суммы с округлением вверх. $commission = ceil($itemCost / 10); # 10% от суммы с округлением вверх.
@ -50,11 +46,7 @@ if ($returningItemId) {
} else $status = "Предмет не найден на полках магазина!"; } else $status = "Предмет не найден на полках магазина!";
} }
if (isset($_POST['putToMarket'])) {
if ($puttingItemPrice > 0) {
$dress = db::c()->query()->fetch_assoc();
} else $status = "Хорошая попытка…";
}
if ($_GET['set']) { if ($_GET['set']) {
@ -250,12 +242,7 @@ switch ($shopCategoryTypeNumber) {
foreach ($iteminfo as $ii) { foreach ($iteminfo as $ii) {
echo "<tr><td style='width: 150px; text-align: center;'>"; echo "<tr><td style='width: 150px; text-align: center;'>";
$ii->printImage(); $ii->printImage();
$ii->printControls('marketput');?> $ii->printControls('marketput');
<form method="post">
<input placeholder="Цена" name="cost">
<br><input type="submit" name="puttomarket" value="ать в магазин">
</form>
<?php
echo "</td>"; echo "</td>";
echo "<td style='vertical-align: top;'>"; echo "<td style='vertical-align: top;'>";
$ii->printInfo(); $ii->printInfo();