<?
include 'config.php';
include 'func.php';
head();
aut();
ban();
####################Запись онлайна##################
mysql_query("UPDATE `profile` SET `online` = 'online' WHERE `id` = '".$id_session."'");
####################################################
echo head . "Сейчас онлайн" . div; 


if ( $_GET['mod'] == 1 ) {
    
    $online = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `time` > '".(time()-600)."' AND `sex` = 0  AND `invis` = 0"), 0);
    
    echo '<div class="link1"><b>Девушек в онлайне: '.$online.'</b></div>';
    
    $result = mysql_query("SELECT * FROM `profile` WHERE `time` > '".(time()-600)."' AND `sex` = 0 AND `invis` = 0  ORDER BY `time` DESC  ");
    while($user = mysql_fetch_assoc($result)){
    
    if($user['upload_ava']){
        $ava = '<img src="resize.php?img=upload_ava/'.$user['upload_ava'].'&width='.$ava_w.'&height" alt=""/>';
    } else {
        $ava = '<img src="resize.php?img=noava.png&width='.$ava_w.'&height" alt=""/>';
    }
    echo '<div class="link2">';
    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>';

}

    
}

if ( $_GET['mod'] == 2 ) {
    
    $online = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `time` > '".(time()-600)."' AND `sex` = 1  AND `invis` = 0"), 0);
    
    echo '<div class="link1"><b>Парней в онлайне: '.$online.'</b></div>';
    
    $result = mysql_query("SELECT * FROM `profile` WHERE `time` > '".(time()-600)."' AND `sex` = 1 AND `invis` = 0  ORDER BY `time` DESC  ");
    while($user = mysql_fetch_assoc($result)){
    
    if($user['upload_ava']){
        $ava = '<img src="resize.php?img=upload_ava/'.$user['upload_ava'].'&width='.$ava_w.'&height" alt=""/>';
    } else {
        $ava = '<img src="resize.php?img=noava.png&width='.$ava_w.'&height" alt=""/>';
    }
    echo '<div class="link2">';
    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>';

}

    
}

if ( $_GET['mod'] == 3 ) {
    
    $online = mysql_result(mysql_query("SELECT count(*) FROM `profile` WHERE `time` > '".(time()-600)."' AND `vip` > '".time()."'  AND `invis` = 0"), 0);
    
    echo '<div class="link1"><b>VIP Пользователи: '.$online.'</b></div>';
    
    $result = mysql_query("SELECT * FROM `profile` WHERE `time` > '".(time()-600)."' AND `vip` > '".time()."'  AND `invis` = 0  ORDER BY `time` DESC  ");
    while($user = mysql_fetch_assoc($result)){
    
    if($user['upload_ava']){
        $ava = '<img src="resize.php?img=upload_ava/'.$user['upload_ava'].'&width='.$ava_w.'&height" alt=""/>';
    } else {
        $ava = '<img src="resize.php?img=noava.png&width='.$ava_w.'&height" alt=""/>';
    }
    echo '<div class="link2">';
    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>';

}

    
}

navig();
foot();
?>