Файл: page/online.php
Строк: 32
<?php
$title = 'Онлайн';
require_once($_SERVER["DOCUMENT_ROOT"]."/inc/head.php");
if (isset($active)) {
echo '<div class="title">Онлайн ('.$count_online_user.')</div>';
if ($count_online_user == 0) {
echo '<div class="menu">Онлайн никого нет!</div>';
} else {
$page = new Pagination($count_online_user, 10);
$data = $connect->prepare("select * from `authlog` where `status` = '1' and `lasttime` > :time group by `uid` order by `lasttime` desc limit :start, 10");
$data->bindValue(':time', time() - 300, PDO::PARAM_INT);
$data->bindValue(':start', $page->start, PDO::PARAM_INT);
$data->execute();
$sql = $data->fetchAll();
foreach ($sql as $row) {
echo '<div class="user-forlink">'.profileLink($row['uid']).'<div class="chi">'.date('H:i:s', $row['lasttime']).'</div><span class="online">'.deviceIcon($row['ua']).'</span></div>';
}
$page->navigation();
}
} else {
header('Location: /');
}
require($_SERVER["DOCUMENT_ROOT"]."/inc/foot.php");
?>