battles/shop.php

33 lines
774 B
PHP
Raw Permalink Normal View History

2018-01-28 16:40:49 +00:00
<?php
use Battles\Shop;
use Battles\ShopItem;
require_once 'functions.php';
if (!empty($_GET['otdel'])) {
if ($_GET['otdel'] === 'sale') {
Shop::id(Shop::GENERAL_SHOP)->categoryType = Shop::CATEGORY_SALE_ITEMS;
}
elseif ($_GET['otdel'] === 'market') {
Shop::id(Shop::GENERAL_SHOP)->categoryType = Shop::BARTER_SHOP;
}
else {
Shop::id(Shop::GENERAL_SHOP)->categoryType = $_GET['otdel'];
}
}
if (!empty($_POST['sellshop'])) {
ShopItem::sellItem($_POST['itemId'], 1);
}
if (!empty($_POST['buyshop'])) {
ShopItem::buyItem($_POST['itemId']);
2018-01-28 16:40:49 +00:00
}
if (!empty($_POST['buymarket'])) {
ShopItem::$status = 'попытка купить с рук предмет id: ' . $_POST['itemId'];
}
require_once 'views/shop.php';