Example #1
0
        if (AuctionFuncs::SellFixed(getVar('id', 'int', 'post'), getVar('qty', 'int', 'post'), getVar('priceFixed', 'double', 'post'), getVar('desc', 'string', 'post'))) {
            $_SESSION['success'][] = 'Auction created successfully!';
            ForwardTo(getLastPage(), 0);
            exit;
        }
    } else {
        // auction
        if ($config['action'] == 'auction') {
            //TODO:
            echo 'Sorry, this feature isn\'t ready yet';
            exit;
        } else {
            // server shop
            if ($config['action'] == 'servershop') {
                CSRF::ValidateToken();
                if (ServerShopFuncs::CreateShop(getVar('id', 'int', 'post'), getVar('qty', 'int', 'post'), getVar('priceBuy', 'double', 'post'), getVar('priceSell', 'double', 'post'))) {
                    $_SESSION['success'][] = 'Server Shop created successfully!';
                    ForwardTo(getLastPage(), 0);
                    exit;
                }
            }
        }
    }
}
function RenderPage_sell()
{
    global $config, $html, $user;
    $config['title'] = 'Sell Items';
    $id = getVar('id', 'int');
    // load page html
    $outputs = RenderHTML::LoadHTML('pages/sell.php');
    } else {
        // sell to server shop
        if (ServerShopFuncs::SellShop(getVar('shopid', 'int', 'post'), getVar('qty', 'int', 'post'))) {
            ForwardTo(getLastPage(), 0);
            exit;
        }
    }
}
if ($config['action'] == 'cancel') {
    CSRF::ValidateToken();
    // inventory is locked
    if ($config['user']->isLocked()) {
        $_SESSION['error'][] = 'Your inventory is currently locked.<br />Please close your in game inventory and try again.';
    } else {
        // cancel server shop
        if (ServerShopFuncs::CancelShop(getVar('shopid', 'int', 'post'))) {
            $_SESSION['success'][] = 'Server Shop canceled!';
            ForwardTo(getLastPage(), 0);
            exit;
        }
    }
}
// render page (ajax/json)
function RenderPage_servershops_ajax()
{
    global $config, $html;
    //file_put_contents('ajax_get.txt',print_r($_GET,TRUE));
    header('Content-Type: text/plain');
    // list server shops
    $shops = QueryAuctions::QueryShops();
    $TotalDisplaying = QueryAuctions::TotalDisplaying();