Просмотр файла gta/online.php

Размер файла: 1.39Kb
<?php
include "ini.php";
include "includes/header.php";
print '<p><small>
Сейчас играют:<br/>';
$main_users=0;
$city1_users=0;
$city2_users=0;
$city3_users=0;
$nums=200;
$qqq = mysql_query("select last,login,id from users;");
while($arr = mysql_fetch_array($qqq))
{
$dbid=$arr['id'];
$exdata = explode(".", $arr['last']);
$last_time = 1200+intval($exdata[0]);
$last_city = intval($exdata[1]);
if($last_time > time())
        {
                if($last_city == 0)
                {
                ++$main_users;
                }
                if($last_city == 1)
                {
                ++$city1_users;
                $city1_logins_users[] = "".$arr['login']."";
                }
                if($last_city == 2)
                {
                ++$city2_users;
                $city2_logins_users[] = "".$arr['login']."";
                }
                if($last_city == 3)
                {
                ++$city3_users;
                $city3_logins_users[] = "".$arr['login']."";
                }
        }
}

if(empty($city1_logins_users) || count($city1_logins_users)<$nums)
{
for($i=0;$i<count($city1_logins_users);$i++)
{
print '<br/><b>Всего: '.$city1_logins_users.'</b>';
}
}

$main_users=$city1_users+$city2_users+$city3_users+$main_users;
print '<br/><b>Всего: '.$main_users.'</b>';
print "</small></p></card></wml>";
?>