<?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.community");

$page['id'] = "topstats";
$page['name'] = "Top Stats";
$page['bodyid'] = "home";
$page['cat'] = "community";

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 ">
<?php
$get_kills = mysql_query("SELECT * FROM users WHERE rank < 6 ORDER BY kills DESC LIMIT 10");
$get_deaths = mysql_query("SELECT * FROM users WHERE rank < 6 ORDER BY deaths DESC LIMIT 10");
//mysql_query("UPDATE users SET corp_id = '0', job_rank = '0', secure_id = '0'");
?>
						<div class="cbb clearfix blue">

							<h2 class="title"><span style="float: left;">Most Kills / Most Deaths</span>
							</h2>
						<div id="notfound-content" class="box-content">
<table width="100%">
<?php
while(($richest = mysql_fetch_array($get_kills)) && ($deaths = mysql_fetch_array($get_deaths))) {
  echo '<tr>
            <td width="20px"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$richest['figure'].'&size=s&direction=2&head_direction=2&gesture=sml&size=m" align="left"></td>
            <td width="150px">'.$richest['name'].'<br />'.$richest['kills'].' Kills</td>
            <td width="20px"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$deaths['figure'].'&size=s&direction=2&head_direction=2&gesture=sml&size=m" align="left"></td>
            <td width="150px">'.$deaths['name'].'<br />'.$deaths['deaths'].' Deaths</td>
            </tr>';
}
?>
</table>
</div>
					</div>
				</div>

<div class="habblet-container ">
<?php
$get_kills = mysql_query("SELECT * FROM users WHERE rank < 6 ORDER BY arrests DESC LIMIT 10");
$get_deaths = mysql_query("SELECT * FROM users WHERE rank < 6 ORDER BY punches DESC LIMIT 10");
?>
						<div class="cbb clearfix blue ">

							<h2 class="title"><span style="float: left;">Most Arrests / Most Punches</span>
							</h2>
						<div id="notfound-content" class="box-content">
<table width="100%">
<?php
while(($richest = mysql_fetch_array($get_kills)) && ($deaths = mysql_fetch_array($get_deaths))) {
  echo '<tr>
            <td width="20px"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$richest['figure'].'&size=s&direction=2&head_direction=2&gesture=sml&size=m" align="left"></td>
            <td width="150px">'.$richest['name'].'<br />'.$richest['arrests'].' Arrests</td>
            <td width="20px"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$deaths['figure'].'&size=s&direction=2&head_direction=2&gesture=sml&size=m" align="left"></td>
            <td width="150px">'.$deaths['name'].'<br />'.$deaths['punches'].' Punches</td>
            </tr>';
}
?>
</table>
</div>
					</div>
				</div>

</div>





<div id="column2" class="column">
<?php
$get_richest = mysql_query("SELECT * FROM users WHERE rank < 6 ORDER BY credits + bank DESC LIMIT 10");
?>

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

							<h2 class="title"><span style="float: left;">Richest Users</span>
							</h2>
						<div id="notfound-looking-for" class="box-content">
<table width="170px">
<?php
while($richest = mysql_fetch_array($get_richest)) {
  $credits = $richest['credits'] + $richest['credits'];
  echo '<tr>
            <td width="20px"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$richest['figure'].'&size=s&direction=2&head_direction=2&gesture=sml&size=m" align="left"></td>
            <td width="150px">'.$richest['name'].'<br />'.$credits.' Credits</td>
            </tr>';
}
?>
</table>
    </div>

</div>
					</div>


<div id="column2" class="column">
<?php
$get_richest = mysql_query("SELECT * FROM users WHERE rank < 6 ORDER BY str DESC LIMIT 10");
?>

				    


					</div>

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





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