<?php
	
	require_once '../includes/start.php';
	require_once '../includes/function.php';
	require_once '../includes/header1.php';
	switch ($act) {
	default:
	echo '
<title>Кто онлайн</title>';
echo '
	<meta name="keywords" content="Астрономика, онлайн игра, астра, astronomika, космическая мобильная игра">';
echo '
</head>
<body>';
echo '
<body oncontextmenu="return false;">
<body onselectstart="return false"  oncopy="return false"><body onload="digitalWatch()">
	<style type="text/css">{-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none;}</style>';
	echo '
	<div class="razd"></div>';	
	echo '
	<div class="top-nav1">
		<font color="#4EEE94"><b>Кто онлайн</b></font> | <a href="?act=history"><b>История</b></a>
	</div>';
	echo '
	<div class="razd"></div>
	<br/>';
	$PAGINGS = mysql_query("SELECT * FROM `users` WHERE `lasttime` > '" . ($realtime - $online_time) . "' ORDER BY `lasttime` DESC");
	if($PAGINGS > 0)
	{
		while($row = mysql_fetch_array($PAGINGS))
		{

	echo '
	<div class="window1">';
	echo '
	<div class="dashed"></div>';
	echo '
	<center>
	'.rasa($row['rasa']).' <a href="anketa.php?id='.$row['id'].'"><span class="'.crasa($row['rasa']).'">'.$row['name_user'].'<font color="#FFFFFF">[<font color="#4EEE94">'.date('H:i',$row['lasttime']).'</font>]</font></span></a>
	</center>';
	if($row['fr_id']!=0)
	echo ' 
	{<a href="../fraction/fraction.php?f='.$row['fr_id'].'">'.$row['fr_name'].'</a>}';
	echo '
	<div class="dashed"></div>';
	echo '
	</div>'; 

	}
	}

	
	break;
	case 'history':
	echo '
<title>История</title>';
echo '
	<meta name="keywords" content="Астрономика, онлайн игра, астра, astronomika, космическая мобильная игра">';
echo '
</head>
<body>';
echo '
<body oncontextmenu="return false;">
<body onselectstart="return false"  oncopy="return false"><body onload="digitalWatch()">
	<style type="text/css">{-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none;}</style>';
	echo '
	<div class="razd"></div>';
	echo '
	<div class="top-nav1">
		<a href="online.php"><b>Кто онлайн</b></a> | <font color="#4EEE94"><b>История</b></font>
	</div>';	
	echo '
	<div class="razd"></div>
	<br/>';
	$onltime = $realtime - 86400;	
	$count1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lasttime` > '$onltime';"), 0);	
	echo '
	<div class="blok">За последние 24 часа в онлайне были:</div>';	
	$PAGINGS = mysql_query("SELECT * FROM `users` WHERE `lasttime` > '" . ($onltime) . "' ORDER BY `lasttime` DESC");
	if($PAGINGS > 0)
	{
		while($row = mysql_fetch_array($PAGINGS))
		{

	echo '
	<div class="window1">';
	echo '
	<div class="dashed"></div>';	
	echo '
	<center>
	'.rasa($row['rasa']).' <a href="anketa.php?id='.$row['id'].'"><span class="'.crasa($row['rasa']).'">'.$row['name_user'].'<font color="#FFFFFF">[<font color="#4EEE94">'.date('H:i',$row['lasttime']).'</font>]</font></span></a>
	</center>';
	echo '
	<div class="dashed"></div>';
	echo '
	</div>';	
	
	}

	}		
}
	echo '
	<div class="razd"></div>';
	echo '
	<center>
		<div class="blok2"><a href="../"><b>На Главную</b></a>
		</div>
	</center>';
	echo '
	<div class="razd"></div>';
	require_once '../includes/footer1.php';
?>