<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/

$page['allow_guests'] = true;
require_once('./includes/core.php');
require_once('./includes/session.php');
$lang->addLocale("credits.credits");

$page['id'] = "credits";
$page['name'] = Properties;
$page['bodyid'] = "home";
$page['cat'] = "credits";
require_once('./templates/community_header.php');
?>
<div id="container">
	<div id="content" style="position: relative" class="clearfix">
    <div id="column1" class="column">

				<div class="habblet-container ">
						<div class="cbb clearfix blue ">

							<h2 class="title">Properites
							</h2>

						<script src="<?php echo PATH; ?>/web-gallery/static/js/credits.js" type="text/javascript"></script>
<p class="credits-countries-select">
<?php
$getinfo = mysql_query("SELECT * FROM rooms WHERE sale = '1'");
$getnumrows = mysql_num_rows($getinfo);
if($getnumrows < 1) {
  echo "Sorry, but there's currently no properties on the market.";
}else{
?>
<table cellspacing="3" align="center" width="100%">
<td align="center" width="25%"><strong>Size</strong></td>
<td align="center" width="25%"><strong>Owner</strong></td>
<td align="center" width="25%"><strong>Price</strong></td>
<td align="center" width="25%"><strong>Room ID</strong></td>
<?php
while($r = mysql_fetch_array($getinfo)) {
?>
<tr>
<td align="center"><img src="web-gallery/properties/model_<?php echo $r['model']; ?>.png"></td>
<td align="center"><?php echo $r['owner']; ?></td>
<td align="center"><?php echo $r['price']; ?></td>
<td align="center"><?php echo $r['id']; ?></td>
</tr>
<?php
}
}
?>
</table></p>
<script type="text/javascript">
L10N.put("credits.navi.read_more", "Read more");
L10N.put("credits.navi.close_fulltext", "Close instructions");
PaymentMethodHabblet.init();
</script>


					</div>

				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>


</div>
<div id="column2" class="column">

<?php $lang->addLocale("redeem.voucher"); ?>
				<div class="habblet-container ">
						<div class="cbb clearfix blue ">

							<h2 class="title">My Rooms
							</h2>
						<div id="purse-habblet">

<div class="box-content">
<?php
$getinfo = mysql_query("SELECT * FROM rooms WHERE owner = '$user->name'");
$getnumrows = mysql_num_rows($getinfo);
if($getnumrows < 1) {
  echo "Sorry, but you do not own any rooms.";
}else{
?>
<table cellspacing="3" align="center" width="100%">
<td align="center" width="33%"><strong>Size</strong></td>
<td align="center" width="33%"><strong>Price</strong></td>
<td align="center" width="33%"><strong>Room ID</strong></td>
<?php
while($r = mysql_fetch_array($getinfo)) {
?>
<tr>
<td align="center"><img src="web-gallery/properties/model_<?php echo $r['model']; ?>.png"></td>
<td align="center"><?php echo $r['price']; ?></td>
<td align="center"><?php echo $r['id']; ?></td>
</tr>
<?php
}
}
?>
</table>
</div>
</div>



					</div>
				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>


<script type="text/javascript">
HabboView.run();
</script>
<?php require_once('./templates/community_footer.php'); ?>
