<?php
/*
Copyright (C) 2007 - 2009 Nicaw
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
include ("include.inc.php");
$ptitle="$cfg[server_name] - Houses";
include ("header.inc.php");
if (!is_file($cfg['dirdata'].$cfg['house_file']))
throw new aacException('House file not found: '.$cfg['dirdata'].$cfg['house_file']);
?>
<div id="content">
<div class="top">Houses</div>
<div class="left">
<div class="right">
<div class="downright">
</div>
<div class="mid">
<td width="100%"><img src="skins/conquest/line_body.gif" align="left" border="0" height="7" hspace="0" vspace="0" width="100%"></td></table>
<img src="skins/conquest/title_houses.gif" style="vertical-align: middle;" />          Here you can see the list of all available houses, flats or guildhall.
<td width="100%"><img src="skins/conquest/line_body.gif" align="left" border="0" height="7" hspace="0" vspace="0" width="100%"></td>
<br>
<br>
<td><img src="layouts/t2/files/blank.gif" border="0" height="1" width="10"></td>
<div style="height: 500px; overflow: auto; margin: 10px;">
<table>
<tr class="color0"><td width="45%"><b>House</b></td><td width="25%"><b>Location</b></td><td width="25%"><b>Owner</b></td><td><b>Size</b></td><td><b>Price</b></td></tr>
<?php
$HousesXML = simplexml_load_file($cfg['dirdata'].$cfg['house_file']);
$MySQL = AAC::$SQL;
$MySQL->myQuery('SELECT `players`.`name`, `houses`.`id` FROM `players`, `houses` WHERE `houses`.`owner` = `players`.`id`;');
while ($row = $MySQL->fetch_array()){
$houses[(int)$row['id']] = $row['name'];
}
foreach ($HousesXML->house as $house){
$i++;
$list.= '<tr '.getStyle($i).'><td>'.htmlspecialchars($house['name']).'</td><td>'.htmlspecialchars($cfg['temple'][(int)$house['townid']]['name']).'</td><td>'.$houses[(int)$house['houseid']].'</td><td>'.$house['size'].'</td><td>'. $house['size'] * 235 .'</td></tr>'."\r\n";
}
echo $list;
?>
</table>
</div>
<br><br>
<td width="100%"><img src="skins/conquest/line_body.gif" align="left" border="0" height="7" hspace="0" vspace="0" width="100%"></td>
<p align="center"> Copyright by Illuminate real map. All rights reserved. </center>
</div>
<div class="bot"></div>
</div>
</div>
<?php include ("footer.inc.php");?>