<?php
include("module/stat-menu.php");?>
 <br><b><center>..:: Рейты нашего сервера ::..</center></b><br> 
<table  width="100%"border="1" >
<tr><td>

EXP: <?php echo $exp;?><br>
SP: <?php echo $sp;?><br></td><td valign="top">
Adena: <?php echo $adena;?><br></td><td>
Items: <?php echo $items;?><br>
Spoil: <?php echo $spoil;?><br>

</td></tr></table>



 <br><b><center>..:: Общая ::..</center></b><br> 
<table  width="100%"border="1" >
<tr><td width="25%" valign="top">


Логин сервер: <?php echo $loginonline; ?><br>
Гейм сервер: <?php echo $gameonline; ?><?php echo $gm; ?><br>
Онлайн: <?php echo $playsonline; ?><br> из них ГМов: <?php echo $gmonline; ?> <br>
Аккаунтов: <?php echo $accountsnum; ?><br>
Чаров: <?php echo $charnum; ?> из них ГМов: <?php echo $gmnum; ?><br>
Кланов: <?php echo $clannum; ?><br>
<img src="module/stat/sex.jpg">
<?php
$sql = mysql_query("select count(*) from characters where sex = 0");
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?>
<br>
<img src="module/stat/sex1.jpg">
<?php
$sql = mysql_query("select count(*) from characters where sex = 1");
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?>
</td><td valign="top"> 
<b>Процентное соотношение расс:</b><br>
<table><tr><td><left>
Люди:
</left><br>
Эльфы:
<br>
Тёмные эльфы:
<br>
Орки:
<br>
Гномы:
</td><td width="50%">
<?php
$sql = mysql_query("select count(*) from characters where race = 0");
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?><br>
<?php
$sql = mysql_query("select count(*) from characters where race = 1");
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?><br>
<?php
$sql = mysql_query("select count(*) from characters where race = 2");
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?><br>
<?php
$sql = mysql_query("select count(*) from characters where race = 3");
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?><br>
<?php
$sql = mysql_query("select count(*) from characters where race = 4");
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?>
</td></tr></table>
</td><td valign="top">
<b>Семь печатей:</b><br><br>
<?php
$sql = mysql_query("select count(*) from seven_signs where cabal like '%dusk%'");
echo "Игроков за сумрак(dusk): ".mysql_result($sql, 0, 0)."<br>";
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?><br><br>

<?php
$sql = mysql_query("select count(*) from seven_signs where cabal like '%dawn%'");
echo "Игроков за рассвет(dawn): " . mysql_result($sql, 0, 0) . "<br>";
$tfg = round(mysql_result($sql, 0, 0)/($charnum/100));
echo "&nbsp<img src=\"module/stat/sexline.jpg\" height=\"10px\" width=\"".$tfg."px\">&nbsp&nbsp ".$tfg."%";
?>

</td></tr></table>
 <br><b><center>..:: Замки ::..</center></b><br><hr>

<table width="100%; border="1" >
<tr>
<td width="20%">Замок:<br>Aden<br>Goddard<br>Giran<br>Oren<br>Gludio<br>Dion<br>Innadril<br>Rune<br>Schuttgart</td>
<td width="30%">Владелец:<br>
<?php

/********  GIRAN  *************/
$giranOwner = "Нет хозяина";
$giranSiegeDate = " ... ";
$giranTax ="";
/*********  OREN  **************/
$orenOwner = "Нет хозяина";
$orenSiegeDate = " ... ";
$orenTax ="";
/**********  ADEN  **************/
$adenOwner = "Нет хозяина";
$adenSiegeDate = " ... ";
$adenTax ="";
/********  Gludio  **************/
$gludioOwner = "Нет хозяина";
$gludioSiegeDate = "...";
$gludioTax ="";
/**********  DION  ***************/
$dionOwner = "Нет хозяина";
$dionSiegeDate = " ... ";
$dionTax ="";
/********  INNADRIL  *************/
$innadrilOwner = "Нет хозяина";
$innadrilSiegeDate = " ... ";
$innadrilTax ="";
/********  GODDARD  *************/
$goddardOwner = "Нет хозяина";
$goddardSiegeDate = " ... ";
$goddardTax ="";
/*********************************/
/********  RUNE  *************/
$runeOwner = "Нет хозяина";
$runeSiegeDate = " ... ";
$runeTax ="";
/*********************************/
/********  SCHUTTGART  *************/
$schuttgartOwner = "Нет хозяина";
$schuttgartSiegeDate = " ... ";
$schuttgartTax ="";
/*********************************/
$result = mysql_query("SELECT name,taxPercent,siegeDate FROM castle");
while($row=mysql_fetch_array($result,MYSQL_ASSOC)){
		switch($row['name']){
			case 'Giran':$giranTax=$row['taxPercent'].'%';
				$giranSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;
			case 'Oren':$orenTax=$row['taxPercent'].'%';
				$orenSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;
			case 'Aden':$adenTax=$row['taxPercent'].'%';
				$adenSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;
			case 'Gludio':$gludioTax=$row['taxPercent'].'%';
				$gludioSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;
			case 'Dion':$dionTax=$row['taxPercent'].'%';
				$dionSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;
			case 'Innadril':$innadrilTax=$row['taxPercent'].'%';
				$innadrilSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;
			case 'Goddard':$goddardTax=$row['taxPercent'].'%';
				$goddardSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;
			case 'Rune':$runeTax=$row['taxPercent'].'%';
				$runeSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;	
			case 'Schuttgart':$schuttgartTax=$row['taxPercent'].'%';
				$schuttgartSiegeDate=date('D\, j M Y H\:i',$row['siegeDate']/1000);break;		

			}
	}
$sql = mysql_query("SELECT castle.name, clan_data.clan_name FROM castle,clan_data WHERE clan_data.hasCastle=castle.id");
	while($row= mysql_fetch_array($sql,MYSQL_ASSOC)){
		switch($row['name']){
			case 'Giran':$giranOwner=$row['clan_name'];break;
			case 'Oren':$orenOwner=$row['clan_name'];break;
			case 'Aden':$adenOwner=$row['clan_name'];break;
			case 'Gludio':$gludioOwner=$row['clan_name'];break;
			case 'Dion':$dionOwner=$row['clan_name'];break;
			case 'Innadril':$innadrilOwner=$row['clan_name'];break;
			case 'Goddard':$goddardOwner=$row['clan_name'];break;
			case 'Rune':$runeOwner=$row['clan_name'];break;
			case 'Schuttgart':$schuttgartOwner=$row['clan_name'];break;
			

			

			}
	}
echo $adenOwner."<br>";
echo $goddardOwner."<br>";
echo $giranOwner."<br>";
echo $orenOwner."<br>";
echo $gludioOwner."<br>";
echo $dionOwner."<br>";
echo $innadrilOwner."<br>";
echo $runeOwner."<br>";
echo $schuttgartOwner."<br>";



?>
</td>
<td width="35%">Дата осады:<br>
<?php
echo $adenSiegeDate."<br>";
echo $goddardSiegeDate."<br>";
echo $giranSiegeDate."<br>";
echo $orenSiegeDate."<br>";
echo $gludioSiegeDate."<br>";
echo $dionSiegeDate."<br>";
echo $innadrilSiegeDate."<br>";
echo $runeSiegeDate."<br>";
echo $schuttgartSiegeDate."<br>";


?>
</td>
<td width="15%">Налог:<br>
<?php
echo $adenTax."<br>";
echo $goddardTax."<br>";
echo $giranTax."<br>";
echo $orenTax."<br>";
echo $gludioTax."<br>";
echo $dionTax."<br>";
echo $innadrilTax."<br>";
echo $runeTax."<br>";
echo $schuttgartTax."<br>";


?>
</td>
</tr>
</table>

<hr>

