Размер файла: 1.91Kb
<?php
require_once "../system/connect.php";
require_once "../system/config.php";
require_once "../system/functions.php";
require_once "../system/dannuser.php";
require_once "../system/start.php";
echo '<title>Онлайн</title>';
if(empty($_GET['act'])) { $_GET['act']="index"; }
switch($_GET['act']) {
case("index"): $totalonline=mysql_query("SELECT COUNT(*) FROM `online`;");
$countonline=mysql_result($totalonline,0);
if(empty($_GET['start'])) { $start=0; } else { $start=$_GET['start']; }
$q=mysql_query("SELECT * FROM `online` ORDER BY `id` DESC LIMIT $start,$num;");
while($onl=mysql_fetch_array($q)) {
if($onl['login']=='guest') continue;
echo '<a href="../pages/anketa.php?id='.$onl['login'].'">'.$onl['login'].'</a><br>';
echo "$onl[agent], $onl[ip]<br><br>"; }
if($start!=0) { echo '<a href="online.php?start='.($start-$num).'">назад</a>'; } else { echo 'назад'; }
echo ' | ';
if($countonline>$start+$num) { echo '<a href="online.php?start='.($start+$num).'">далее</a>'; } else { echo 'далее'; }
echo '<br><a href="online.php?act=guest">показать гостей</a><br>';
break;
case("guest"):
$totalonline=mysql_query("SELECT COUNT(*) FROM `online`;");
$countonline=mysql_result($totalonline,0);
if(empty($_GET['start'])) { $start=0; } else { $start=$_GET['start']; }
$q=mysql_query("SELECT * FROM `online` ORDER BY `id` DESC LIMIT $start,$num;");
while($onl=mysql_fetch_array($q)) {
if($onl['login']!='guest') continue;
echo ''.$onl['login'].'<br>';
echo "$onl[agent], $onl[ip]<br><br>"; }
if($start!=0) { echo '<a href="online.php?start='.($start-$num).'">назад</a>'; } else { echo 'назад'; }
echo ' | ';
if($countonline>$start+$num) { echo '<a href="online.php?start='.($start+$num).'">далее</a>'; } else { echo 'далее'; }
echo '<br><a href="online.php">зарегистрироапнные юзеры</a><br>';
break; }
require_once "../foot.php";
?>