<?php
include('cfg.php');
if(empty($user['login']))
{
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Цивилизация</title>


 <link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div class="head">
Мобильная браузерная онлайн игра

</div>
<div class="info">

<b>Цивилизация</b>
</div>
<div class="money"><img src="./images/Tactics.png" alt="logo"></div>
<form action="auth.php" method="GET">
<div class="money">Логин:<br />
<input name="login" type="text" value=""><br />
Пароль:<br />
<input name="pass" type="password" value="">
<br /><input type="submit" CLASS="buttonnext1" value="Войти">
<?
$countries = mysql_result(mysql_query("SELECT count(`id`) FROM `users` WHERE `defeat`='0'"),0); //всего стран
echo '</div><div class="money">Стран на карте мира: '.$countries.'<br />';
$online = mysql_query("SELECT * FROM users WHERE authtime>'".time()."'");
$count=mysql_num_rows($online);
echo 'Сейчас в игре: '.$count;

$HTTP_REFERER = $_SERVER["HTTP_REFERER"];
if (empty($HTTP_REFERER)) $HTTP_REFERER = 'Неизвестно';

if ((substr($HTTP_REFERER, 0, 17))=='http://civilz.net') $HTTP_REFERER = 'Цивилизация';
if ((substr($HTTP_REFERER, 0, 17))=='http://mobiads.ru') $HTTP_REFERER = 'MobiAds';
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `HTTP_REFERER` WHERE `url`='$HTTP_REFERER'"),0);
if ($count >= '1')
	{

	mysql_query("UPDATE `HTTP_REFERER` SET `count`=count+'1' WHERE `url`='$HTTP_REFERER'");
	} else mysql_query("INSERT INTO `HTTP_REFERER` SET `url`='$HTTP_REFERER', `count`='1'");


?></div>

 <a class="razd" href="reg.php"><img src="./images/pen.png" alt="*"> Регистрация</a>
 <a class="razd" href="remember.php"><img src="./images/pen.png" alt="*"> Забыли пароль?</a></div>

<div class="footer">
<div align="center"><a href="http://wapworld.pp.ua">© WapWorld Games</a><br/><br /></div>
</div>
<center>
</body></html>

<?php
}
else
{
	header('location:game.php');
}
?>