<?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');
$data = new community_sql;
$lang->addLocale("community.news");

$page['id'] = "stockexchange";
$page['name'] = "Stock Exchange";
$page['bodyid'] = "news";
$page['cat'] = "bussiness";

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 green ">


<h2 class="title">Corporations Listings
</h2>
<div id="article-archive">
<table cellspacing="1" align="left" width="50%">
<?php
$myinfo_query = mysql_query("SELECT * FROM users WHERE name = '".$_SESSION['username']."'");
$myinfo = mysql_fetch_array($myinfo_query);
$getinfo = mysql_query("SELECT * FROM jobs_corps WHERE owner = owner + 'user'");
while($r = mysql_fetch_array($getinfo)) {
?>
<tr>
<td align="left"><a href="jobs_info?id=<?php echo $r['id']; ?>"><?php echo $r['corp_name']; ?></a></td>
<?php
}
?>
</table>
</div></div></div></div>

<div id="column2" class="column">
<div class="cbb clearfix green ">

<h2 class="title">Top 30 Corporations
</h2>
<table cellspacing="3" align="center" width="75%">

<?php

$myinfo_query = mysql_query("SELECT * FROM users WHERE name = '".$_SESSION['username']."'");
$myinfo = mysql_fetch_array($myinfo_query);
$getinfo = mysql_query("SELECT * FROM jobs_corps WHERE owner = owner + 'user'");
$myinfo_query = mysql_query("SELECT * FROM users WHERE name = '".$_SESSION['username']."'");
$myinfo = mysql_fetch_array($myinfo_query);
$corp_balance = mysql_query("SELECT * FROM jobs_corps WHERE corp_balance ORDER BY corp_balance DESC LIMIT 30");
while($r= mysql_fetch_array($corp_balance)) {
?>

<tr>
<td align="center"><img src='./images/badges/<?php echo $r['badge'].".gif"; ?>'</td>
<td align="center"><a href="jobs_info?id=<?php echo $r['id']; ?>"><?php echo $r['corp_name']; ?></a><br /> Balance: <?php echo $r['corp_balance']; ?><br />stock value: ----<br /></td>
<td align="center"><a class="new-button fill" onclick="habboclub.buttonClick(3,'" href="#"><b>Buy Stocks</b><i></i></a></td>

<?php
}
?>
</table></p>
</div>

<?php require_once('./templates/community_footer.php'); ?> 
