2018-01-28 16:40:49 +00:00
|
|
|
|
<?php
|
2021-01-27 15:19:05 +00:00
|
|
|
|
|
2021-08-29 22:34:50 +00:00
|
|
|
|
use Battles\Shop;
|
2021-01-27 15:19:05 +00:00
|
|
|
|
use Battles\ShopItem;
|
|
|
|
|
|
2019-01-15 15:56:15 +00:00
|
|
|
|
require_once 'functions.php';
|
2022-01-26 23:15:33 +00:00
|
|
|
|
|
2021-08-29 22:34:50 +00:00
|
|
|
|
if (!empty($_GET['otdel'])) {
|
2022-01-21 16:17:56 +00:00
|
|
|
|
if ($_GET['otdel'] === 'sale') {
|
2022-01-26 23:15:33 +00:00
|
|
|
|
Shop::id(Shop::GENERAL_SHOP)->categoryType = Shop::CATEGORY_SALE_ITEMS;
|
2021-08-29 22:34:50 +00:00
|
|
|
|
}
|
2022-01-21 16:17:56 +00:00
|
|
|
|
elseif ($_GET['otdel'] === 'market') {
|
2022-01-26 23:15:33 +00:00
|
|
|
|
Shop::id(Shop::GENERAL_SHOP)->categoryType = Shop::BARTER_SHOP;
|
2022-01-21 16:17:56 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
2022-01-26 23:15:33 +00:00
|
|
|
|
Shop::id(Shop::GENERAL_SHOP)->categoryType = $_GET['otdel'];
|
2022-01-21 16:17:56 +00:00
|
|
|
|
}
|
2021-08-29 22:34:50 +00:00
|
|
|
|
}
|
2021-08-20 17:40:06 +00:00
|
|
|
|
|
|
|
|
|
if (!empty($_POST['sellshop'])) {
|
2022-08-09 19:57:43 +00:00
|
|
|
|
ShopItem::sellItem($_POST['itemId'], 1);
|
2021-08-20 17:40:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($_POST['buyshop'])) {
|
2022-08-09 19:57:43 +00:00
|
|
|
|
ShopItem::buyItem($_POST['itemId']);
|
2018-01-28 16:40:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 07:43:48 +00:00
|
|
|
|
if (!empty($_POST['buymarket'])) {
|
|
|
|
|
ShopItem::$status = 'попытка купить с рук предмет id: ' . $_POST['itemId'];
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-09 19:57:43 +00:00
|
|
|
|
require_once 'views/shop.php';
|