<?php

		  if ($accounttype == '0'){
echo ' 
<table class="table table-hover">
<tr class=table-success><td colspan=5><strong>Auction House History</strong></td></tr>
<tr class="table-primary"><td>Item</td><td>Seller</td><td>Buyer</td><td>Price</td><td>Date</td></tr>
';
$AH = getAHPlayer($char['charid'],$char['charname']);
if($AH=='empty')
{
	echo '<tr><td colspan=5>No Auction House History </td></tr>';
}
else
{
	foreach ($AH as $house)
	{
		$date=date('Y/m/d', $house['sell_date']);
		$chared = getCharacterName($house['seller']);		
		$chars = getCharacterByName($house['buyer_name']);
		$item = getItems($house['itemid']);
		if($house['stack']==1)
		{
			$q=$item['stackSize'];
		}
		else
		{
			$q=1;
		}
		if($char == 'empty' or $chars== 'empty' or $item== 'empty')
		{
		}
		else
		{	
			echo '<tr><td><a href="?p=items&id='.$house['itemid'].'"><img src=http://static.ffxiah.com/images/icon/'.$house['itemid'].'.png alt='.ucwords(str_replace('_',' ',$item['sortname'])).' height=32 width=32> '.ucwords(str_replace('_',' ',$item['sortname'])).'</a></td><td><a href="?p=characters&id='.$house['seller'].'">'.ucwords(str_replace('_',' ',$chared)).'</a></td><td><a href="?p=characters&id='.$chars['charid'].'">'.ucwords(str_replace('_',' ',$house['buyer_name'])).'</a></td><td>'.$house['sale'].'</td><td>'.$date.'</td></tr>';
		}
	}
}
echo'</table>';
		  }

?>