<?php include "core/menu.php" ?>
							<br/><br/>
						</div>
					</div>
				</div>
				<center>
				<div class="spacer"></div>				<div class="news">
				<div />
				<div>	
<h1>Statistiques</h1> <center><br><br><br>
<?php 
require_once('config/config.php');
mysql_select_db ("$characters");
$race = array();
$class = array();
for($n=1; $n <= 11; $n++){
    $sql = "SELECT COUNT(race) FROM `characters` WHERE `race`=".$n;
    $query = mysql_query($sql);
    $race[$n] = mysql_result($query, 0);
    mysql_free_result($query);
}
for($n=1; $n <= 11; $n++){
    $sql = "SELECT COUNT(class) FROM `characters` WHERE `class`=".$n;
    $query = mysql_query($sql);
    $class[$n] = mysql_result($query, 0);
    mysql_free_result($query);
}

echo "<img src=img/classes/1-0.gif /> &nbsp;Humain(s): ".$race[1]."<br>";
echo "<img src=img/classes/3-0.gif /> &nbsp;Nain(s): ".$race[3]."<br>";
echo "<img src=img/classes/4-0.gif /> &nbsp;Elfe(s) de la nuit: ".$race[4]."<br>";
echo "<img src=img/classes/7-0.gif /> &nbsp;Gnome(s): ".$race[7]."<br>";
echo "<img src=img/classes/11-0.gif /> &nbsp;Draenei(s): ".$race[11]."<br>";
echo "<img src=img/classes/2-0.gif /> &nbsp;Orc(s): ".$race[2]."<br>";
echo "<img src=img/classes/5-0.gif /> &nbsp;Mort-vivant(s): ".$race[5]."<br>";
echo "<img src=img/classes/6-0.gif /> &nbsp;Tauren(s): ".$race[6]."<br>";
echo "<img src=img/classes/8-0.gif /> &nbsp;Troll(s): ".$race[8]."<br>";
echo "<img src=img/classes/10-0.gif /> &nbsp;Elfe(s) de sang: ".$race[10]."<br><br>";
echo "<img src=img/classes/druide.gif /> &nbsp;Druide(s): ".$class[11]."<br>";
echo "<img src=img/classes/chasseur.gif /> &nbsp;Chasseurs(s): ".$class[3]."<br>";
echo "<img src=img/classes/mage.gif /> &nbsp;Mage(s): ".$class[8]."<br>";
echo "<img src=img/classes/paladin.gif /> &nbsp;Paladin(s): ".$class[2]."<br>";
echo "<img src=img/classes/pretre.gif /> &nbsp;Pr&ecirc;tre(s): ".$class[5]."<br>";
echo "<img src=img/classes/voleur.gif /> &nbsp;Voleur(s): ".$class[4]."<br>";
echo "<img src=img/classes/chaman.gif />&nbsp; Chaman(s): ".$class[7]."<br>";
echo "<img src=img/classes/demoniste.gif /> &nbsp;D&eacute;moniste(s): ".$class[9]."<br>";
echo "<img src=img/classes/guerrier.gif /> &nbsp;Guerrier(s): ".$class[1]."<br>";
echo "<img src=img/classes/10.gif /> &nbsp;Chevalier(s) de la mort: ".$class[6]."<br>";
?><br> </center>
<u><b>Total personnages crees : </b></u></b></u><br><?php 
require_once ( 'config/config.php');
$conn = mysql_connect($host, $user, $pass) or die('Connexion &eacute;chou&eacute;: ' . mysql_error());

mysql_select_db($characters, $conn) or die('La s&eacute;lection de la base de donn&eacute;e &agrave; &eacute;chou&eacute;: ' . mysql_error());

$sql = "SELECT Count(guid) FROM `characters`";
$result = mysql_query($sql, $conn);
$row = mysql_fetch_array($result);
$guid = $row["Count(guid)"];
echo "$guid personnages";
?><br>
<u><b>Total comptes crees : </b></u><br>
<?php 
require_once ( 'config/config.php');
$conn = mysql_connect($host, $user, $pass) or die('Connexion &eacute;chou&eacute;: ' . mysql_error());

mysql_select_db($realmd, $conn) or die('La s&eacute;lection de la base de donn&eacute;e &agrave; &eacute;chou&eacute;: ' . mysql_error());

$sql = "SELECT Count(username) FROM `account`";
$result = mysql_query($sql, $conn);
$row = mysql_fetch_array($result);
$username = $row["Count(username)"];
echo "$username comptes";
?>
</div>
					</div>
					<div class="spacer"></div>
				</div>
			</div>

<?php include "core/end.php" ?>
