Фиксим список паладинов.

This commit is contained in:
lopar 2018-02-15 23:02:00 +02:00
parent 667fd98d4e
commit bdbbaf0245

View File

@ -1,22 +1,25 @@
<?php <?php
if ($_SESSION['uid'] == null) header("Location: index.php"); session_start();
session_start(); if (!isset($_SESSION['uid'])) header("Location: index.php");
include_once "config.php";
function showpals(){ include_once "config.php";
function showpals()
{
$timer = time() - 60; $timer = time() - 60;
$data = db::c()->query('SELECT `login`,`status`,`align`,`room`,(select `id` from `online` WHERE `date` >= ?i AND `id` = users.`id`) AS `online` FROM `users` WHERE `align` = 1 ORDER BY `login` ASC', $timer)->fetch_assoc(); $data = db::c()->query('SELECT `login`,`status`,`align`,`room`,(SELECT `id` FROM `online` WHERE `date` >= ?i AND `id` = users.`id`) AS `online` FROM `users` WHERE `align` = 1 ORDER BY `login` ASC', $timer)->fetch_assoc();
while ($data) { while ($data) {
if (!empty($data['online'])) { if (!empty($data['online'])) {
echo '<A HREF="javascript:top.AddToPrivate(\'',$data['login'],'\', top.CtrlPress)" target=refreshed><img src="i/lock.gif" width=20 height=15></A>'; echo '<A HREF="javascript:top.AddToPrivate(\'', $data['login'], '\', top.CtrlPress)" target=refreshed><img src="i/lock.gif" width=20 height=15></A>';
echo $data['align'].$data['login']."".$data['status']." — <em>".$data['room']."</em><br>"; echo $data['align'] . $data['login'] . "" . $data['status'] . " — <em>" . $data['room'] . "</em><br>";
} else { } else {
echo '<img src="i/lock1.gif" width=20 height=15>'; echo '<img src="i/lock1.gif" width=20 height=15>';
echo $data['align'].$data['login']."".$data['status']." — <small><em>персонаж не в клубе</em></small><br>"; echo $data['align'] . $data['login'] . "" . $data['status'] . " — <small><em>персонаж не в клубе</em></small><br>";
} }
} }
} }
?>
?>
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
@ -24,10 +27,12 @@
<meta charset="utf-8"> <meta charset="utf-8">
</head> </head>
<body> <body>
<div style="text-align: right; width: 95%;"><button onclick="location.href='main.php';">Вернуться</button></div> <div style="text-align: right; width: 95%;">
<div style="width: 600px; margin: 0 auto;"> <button onclick="location.href='main.php';">Вернуться</button>
</div>
<div style="width: 600px; margin: 0 auto;">
<h3><A HREF="javascript:top.AddToPrivate('pal', top.CtrlPress)" target=refreshed><img src="i/lock.gif" width=20 height=15></A> Паладины</h3> <h3><A HREF="javascript:top.AddToPrivate('pal', top.CtrlPress)" target=refreshed><img src="i/lock.gif" width=20 height=15></A> Паладины</h3>
<?php showpals()?> <?php showpals() ?>
</div> </div>
</body> </body>
</html> </html>