<?php

require_once '../includes/start.php';
require_once '../includes/function.php';
require_once '../includes/header1.php';
if($level==0 OR $ban!=0){
   		echo "<title>Доступ закрыт!!!</title>";
	 	echo "<script type=\"text/javascript\">createPopup().show( 0, 0, 0, 0, 0 );</script>";
	 	echo "<body oncontextmenu=\"return false;\"><body onselectstart='return false' oncopy='return false'><body onselectstart=\"return false\" oncopy=\"return false\"><body onload=\"digitalWatch()\">";
		echo '<div class="blok3"><img src="/images/errors.png" width="200px"/></div><div class="blok3"><b>Вы не авторизованный или заблокированный пользователь или вы не достигли условий для доступа на страницу!!!</b><br/><a href="/?sign_in=1"><font color="#4EEE94"><b>Авторизуйтесь</font></a></b> или <a href="/reg.php"><font color="#4EEE94"><b>Зарегистрируйтесь</b></font></a></div>';

}else{
switch ($act) {

default:
echo "<title>Статистика игры</title>"; 
echo "<script type=\"text/javascript\">createPopup().show( 0, 0, 0, 0, 0 );</script>";
echo "<body oncontextmenu=\"return false;\"><body onselectstart='return false' oncopy='return false'><body onselectstart=\"return false\" oncopy=\"return false\"><body onload=\"digitalWatch()\">";
echo '<div class="razd"></div>';
div('<b>Статистика игры</b>','top-nav1');
echo '<div class="razd"></div><br/>';
$t = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `game`!=0 and `rasa`=1;"), 0);
$p = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `game`!=0 and `rasa`=2;"), 0);
$z = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `game`!=0 and `rasa`=3;"), 0);

$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `game`=1;"), 0);
$count1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `planet`;"), 0);
$count2 = mysql_result(mysql_query("SELECT COUNT(*) FROM `army`;"), 0);
$count3 = mysql_result(mysql_query("SELECT COUNT(*) FROM `war`;"), 0);
$count4 = mysql_result(mysql_query("SELECT COUNT(*) FROM `sector_loc` WHERE `loc`=4;"), 0);
$count5 = mysql_result(mysql_query("SELECT COUNT(*) FROM `sector_loc` WHERE `loc`=5;"), 0);
$count6 = mysql_result(mysql_query("SELECT COUNT(*) FROM `sector_loc` WHERE `loc`=3;"), 0);
$count7 = mysql_result(mysql_query("SELECT COUNT(*) FROM `rabota`;"), 0);
$count8 = mysql_result(mysql_query("SELECT COUNT(*) FROM `log_battle`;"), 0);
$count9 = mysql_result(mysql_query("SELECT COUNT(*) FROM `art`;"), 0);
$count10 = mysql_result(mysql_query("SELECT COUNT(*) FROM `sector_loc` WHERE `loc`=6;"), 0);
$count11 = mysql_result(mysql_query("SELECT COUNT(*) FROM `sun`;"), 0);
$count12 = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`;"), 0);
echo '<div class="blok">Всего зарегистрировано: <font color="#4EEE94">['.$count12.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok4">';
echo '<img src="../images/race/people.png" alt="image" /> <b>Людей:</b> <font color="#4EEE94">['.$t.']</font><br/>';
echo '<img src="../images/race/cyborgs.png" alt="image" /> <b>Киборгов:</b> <font color="#4EEE94">['.$p.']</font><br/>';
echo '<img src="../images/race/organ.png" alt="image" /> <b>Органиков:</b> <font color="#4EEE94">['.$z.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Активные игроки:</b> <font color="#4EEE94">['.$count.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Звезды:</b> <font color="#4EEE94">['.$count11.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Планеты:</b> <font color="#4EEE94">['.$count1.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Отряды:</b> <font color="#4EEE94">['.$count2.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Войны:</b> <font color="#4EEE94">['.$count3.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Сражения:</b> <font color="#4EEE94">['.intval($count8/2).']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Луны:</b> <font color="#4EEE94">['.$count4.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Порталы:</b> <font color="#4EEE94">['.$count5.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Артефакты:</b> <font color="#4EEE94">['.$count9.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Метеориты и кометы:</b> <font color="#4EEE94">['.$count6.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Корабли Зелл-Нага:</b> <font color="#4EEE94">['.$count10.']</font></div>';
echo '<div class="razd"></div>';
echo '<div class="blok1"><img src="../images/icon/menu.png" alt="" /> <b>Текущие работы:</b> <font color="#4EEE94">['.$count7.']</font></div>';
break;
}
}
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';
?>
