2018-01-28 16:40:49 +00:00
|
|
|
|
<?php
|
2021-01-27 15:19:05 +00:00
|
|
|
|
|
2021-08-27 15:55:18 +00:00
|
|
|
|
use Battles\InventoryItem;
|
2021-08-20 17:40:06 +00:00
|
|
|
|
use Battles\Item;
|
2021-08-29 22:34:50 +00:00
|
|
|
|
use Battles\Shop;
|
2021-01-27 15:19:05 +00:00
|
|
|
|
use Battles\ShopItem;
|
|
|
|
|
use Battles\Template;
|
2021-08-26 16:15:47 +00:00
|
|
|
|
use Battles\User;
|
2021-01-27 15:19:05 +00:00
|
|
|
|
|
2019-01-15 15:56:15 +00:00
|
|
|
|
require_once 'functions.php';
|
2021-08-29 22:34:50 +00:00
|
|
|
|
Shop::$current = new Shop(Shop::GENERAL_SHOP);
|
|
|
|
|
if (!empty($_GET['otdel'])) {
|
|
|
|
|
if ($_GET['otdel'] !== 'sale') {
|
|
|
|
|
Shop::$current->categoryType = $_GET['otdel'];
|
|
|
|
|
} else {
|
2021-08-29 22:37:45 +00:00
|
|
|
|
Shop::$current->categoryType = Shop::CATEGORY_SALE_ITEMS;
|
2021-08-29 22:34:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-08-20 17:40:06 +00:00
|
|
|
|
|
|
|
|
|
if (!empty($_POST['sellshop'])) {
|
2021-08-29 22:34:50 +00:00
|
|
|
|
ShopItem::sellItem($_POST['itemId'], User::$current, 1);
|
2021-08-20 17:40:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($_POST['buyshop'])) {
|
2021-08-29 22:34:50 +00:00
|
|
|
|
ShopItem::buyItem($_POST['itemId'], User::$current);
|
2018-01-28 16:40:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-27 15:19:05 +00:00
|
|
|
|
Template::header('Магазин');
|
2018-01-28 16:40:49 +00:00
|
|
|
|
?>
|
2021-08-29 22:34:50 +00:00
|
|
|
|
<link href='/css/shop.css' rel='stylesheet'>
|
2021-08-20 17:40:06 +00:00
|
|
|
|
<script src="js/main.js"></script>
|
2018-06-22 23:00:48 +00:00
|
|
|
|
<h1>Государственный магазин</h1>
|
2019-01-15 19:34:35 +00:00
|
|
|
|
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a>
|
2021-08-29 22:34:50 +00:00
|
|
|
|
<div class="status"><?= ShopItem::$status ?></div>
|
2021-08-22 18:58:28 +00:00
|
|
|
|
<table class="shop">
|
2021-08-20 17:40:06 +00:00
|
|
|
|
<tr>
|
2021-08-22 18:58:28 +00:00
|
|
|
|
<td>
|
2021-08-29 22:34:50 +00:00
|
|
|
|
<h3><?= Shop::$current->getCategoryName() ?></h3>
|
|
|
|
|
<?php if (Shop::$current->categoryType === -1): ?>
|
2021-08-22 18:58:28 +00:00
|
|
|
|
<div>Вы можете продать ваши предметы за сущие копейки.</div>
|
2019-01-15 15:56:15 +00:00
|
|
|
|
<?php endif; ?>
|
2018-06-22 23:00:48 +00:00
|
|
|
|
<!--Магазин-->
|
2021-08-22 18:58:28 +00:00
|
|
|
|
<table>
|
2021-08-29 22:34:50 +00:00
|
|
|
|
<?= Shop::$current->getItemsList() ?>
|
2021-08-20 17:40:06 +00:00
|
|
|
|
</table>
|
2021-08-22 18:58:28 +00:00
|
|
|
|
<td>
|
2021-08-29 22:34:50 +00:00
|
|
|
|
<div>
|
|
|
|
|
<strong>
|
|
|
|
|
Масса всех вещей: <?= InventoryItem::getWeightData() ?> <br>
|
|
|
|
|
Деньги: <?= User::$current->getMoney() ?>.
|
|
|
|
|
</strong>
|
|
|
|
|
</div>
|
2018-06-22 23:00:48 +00:00
|
|
|
|
<hr>
|
2021-08-22 18:58:28 +00:00
|
|
|
|
<div>Отделы магазина</div>
|
2021-08-29 22:34:50 +00:00
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_WEAPON ?>&rnd=<?= mt_rand() ?>">Оружие</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_HELMET ?>&rnd=<?= mt_rand() ?>">Шлемы</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_ARMOR ?>&rnd=<?= mt_rand() ?>">Броня</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_LEGS ?>&rnd=<?= mt_rand() ?>">Поножи</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_BOOTS ?>&rnd=<?= mt_rand() ?>">Сапоги</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_GLOVES ?>&rnd=<?= mt_rand() ?>">Перчатки</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_SHIELD ?>&rnd=<?= mt_rand() ?>">Щиты</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_BELT ?>&rnd=<?= mt_rand() ?>">Пояса</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_RING ?>&rnd=<?= mt_rand() ?>">Кольца</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_AMULET ?>&rnd=<?= mt_rand() ?>">Амулеты</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_CONSUMABLE ?>&rnd=<?= mt_rand() ?>">Расходники</a>
|
|
|
|
|
<a class="waretype" href="?otdel=<?= Item::ITEM_TYPE_OTHER ?>&rnd=<?= mt_rand() ?>">Разное</a>
|
2021-08-20 17:40:06 +00:00
|
|
|
|
<a class="waretype alltypes" href="?rnd=<?= mt_rand() ?>">Все товары</a>
|
|
|
|
|
<a class="waretype sell" href="?otdel=sale&rnd=<?= mt_rand() ?>">Продать вещи</a>
|
2018-06-22 23:00:48 +00:00
|
|
|
|
<div id="hint3" class="ahint"></div>
|
2021-08-29 22:34:50 +00:00
|
|
|
|
<div>
|
|
|
|
|
<small>Если у вас не хватит денег на покупку, деньги будут автоматически сняты с вашего банковского
|
|
|
|
|
счёта
|
|
|
|
|
с вычетом банковской комиссии за услуги.</small>
|
|
|
|
|
</div>
|
2021-08-20 17:40:06 +00:00
|
|
|
|
</table>
|