<?php include "core/menu.php" ?>		
<h1>Joueurs en ligne</h1>
<?php
require_once('config/config.php');
mysql_select_db($characters,$connexion);
$char = mysql_query("SELECT * FROM characters WHERE online = 1");
$c=0;
$online=mysql_fetch_assoc($char);
$c=$c+1;
$a = mysql_query("SELECT * FROM `characters` WHERE `online` = '1'");  
$b = mysql_num_rows($a);
if ($b == 0) {
echo 'Il n\'y a aucun joueur connect&eacute;.';
}
else {
echo 'Il y a '.$b.' joueurs connect&eacute;s.'; 
  echo '<tr>
  <table width=520 height=50 border "1">
</tr><th> Nom </th><th> Niveau </th><th>Race </th><th> Classe </th></center></tr>';
	while ($online = mysql_fetch_array($char)){
		$cssclass = 'background-color: #;';
	echo '<center><tr style="'.$cssclass.'">
				<td><center>'.$online['name'].'</td>
				<td><center>'.$online['level'].'</td>
				<td>';
	if ($online['race']==1){
		echo '<center><img src="img/classes/1-0.gif" title="Humain" alt="Humain"/></td>';
	}
	else if ($online['race']==2){
		echo '<center><img src="img/classes/2-0.gif" title="Orc" alt="Orc"/></td>';
	}
	else if ($online['race']==3){
		echo '<center><img src="img/classes/3-0.gif" title="Nain" alt="Nain"/></td>';
	}
	else if ($online['race']==4){
		echo '<center><img src="img/classes/4-0.gif" title="Elf de la nuit " alt="Elfe de la nuit"/></td>';
	}
	else if ($online['race']==5){
		echo '<center><img src="img/classes/5-0.gif" title="Un-dead" alt="Mort vivant"/></td>';
	}
	else if ($online['race']==6){
		echo '<center><img src="img/classes/6-0.gif" title="Tauren" alt="Tauren"/></td>';
	}
	else if ($online['race']==7){
		echo '<center><img src="img/classes/7-0.gif" title="Gnome" alt="Gnome"/></td>';
	}
	else if($online['race']==8){
		echo '<center><img src="img/classes/8-0.gif" title="Troll" alt="Troll"/></td>';
	}
	else if($online['race']==9){
		echo '<center><img src="img/classes/9-0.gif" title="Troll" alt="Troll"/></td>';
	}
	else if($online['race']==10){
		echo '<center><img src="img/classes/10-0.gif" title="Kikooelf" alt="Elfe de sang"/></td>';
	}
	else if($online['race']==11){
		echo '<center><img src="img/classes/11-0.gif" title="Draneil" alt="Draenei"/></td>';
	}
	
	$class = $online['class'];
		
    	switch ($class){
	
		case "1" :
			echo '<td><center><img src="img/classes/guerrier.gif" title="Guerrier" alt="Guerrier"/></td>';
		break;
		
		case "2" :
			echo '<td><center><img src="img/classes/paladin.gif" title="Palagay :p"alt="Paladin"/></td>';
		break;
			
		case "3" :
			echo '<td><center><img src="img/classes/chasseur.gif" title="Chasseur" alt="Chasseur"/></td>';
		break;
					
		case "4" :
			echo '<td><center><img src="img/classes/voleur.gif" title="Voleur" alt="Voleur"/></td>';
		break;
					
		case "5" :
			echo '<td><center><img src="img/classes/prêtre.gif" title="Prêtre" alt="Prêtre"/></td>';
		break;
				case "6" :
			echo '<td><center><img src="img/classes/dk.gif" title="Chevalier de la mort" alt="Chevalier de la mort"/></td>';
		break;
				
		case "7" :
			echo '<td><center><img src="img/classes/chaman.gif" title="Chaman" alt="Chaman"/></td>';
		break;
					
		case "8" :
			echo '<td><center><img src="img/classes/mage.gif" title="Mage" alt="Mage"/></td>';
		break;
					
		case "9" :
			echo '<td><center><img src="img/classes/demoniste.gif" title="Démoniste" alt="Démoniste"/></td>';
		break;
					
                                case "11" :
                                                echo '<td><center><img src="img/classes/druide.gif" alt="Druide"/></td>';
                                break;
}                          
}
echo "</table>";}
?><br>
<br><br>            </div>
            <div id="contenu_b"></div>
    </div>
        <div id="menu-v">
				<hr />
<?php include "core/menud.php" ?>
<?php include "core/end.php" ?>
