<?
//
//
require_once($_SERVER['DOCUMENT_ROOT']."/jquery/inc/system.php"); 
//
//
if(!$user){
header('location:/login/');
exit();
}
//
//
if($user['adm'] != 2){
header('location:/index/');
exit();
}
//
//
head([]);
//
//
                $coll = DB::$dbs->querySingle('SELECT COUNT(id) FROM `users` WHERE `gender` != "0"');
		$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`,`gold` FROM `users` WHERE `gender` != '0' ORDER BY `gold` DESC LIMIT $start, $num")->fetchAll(PDO::FETCH_BOTH);
		?>
<div class="poster -gas">
		    <div class="start">
		        <center>
		            <span class="title-wqi">Рейтинг богатых</span>
		        </center>

		<?
			foreach ($sql as $sqlls => $im): ?>

<div class="menu-us">
<font color="#999999">
<?=user_info($im['id']);?>
<span style="float: right;"><img src="/css/img/gold.png"> <?=$im['gold'];?></span>
</font>
</div>


			<?php endforeach;
			?>
			</div>
			<?
			echo page('?',$page,$total); ?>
			</div>
<?
//
//
foot([]);
//
//
?>