Файл: pages/_users_top.php
Строк: 56
<?PHP
$_OPTIMIZATION["title"] = "ТОП 7";
$user_id = $_SESSION["user_id"];
$db->Query("SELECT * FROM db_users_a, db_users_b WHERE db_users_a.id = db_users_b.id AND db_users_a.id = '$user_id'");
$prof_data = $db->FetchArray();
?>
<div class="s-bk-lf">
<div class="acc-title">TOP 7 по вводам</div>
</div>
<div class="silver-bk"><div class="clr"></div>
<?PHP
$num_p = (isset($_GET["page"]) AND intval($_GET["page"]) < 1000 AND intval($_GET["page"]) >= 1) ? (intval($_GET["page"]) -1) : 0;
$lim = $num_p * 100;
$db->Query("SELECT * FROM db_users_b ORDER BY insert_sum DESC LIMIT 7");
if($db->NumRows() > 0){
?>
<table width="100%" border="0">
<tr bgcolor="#efefef">
<td align="center" width="75">Место</td>
<td align="center">Пользователь</td>
<td align="center">Пополнил</td>
</tr>
<?PHP
$i = 0;
while($data = $db->FetchArray()){
$i=$i+1;
?>
<tr class="htt">
<td align="center"><?=$i; ?></td>
<td align="center"><?=$data["user"]; ?></td>
<td align="center"><?=$data["insert_sum"]; ?></td>
</tr>
<?PHP
}
?>
</table>
<BR />
<?PHP
}
?>
</div>
<div class="clr"></div>
<br />
<?PHP
$user_id = $_SESSION["user_id"];
$db->Query("SELECT * FROM db_users_a, db_users_b WHERE db_users_a.id = db_users_b.id AND db_users_a.id = '$user_id'");
$prof_data = $db->FetchArray();
?>
<div class="s-bk-lf">
<div class="acc-title">TOP 7 по выводам</div>
</div>
<div class="silver-bk"><div class="clr"></div>
<?PHP
$num_p = (isset($_GET["page"]) AND intval($_GET["page"]) < 1000 AND intval($_GET["page"]) >= 1) ? (intval($_GET["page"]) -1) : 0;
$lim = $num_p * 100;
$db->Query("SELECT * FROM db_users_b ORDER BY payment_sum DESC LIMIT 7");
if($db->NumRows() > 0){
?>
<table width="100%" border="0">
<tr bgcolor="#efefef">
<td align="center" width="75">Место</td>
<td align="center">Пользователь</td>
<td align="center">Вывел</td>
</tr>
<?PHP
$i = 0;
while($data = $db->FetchArray()){
$i=$i+1;
?>
<tr class="htt">
<td align="center"><?=$i; ?></td>
<td align="center"><?=$data["user"]; ?></td>
<td align="center"><?=$data["payment_sum"]; ?></td>
</tr>
<?PHP
}
?>
</table>
<BR />
<?PHP
}
?>
</div>
<div class="clr"></div>
<br />
<?PHP
$user_id = $_SESSION["user_id"];
$db->Query("SELECT * FROM db_users_a, db_users_b WHERE db_users_a.id = db_users_b.id AND db_users_a.id = '$user_id'");
$prof_data = $db->FetchArray();
?>
<div class="s-bk-lf">
<div class="acc-title">TOP 7 по рефералам</div>
</div>
<div class="silver-bk"><div class="clr"></div>
<?PHP
$num_p = (isset($_GET["page"]) AND intval($_GET["page"]) < 1000 AND intval($_GET["page"]) >= 1) ? (intval($_GET["page"]) -1) : 0;
$lim = $num_p * 100;
$db->Query("SELECT * FROM db_users_a ORDER BY referals DESC LIMIT 7");
if($db->NumRows() > 0){
?>
<table width="100%" border="0">
<tr bgcolor="#efefef">
<td align="center" width="75">Место</td>
<td align="center">Пользователь</td>
<td align="center">Рефералов</td>
</tr>
<?PHP
$i = 0;
while($data = $db->FetchArray()){
$i=$i+1;
?>
<tr class="htt">
<td align="center"><?=$i; ?></td>
<td align="center"><?=$data["user"]; ?></td>
<td align="center"><?=$data["referals"]; ?></td>
</tr>
<?PHP
}
?>
</table>
<BR />
<?PHP
}
?>
</div>
<div class="clr"></div>