<?php

		  if ($accounttype != '1'){
$bazaar = getBazaarItem($item['itemid']);
if($bazaar == 'empty'){
}
else{
	echo '<table class="table table-hover">
	<tr class="table-success"><th colspan=4><b><center>Bazaar Information</center></b></th></tr></table>';
	echo '<table class="table table-hover" id="myTable2">
	<tr class="table-warning"><th onclick="sortTable(0)">Character</th><th onclick="sortTable(1)">Gil</th><th onclick="sortTable(2)">Quantity</th><th onclick="sortTable(3)">Last Online</th></tr>';
	foreach ($bazaar as $baz) {
		$accid=getCharacterAccid($baz['charid']);
		$gm=getCharacter($baz['charid']);
		$gm=$gm[0];
		if(($gm['gmlevel'])>0){
			$online="gm";
		}
		elseif(isCharOnline($baz['charid'])==true){
			$online="online";
		}
		else{
			$online="offline";
		}
		if(getLastOnline($baz['charid'])[0]!='e'){
			echo '
			<tr><td><a href="?p=characters&id='.$baz['charid'].'">'.ucwords(str_replace('_',' ',$baz['charname'])).'</a></td><td>'.$baz['bazaar'].'</td><td>'.$baz['quantity'].'</td><td>'.getLastOnline($baz['charid'])[0].'<img src="theme/'.$theme.'/images/'.$online.'.PNG" height="25" width="25" alt="'.$online.'" title="'.$online.'"></td></tr>';
		}
	}
	echo '</table>';
}
		  }
?>
