<?
//
//
require_once($_SERVER['DOCUMENT_ROOT']."/jquery/inc/system.php"); 
//
//
if(!$user){
header('location:/login/');
exit();
}
//
//
head([]);
//
//
                $coll = DB::$dbs->querySingle('SELECT COUNT(id) FROM `users` WHERE `time` > "'.(time()-7200).'"');
		$num = 10;
		$total = intval(($coll - 1) / $num) + 1;
		$page = isset($_GET['page'])?intval($_GET['page']):1;
		if(empty($page) or $page < 0) $page = 1;
		if($page > $total) $page = $total;
		$start = $page * $num - $num; 

$sql = DB::$dbs->query("SELECT `id`,`gender`,`name`,`time`,`status` FROM `users` WHERE `time` > '".(time()-7200)."' ORDER BY `level` DESC LIMIT $start, $num")->fetchAll(PDO::FETCH_BOTH);
		?>
<div class="poster -gas">
		    <div class="start">
		        <center>
		            <span class="title-wqi">Онлайн игроки (<?=$coll;?>)</span>
		        </center>

		<?
			foreach ($sql as $sqlls => $im): ?>
<?
if(mb_strlen($im['status'], 'UTF-8') <= 1)$status = 'Играю в свое удовольствие'; else $status = $im['status'];
?>

<div class="menu-not2">
<div class="imgL">
<img src="/css/img/min_gender_<?=$im['gender'];?>.png" class="imgFight2" width="40" height="40">
</div>
<font color="#999999">
<?=user_info($im['id']);?>
</font>
<br>

<font color="#777777">
<?=$status;?>
</font>
</div>


			<?php endforeach;
			?>
			</div>
			<?
			echo page('?',$page,$total); ?>
						    <div class="start">	<a href="/rating/"><div class="menu-not2">Рейтинг сильнейших</div></a></div>
			</div>
<?
//
//
foot([]);
//
//
?>