$players = array();
    while (list($player) = mysql_fetch_row($queryPlayers)) {
        $players[$player] = 0;
    }
    $queryItems = mysql_query("SELECT * FROM WA_Items");
    while (list($id, $name, $damage, $player, $quantity) = mysql_fetch_row($queryItems)) {
        $cost = $quantity * ($costPerItemPerDay / $numberOfChecksPerDay);
        $players[$player] += $cost;
    }
    foreach ($players as $p => $v) {
        $account = new EconAccount($p, $useMySQLiConomy, $iConTableName);
        $account->spend($v, $useMySQLiConomy, $iConTableName);
    }
    //Stored in mail box
    $queryPlayers = mysql_query("SELECT DISTINCT player FROM WA_Mail");
    $players = array();
    while (list($player) = mysql_fetch_row($queryPlayers)) {
        $players[$player] = 0;
    }
    $queryItems = mysql_query("SELECT * FROM WA_Mail");
    while (list($id, $name, $damage, $player, $quantity) = mysql_fetch_row($queryItems)) {
        $cost = $quantity * ($costPerItemPerDay / $numberOfChecksPerDay);
        $players[$player] += $cost;
    }
    foreach ($players as $p => $v) {
        $account = new EconAccount($p, $useMySQLiConomy, $iConTableName);
        $account->spend($v, $useMySQLiConomy, $iConTableName);
    }
    $next = $now + 86400 / $numberOfChecksPerDay;
    $insert = mysql_query("INSERT INTO WA_StorageCheck (time) VALUES ({$next})");
}
    header("Location: ../myauctions.php");
}
require 'itemInfo.php';
require_once '../classes/EconAccount.php';
require_once '../classes/Item.php';
if ($useTwitter == true) {
    require_once 'twitter.class.php';
}
$itemId = mysql_real_escape_string(stripslashes($_POST['Item']));
$minBid = mysql_real_escape_string(stripslashes(round($_POST['MinBid'], 2)));
$allowBids = 1;
if (mysql_real_escape_string(stripslashes($_POST['MinBid'])) == "") {
    $allowBids = 0;
}
$item = new Item($itemId);
$player = new EconAccount($user, $useMySQLiConomy, $iConTableName);
$sellPrice = round($_POST['Price'], 2);
$sellPricePerQuantity = round($_POST['Stackprice'], 2);
if (!itemAllowed($item->name, $item->damage)) {
    $_SESSION['error'] = $item->fullname . $lang['newAuction']['item_not_allowed'];
    header("Location: ../myauctions.php");
} else {
    if ($sellPrice > $maxSellPrice) {
        $sellPrice == $maxSellPrice;
    }
    $sellQuantity = floor($_POST['Quantity']);
    //echo is_numeric($sellQuantity);
    if ($sellQuantity < 0) {
        $_SESSION['error'] = $lang['newAuction']['invalid_quantity'];
        header("Location: ../myauctions.php");
        exit;
require 'config.php';
if ($canBuy == false) {
    $_SESSION['error'] = $lang['purchaseItem']['no_buy'];
    header("Location: ../index.php");
}
require 'itemInfo.php';
require_once '../classes/Auction.php';
require_once '../classes/EconAccount.php';
if ($useTwitter == true) {
    require_once 'twitter.class.php';
}
$itemId = mysql_real_escape_string(stripslashes($_POST['ID']));
$numberLeft = 0;
$player = new EconAccount($user, $useMySQLiConomy, $iConTableName);
$auction = new Auction($itemId);
$owner = new EconAccount($auction->owner, $useMySQLiConomy, $iConTableName);
$itemEnchantsArray = $auction->getEnchantmentArray();
if (is_numeric($_POST['Quantity']) && $_POST['Quantity'] > 0) {
    $buyQuantity = mysql_real_escape_string(stripslashes(round(abs($_POST['Quantity']))));
} elseif ($_POST['Quantity'] <= 0) {
    $_SESSION['error'] = $lang['purchaseItem']['insufficient_quantity'];
    header("Location: ../index.php");
    return;
} else {
    $buyQuantity = $auction->quantity;
}
$toDelete = false;
$totalPrice = round($auction->price * $buyQuantity, 2);
$numberLeft = $auction->quantity - $buyQuantity;
if ($numberLeft < 0 && $auction->quantity > 0) {
    $_SESSION['error'] = $lang['purchaseItem']['too_many_quantity'];