<?
include 'config.php';
include 'func.php';
head();
aut();
ban();
####################Запись онлайна##################
mysql_query("UPDATE `profile` SET `online` = 'online' WHERE `id` = '".$id_session."'");
####################################################
$online = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `time` > '".(time()-600)."' AND `invis` = 0"), 0);
$guest = mysql_result(mysql_query("SELECT count(*) FROM `guest_online` WHERE `time` > '".time()."'"), 0);


echo head . "><b>Онлайн</b>" . div;   

echo '<div class="link1">Наших: <b>'.$online.'</b> ';
echo 'Гостей: <b>'.$guest.'</b><br/>';

switch ( $_GET['mod'] ) {

default:
echo '<b>Наши</b> | <a href="online.php?mod=guest">Гости</a></div>';
$result = mysql_query("SELECT * FROM `profile` WHERE `time` > '".(time()-600)."'  AND `invis` = 0 ORDER BY `time` DESC");
while($user = mysql_fetch_assoc($result)){

if($user['upload_ava']){
    $ava = '<div class="link2"><img src="resize.php?img=upload_ava/'.$user['upload_ava'].'&width='.$ava_w.'&height" alt=""/>';
} else {
    $ava = '<div class="link2"><img src="resize.php?img=noava.png&width='.$ava_w.'&height" alt=""/>';
}
echo $ava . '<br/>';
    if ( $user['sex'] == 0 )
    echo '<b>Девушка:</b></a>' . colorl($user['id']).' <a href="'.$user['id'].'">[Анкета]</a><br/>'; 
    else
    echo '<b>Парень:</b></a>' . colorl($user['id']).' <a href="'.$user['id'].'">[Анкета]</a><br/>'; 
    
    echo 'Зовут: '.$user['name'].'<br/ >';
    echo 'Где: '.online($user['online']).'<br/ >';
    echo '</b></div>';

}

break;


case 'guest':
echo '<b>Гости</b> | <a href="online.php?">Наши</a></div>';
$result = mysql_query("SELECT * FROM `guest_online`  ORDER BY `time`");
while($user = mysql_fetch_assoc($result)){
    $i++;
    echo  link2 . $i . ' Браузер: '.$user['ua'].'<br/>IP: '.$user['ip'].'<br/>Переходов: '.$user['perexody'].'<br/>Пришел с сайта: '.$user['url'].'</div>';
    

}


break;






}

navig();
foot();
?>