<title>Houses - <?php echo Config::$_SITE_NAME; ?></title>
<?php
if(!defined('panel'))
	die('Nope.');
?>
</div>
	<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<script type="text/javascript">
					try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
				</script>

				<ul class="breadcrumb">
					<li>
						<i class="ace-icon fa fa-home home-icon"></i>
						<a href="<?php echo Config::$_PAGE_URL; ?>">Home</a>
					</li>
					<li class="active">Houses</li>
				</ul><!-- /.breadcrumb -->

				<div class="nav-search" id="nav-search">
					<form method="POST" action="search">
						<span class="input-icon">
							<input type="text" placeholder="Search ..." name="sname" id="username" type="submit" class="nav-search-input" autocomplete="on"> 
							<i class="ace-icon fa fa-search nav-search-icon"></i>
						</span>
					</form>
				</div> <!-- /.nav-search -->
			</div>	
			
<div class="page-content">
<div class="row-fluid"><div class="span12">	
<div class="table-responsive">
	<table class="table table-bordered table-condensed">
		<thead>
		<tr>
			<td>ID</td>
			<td>Owner</td>
			<td>Price</td>
			<td>Map</td>
		</tr>
		</thead>
		<tbody>
			<?php
				$q = Config::$g_con->prepare('SELECT * FROM `houses` '.Pagination::limit());
				$q->execute();
				while($row = $q->fetch(PDO::FETCH_OBJ)) { ?>
					<tr>
						<td><?php echo $row->ID ?></td>
						<?php if($row->Owned==0) { ?><td>The State</td><?php }?>
						<?php if($row->Owned==1) { ?><td><a href="<?php echo Config::$_PAGE_URL; ?>profile/<?php echo Config::getID('users', 'id', $row->Owner) ?>"><?php echo $row->Owner ?></a></td><?php }?>
						<?php if($row->Owned==0) { ?><td>$<?php echo number_format($row->Value,0,'.','.') ?></td><?php }?>
						<?php if($row->Owned==1) { ?><td>not for sale</td><?php }?>
						<td><a href='<?php echo Config::$_PAGE_URL; ?>map?x=<?php echo $row->Entrancex ?>&y=<?php echo $row->Entrancey ?>' target='_blank'><i class='icon-map-marker'></i> Display on map</a></td>
					</tr>
				<?php } ?>				
		</tbody>
	</table>
<div class="table-responsive">
<?php
echo Pagination::create(Config::rows('houses'));
?>
<link href="<?php echo Config::$_PAGE_URL; ?>assets/css/sort.min.css" media="all" type="text/css" rel="stylesheet">
<script src="<?php echo Config::$_PAGE_URL; ?>assets/js/jquery.tablesorter.min.js" async></script>
