Файл: html/huntb/tur/slava.php
Строк: 87
<?php
require_once '../../system/func.php';
if (isset($_GET['list'])) {
$page = $_GET['list'] - 1;
} else {
$page = 0;
}
if (isset($user['level']) && $user['level'] < 2) {
?>
<script>showContent("/main.php?msg=" + decodeURI("Не доступно до 2 уровня ."));</script>
<?php
}
$page_num = $mc->query("SELECT * FROM `users` WHERE `tur_reit`>'0'")->num_rows;
$arrall = $mc->query("SELECT * FROM `users` WHERE `tur_reit`>'0' ORDER BY `tur_reit` DESC LIMIT " . ($page*10) . ",10")->fetch_all(MYSQLI_ASSOC);
?>
<div>
<center>
<div>
<b>-Стена славы-</b>
</div>
</center>
<table class="table_block2">
<tr>
<td class="block01" style="width: 2%"></td>
<td class="block02" style="width: 96%"></td>
<td class="block03" style="width: 2%"></td>
</tr>
<tr>
<td class="block04" style="width: 2%"></td>
<td class="block05" style="width: 96%">
<?php for ($i = $page * 10, $i2=0; $i < ($page * 10) + count($arrall); $i++, $i2++) { ?>
<table style="width: 100%">
<tr>
<td style="width: 40px;text-align: center;"><?= $i + 1; ?></td>
<td style="width: 24px;text-align: center;">
<?= $arrall[$i2]['side'] == 0 || $arrall[$i2]['side'] == 1 ? '<img height="15" src="/img/icon/icoevil.png" width="15" alt="">' : '<img height="15" src="/img/icon/icogood.png" width="15" alt="">'; ?>
</td>
<td style="max-width: 100%">
<?= $arrall[$i2]['id'] == $user['id'] ? '<b>'.$arrall[$i2]['name'].'</b>':$arrall[$i2]['name']; ?>
</td>
<td style="width: 50px;text-align: center;"><?= $arrall[$i2]['tur_reit']; ?></td>
</tr>
</table>
<?php } ?>
</td>
<td class="block06" style="width: 2%"></td>
</tr>
<tr>
<td class="block07" style="width: 2%"></td>
<td class="block08" style="width: 96%"></td>
<td class="block09" style="width: 2%"></td>
</tr>
</table>
<center>
Страницы:<?= pagination("huntb/tur/slava.php?", $page+1, ceil($page_num / 10)); ?>
</center>
</div>
<?php
//pagination(ссылка "index.php/*?", $strlist номер страницы:>0, максимум страниц:>0)
function pagination($href, $strlist, $maxstr) {
$strend = 0;
$output = "";
if ($strlist > 4) {
$output .= "<a onclick=showContent('/" . $href . "&list=1');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>1</u></a> .. ";
} elseif ($strlist == 4) {
$output .= "<a onclick=showContent('/" . $href . "&list=1');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>1</u></a>";
}
for ($i = -2; $i <= 3; $i++) {
$strnm = $i + $strlist;
if ($strnm + 1 == $maxstr) {
$strend = 1;
}
if ($strnm > 0) {
if ($i == 0) {
$output .= "<a onclick=showContent('/" . $href . "&list=" . $strlist . "');><u style='margin-left:7px;margin-right:7px;font-size: 14px;text-decoration:none;'>" . $strlist . "</u></a>";
} elseif ($i == 3) {
if ($strlist < $maxstr) {
if ($strend == 0) {
$output .= ".. <a onclick=showContent('/" . $href . "&list=" . $maxstr . "');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>" . $maxstr . "</u></a>";
} else {
$output .= "<a onclick=showContent('/" . $href . "&list=" . $maxstr . "');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>" . $maxstr . "</u></a>";
}
}
} else {
if ($strnm < $maxstr) {
$output .= "<a onclick=showContent('/" . $href . "&list=" . $strnm . "');><u style='margin-left:7px;margin-right:7px;font-size: 18px;'>" . $strnm . "</u></a>";
}
}
}
}
return $output;
}
$footval = "slava_huntb";
require_once ('../../system/foot/foot.php');
?>