<?php include "core/menu.php" ?>
							<br/><br/>
						</div>
					</div>
				</div>
				
				<div class="spacer"></div>				<div class="news">
<?php include "config/config3.php";
error_reporting(0);
session_start() ?>
<br/
<?php ?>		
<?php
require_once('config/config3.php');
mysql_connect ("$host","$user","$pass");
mysql_select_db($characters);

$sql = "SELECT * FROM characters WHERE online = 1";

$result = mysql_query($sql);
$i=0;
	  ?>
      <table><p><div>
   	<h1>Liste des joueurs connectés</h1>
					<div class="spacer"></div>
					<div class="newscontent"> <div class="postinfos"></div>
						<p>
<table width="100%" cellspacing="1" cellpadding="1" border="0">
	<tr><td>Pseudo</td><td>Niveau</td><td>Race</td><td>Classe</td></tr><tr><td colspan="4"><div class="barre"></div></td></tr>
        <?php
while($reponse=mysql_fetch_assoc($result))
{
$i=$i+1;
?><tr><td><?php echo htmlentities($reponse['name']); ?></td> <td><?php echo $reponse['level']; ?></td><td><?php
if ($reponse['race']==1)
{
	echo '<img src="img/classes/1-0.gif" title="Humain" alt="Humain"/>';
}
	else if ($reponse['race']==2){
		echo '<img src="img/classes/2-0.gif" title="Orc" alt="Orc"/>';
	}
	else if ($reponse['race']==3){
		echo '<img src="img/classes/3-0.gif" title="Nain" alt="Nain"/>';
	}
	else if ($reponse['race']==4){
		echo '<img src="img/classes/4-0.gif" title="Elf de la nuit " alt="Elfe de la nuit"/>';
	}
	else if ($reponse['race']==5){
		echo '<img src="img/classes/5-0.gif" title="Un-dead" alt="Mort vivant"/>';
	}
	else if ($reponse['race']==6){
		echo '<img src="img/classes/6-0.gif" title="Tauren" alt="Tauren"/>';
	}
	else if ($reponse['race']==7){
		echo '<img src="img/classes/7-0.gif" title="Gnome" alt="Gnome"/>';
	}
	else if($reponse['race']==8){
		echo '<img src="img/classes/8-0.gif" title="Troll" alt="Troll"/>';
	}
	else if($reponse['race']==9){
		echo '<img src="img/classes/11-2.gif" title="Gobelin" alt="Gobelin"/>';
	}
	else if($reponse['race']==10){
		echo '<img src="img/classes/10-0.gif" title="Elfe de sang" alt="Elfe de sang"/>';
	}
	else if($reponse['race']==11){
		echo '<img src="img/classes/11-0.gif" title="Dranei" alt="Draenei"/>';
	}
	else if($reponse['race']==22){
		echo '<img src="img/classes/11-3.gif" title="Worgen" alt="Worgen"/>';
	}
	?></td> <td><?php
if ($reponse['class']==1)
{
	echo '<img src="img/classes/1.gif" title="Guerrier" alt="Guerrier"/>';
}
	else if ($reponse['class']==2){
		echo '<img src="img/classes/2.gif" title="Paladin" alt="Paladin"/>';
	}
	else if ($reponse['class']==3){
		echo '<img src="img/classes/3.gif" title="Hunt" alt="Hunt"/>';
	}
	else if ($reponse['class']==4){
		echo '<img src="img/classes/4.gif" title="Voleur " alt="Elfe de la nuit"/>';
	}
	else if ($reponse['class']==5){
		echo '<img src="img/classes/5.gif" title="Prêtre" alt="Prêtre"/>';
	}
	else if ($reponse['class']==6 or $reponse['class']==11){
		echo '<img src="img/classes/6.gif" title="Druide" alt="Druide"/>';
	}
	else if ($reponse['class']==7){
		echo '<img src="img/classes/7.gif" title="Chaman" alt="Chaman"/>';
	}
	else if($reponse['class']==8){
		echo '<img src="img/classes/8.gif" title="Mage" alt="Mage"/>';
	}
	else if($reponse['class']==9){
		echo '<img src="img/classes/9.gif" title="Démoniste" alt="Démoniste"/>';
	}
	else if($reponse['class']==10){
		echo '<img src="img/classes/10.gif" title="Chevalier de la mort" alt="Chevalier de la mort"/>';
	}
	?>
	</table></td></tr>
	</div>							
	</p>
<?php
}
?>
					
					</div>
					<div class="spacer"></div>
				</div>
			</div>

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