<? require 'header.php';?>
<div class="menucenter">
<center>
<div class="menuheadbbb" style='width:300px;'><a href="#" onclick="history.back();return false;">Вернуться назад</a></div>
</center>
<center>
<?
require_once("karera/setup_status.php");
for($i=1;$i<=6;$i++){?>
      <p>
      <table class='reyt' width='80%' border='0' cellpadding='0' cellspacing='0'>
      <thead>
      <tr>
      <th colspan="3" align="center"><b>TOP20 <?=$st_users[$i]["name"]?></b></th>
      </tr></thead>

      <tr style="background: #ccc;">
      <td align="center" style="width:30px;"><b>№</b></td>
      <td align="center"><b>Логин</b></td>
      <td align="center"><b>Баллов</b></td>
      </tr>
<?$res = mysql_query("SELECT `username`,`ball` FROM `tb_users` WHERE `ball_status` = '$i' ORDER BY `ball` DESC LIMIT 20");
if(mysql_num_rows($res) > 0){
$b = 1;
while ($row = mysql_fetch_assoc($res))
{?>
      <tr>
      <td align="center"><b><?=$b++;?></b></td>
      <td align="center"><?=$row["username"]?></td>
      <td align="center"><font color='red'><?=$row["ball"]?></font></td>
      </tr>
<?}
}else{?>
<tr>
<td colspan="4" align="center"><b style="color:red;">Нет пользователей с данным статусом</b></td>
</tr>
<?}?>
</table></p>
<?}?>
</center>
<? require 'footer.php';?>