<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
$cache = new Cache('engine/cache/ingmarket');
if ($cache->hasExpired()) {
$inGameAuctions = mysql_select_multi('SELECT
auction_system
.
player
,
auction_system
.
id
,
auction_system
.
item_name
,
auction_system
.
item_id
,
auction_system
.
count
,
auction_system
.
cost
,
auction_system
.
date
,
players
.
name
FROM
auction_system
,
players
WHERE
players
.
id
=
auction_system
.
player
ORDER BY
auction_system
.
id
DESC');
$cache->setContent($inGameAuctions);
$cache->save();
} else {
$inGameAuctions = $cache->load();
}
$players = 0;
if (isset($_POST)) {
if (isset($_POST['player']) && ! empty($_POST['player'])) {
$name = getValue($_POST['player']);
$player_id = user_character_exist($name);
$inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
return $player_id == $auction['player'];
});
}
if (isset($_POST['item']) && ! empty($_POST['item'])) {
$item = getValue($_POST['item']);
$inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
return strtolower($item) == strtolower($auction['item_name']);
});
}
}
?>
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr>
<th>
<b>Instruction<b>
</th>
</tr>
<tr>
<td align="center">
<h2>Commands</h2><b>!offer add, itemName, itemPrice, itemCount</b><br/>
<small>example: !offer add, plate armor, 500, 1</small><br/><br/>
<b>!offer buy, AuctionID</b><br/><small>example: !offer buy, 1943</small><br /><br/>
<b>!offer remove, AuctionID</b><br/><small>example: !offer remove, 1943</small><br /><br/>
<b>!offer withdraw</b><br/><small>Use this command to get money for sold items.</small>
</td>
</tr>
</table><br/>
<form action="" method="POST">
<input type="text" name="player" placeholder="Player..">
<input type="text" name="item" placeholder="Item..">
<input type="submit" value="Search">
</form>
<table width="100%" class="table table-striped table-bordered table-condensed">
<tr>
<th align="center">
AuctionID
</td>
<th class="white">
Image
</td>
<th class="white">
Item Name
</td>
<th class="white">
Player
</td>
<th class="white">
Count
</td>
<th class="white">
Price
</td>
<th class="white">
Buy Command
</td>
</tr>
<?php
if ($inGameAuctions) {
foreach($inGameAuctions as $auction) {
$players++;
if(is_int($players / 2)) {
$bgcolor = "black";
} else {
$bgcolor = "grey";
}
$cost = round($auction['cost']/1000, 2);
?>
<tr>
<td>
<?php echo $auction['id']; ?>
</td>
<td>
<img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
</td>
<td>
<?php echo $auction['item_name']; ?>
</td>
<td>
<a href='characterprofile?name=<?php echo $auction['name']; ?>'>
<?php echo $auction['name']; ?>
</a>
</td>
<td>
<?php echo $auction['count']; ?>
</td>
<td>
<?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
</td>
<td>
!offer buy, <?php echo $auction['id']; ?>
</td>
</tr>
<?php
}
} else {
echo '<tr><td colspan="7">Currently no auctions exists..</td></tr>';
}
echo '</table>';
echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="
vDk (https://otland.net/members/vdk.1553/)">vDk</a>. | Converted to ZnoteAAC and edited by <a href="
HalfAway (https://otland.net/members/halfaway.142275/)">HalfAway</a>.</span></p>';
include 'layout/overall/footer.php'; ?>