Файл: html/online.php
Строк: 242
<?php
require_once ('system/func.php');
$footval = "online";
require_once ('system/foot/foot.php');
auth(); // Закроем от неавторизированых
requestModer(); // Закроем для тех у кого есть запрос на модератора
?>
<html>
<head>
<title>Mobitva v1.0</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" >
<meta name="theme-color" content="#C8AC70">
<meta name="author" content="Kalashnikov"/>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<font style="font-size:16px">
<a onclick=showContent('online.php');>
<ins style='margin-left:7px;margin-right:7px;'>
<?php if (empty($_GET['listLevel'])) { echo "<STRONG>все </STRONG>";}else{ echo "все ";}?>
</ins>
</a>
<a onclick=showContent('online.php?listLevel=1');>
<ins style='margin-left:7px;margin-right:7px;'>
<?php if (isset($_GET['listLevel']) && $_GET['listLevel'] == "1") { echo "<STRONG>1_5</STRONG>";}else{ echo "1_5";}?>
</ins>
</a>
<a onclick=showContent('online.php?listLevel=2');>
<ins style='margin-left:7px;margin-right:7px;'>
<?php if (isset($_GET['listLevel']) && $_GET['listLevel'] == "2") { echo "<STRONG>6_10</STRONG>";}else{ echo "6_10";}?>
</ins>
</a>
<a onclick=showContent('online.php?listLevel=3');>
<ins style='margin-left:7px;margin-right:7px;'>
<?php if (isset($_GET['listLevel']) && $_GET['listLevel'] == "3") { echo "<STRONG>10_15</STRONG>";}else{ echo "10_15";}?>
</ins>
</a>
<a onclick=showContent('online.php?listLevel=4');>
<ins style='margin-left:7px;margin-right:7px;'>
<?php if (isset($_GET['listLevel']) && $_GET['listLevel'] == "4") { echo "<STRONG>16_20</STRONG>";}else{ echo "16_20";}?>
</ins>
</a>
</font>
<table class="table_block2">
<tr>
<td class="block101" style="width: 2%"></td>
<td class="block102" style="width: 96%"></td>
<td class="block103" style="width: 2%"></td>
</tr>
<tr>
<td class="block104"></td>
<td class="block105">
<br>
<?php
$onlineid = 0;
$date = time();
$onlineLevel = "";
if(isset($_GET['listLevel']))
{
if($_GET['listLevel'] == "1") $onlineLevel = "AND `level` >= 1 AND `level` <= 5";
if($_GET['listLevel'] == "2") $onlineLevel = "AND `level` >= 6 AND `level` <= 10";
if($_GET['listLevel'] == "3") $onlineLevel = "AND `level` >= 10 AND `level` <= 15";
if($_GET['listLevel'] == "4") $onlineLevel = "AND `level` >= 16";
}
$online1 = $mc->query("SELECT * FROM `users` WHERE `online`>($date-60) $onlineLevel ORDER BY `level` DESC LIMIT 200");
while ($online = $online1->fetch_array(MYSQLI_ASSOC)) {
if ($online['side'] == 2 || $online['side'] == 3) {
$icon = "<img height=15 src=/img/icon/icogood.png width=15>";
} else {
$icon = "<img height=15 src=/img/icon/icoevil.png width=15>";
}
$onlineid++;
echo $onlineid . ' ' . $icon . ' ' . '<a onclick="showContent('/profile/' . $online['id'] . '')"><font >' . $online['name'] . '</font></a>' . '<span style="float: right;">' . $online['level'] . '</span>' . '<br><hr class="hr_01"/>';
}
?>
</td>
<td class="block106"></td>
</tr>
<tr>
<td class="block107"></td>
<td class="block108"></td>
<td class="block109"></td>
</tr>
</table> <br>
<p>Последний онлайн</p>
<table class="table_block2">
<tr>
<td class="block101" style="width: 2%"></td>
<td class="block102" style="width: 96%"></td>
<td class="block103" style="width: 2%"></td>
</tr>
<tr>
<td class="block104"></td>
<td class="block105">
<br>
<?php
if (isset($_GET['list'])) {
$str = $_GET['list'] - 1;
$limf = $str * 10;
} else {
$str = 0;
$limf = 0;
}
$date = time();
$online = $mc->query("SELECT * FROM `users` WHERE `online`<($date-60) AND `online`>0 ORDER BY `online` DESC LIMIT ".$limf.",10")->fetch_all(MYSQLI_ASSOC);
$maxstr = ceil($mc->query("SELECT * FROM `users` WHERE `online`<($date-60) AND `online`>0 ORDER BY `online` DESC ")->num_rows / 10);
for ($i = 0; $i<count($online); $i++) {
$icon = $online[$i]['side'] == 2 || $online[$i]['side'] == 3 ? "<img height=15 src=/img/icon/icogood.png width=15>" : "<img height=15 src=/img/icon/icoevil.png width=15>";
$date1 = date("H", $online[$i]['online']) . ':' . date("i", $online[$i]['online']) . ':' . date("s", $online[$i]['online']);
?>
<table style="width: 100%">
<tr>
<td style="width: 30px;text-align: center;"><?= $i+1+($str*10); ?></td>
<td style="width: 30px;text-align: center;"><?= $icon; ?></td>
<td style="max-width: 100%;text-align: left;">
<a onclick="showContent('/profile/<?= $online[$i]['id']; ?>')">
<font dir="ltr">
<?= $online[$i]['name']; ?>
</font>
[<?= $online[$i]['level']; ?>]
</a>
</td>
<td style="width: 90px;text-align: center;">
<?= $date1; ?>
</td>
</tr>
</table>
<table style="width: 100%">
<tr>
<td style="width: 100%;text-align: center;">
<hr class="hr_01">
</td>
</tr>
</table>
<?php } ?>
</td>
<td class="block106"></td>
</tr>
<tr>
<td class="block107"></td>
<td class="block108"></td>
<td class="block109"></td>
</tr>
</table>
<center><?= pagination("online.php", $str + 1, $maxstr); ?></center>
</body>
</html>
<?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;
}
?>