<title>Race Arena - <?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">Race Arena</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">
<h2>Race Arena</h2>
<table class="table table-hover">
<tr class="alert-info table-bordered">
			<td>#</td>
			<td>Name</td>
			<td>Vehicle</td>
			<td>RaceExp</td>
			<td>Race Points</td>
		</tr>
		</thead>
		<tbody>
			<?php
				$q = Config::$g_con->prepare('SELECT * FROM `users` ORDER BY `RaceExp` DESC LIMIT 50');
				$q->execute();
				$counter = 1; 
				while($row = $q->fetch(PDO::FETCH_OBJ)) {
					if($row->Status == 0) {
						$status = 'red';
					} if($row->Status == 1) {
						$status = 'green';
					} if($row->Status == 2) {
						$status = 'orange';
					}
					echo 
					"<tr>
						<td>". $counter ."</td>
						<td><i class='icon-circle light-". $status ." middle'></i> &nbsp; <a href='".Config::$_PAGE_URL.'profile/'.$row->id."'><font color='#0088CC'>{$row->name}</font></a></td>"; ?>
						<td>
						<?php if(Config::getID('users','RaceVeh',$row->name) == 415) { ?><span class="label label-red arrowed-in-right"><i class="fa fa-gamepad blue"></i> Cheetah </span><br/><?php } ?>
						<?php if(Config::getID('users','RaceVeh',$row->name) == 560) { ?><span class="label label-red arrowed-in-right"><i class="fa fa-gamepad blue"></i> Sultan </span><br/><?php } ?>
                        <?php if(Config::getID('users','RaceVeh',$row->name) == 451) { ?><span class="label label-red arrowed-in-right"><i class="fa fa-gamepad blue"></i> Turismo </span><br/><?php } ?>
                        <?php if(Config::getID('users','RaceVeh',$row->name) == 541) { ?><span class="label label-red arrowed-in-right"><i class="fa fa-gamepad blue"></i> Bullet </span><br/><?php } ?>
                        <?php if(Config::getID('users','RaceVeh',$row->name) == 411) { ?><span class="label label-red arrowed-in-right"><i class="fa fa-gamepad blue"></i> Infernus </span><br/><?php } ?>
						</td>
					<?php echo"<td>{$row->RaceExp}</td>
						<td>{$row->RacePoints}</td>
					</tr>";
				$counter++;
				}
			?>
		</tbody>
	</table>
</div>
