<?php include "core/menu.php";
error_reporting(0);?>
							<br/><br/>
						</div>
					</div>
				</div>
				
				<div class="spacer"></div>				<div class="news">
				<div>
<br/
<?php ?>	
	
<h3>Mes personnages</h3><br>
<?php
include ('config/config.php');
 mysql_select_db($realmd);
  $points = mysql_query("SELECT * FROM account WHERE id = '$_SESSION[id]'");
  $donnees = mysql_fetch_array($points);
if ($_SESSION['logged'] == 0)
{ 
if ($_SESSION['logged'] == 0)
			{
			echo "
<h3><center><b>Vous devez etre connecte pour acceder a cette partie !</center></b></h3>
<center>
<form action=\"connexion.php?action=connexion\" method=\"post\">
<b>Nom de compte :</b></font><br /><input type=\"text\" name=\"pseudo\"><br />
<b>Mot de passe  :</b></font><br <input type=\"password\" name=\"pass\"><br /><br />
<input type=\"submit\" value=\"Connexion\" name=\"connexion\" >
</center></form>";
			}
			else
			{
			echo "
<h3><center><b>Une erreur est survenue merci de la signaler au WebMaster</center></b></h3>
<center><a href=\"membre.php\">Retour</a></center>";
			}
}
else
{
if ($alow_connexion == 0)
{
?>
<center><h2><u>Gestion de compte :</u><h2></center>
<center><h3>La gestion de compte est en maintenance.<h3></center>
<meta http-equiv="refresh" content="5;url=index.php" />
<center>Vous alez être redirige dans 5 secontes !</center>
<?php
}
else
{
?>
 <?php
 include "config/config3.php";
mysql_select_db($characters) or die();
$query = "SELECT * FROM `characters` WHERE account='".$_SESSION['id']."' ORDER BY `name` ASC";
$result = mysql_query($query) or die (mysql_error());
echo  '<table width=520 height=50 border "1">
</tr><th> Nom </th><th>Race </th><th> Classe </th><th> niveau </th><th><center> Argent </center></th></tr>';
while ($row = mysql_fetch_array($result)){
	if($cpt % 2){
		$cssclass = 'background-color: #;';
	}
	else{
		$cssclass = 'background-color: #;';
	}
	echo '<center><tr style="'.$cssclass.'">
				<td><center>'.$row['name'].'</td>
				<td>';
	if ($row['race']==1){
		echo '<center><img src="img/classes/1-0.gif" title="Humain" alt="Humain"/></td>';
	}
	else if ($row['race']==2){
		echo '<center><img src="img/classes/2-0.gif" title="Orc" alt="Orc"/></td>';
	}
	else if ($row['race']==3){
		echo '<center><img src="img/classes/3-0.gif" title="Nain" alt="Nain"/></td>';
	}
	else if ($row['race']==4){
		echo '<center><img src="img/classes/4-0.gif" title="Elf de la nuit " alt="Elfe de la nuit"/></td>';
	}
	else if ($row['race']==5){
		echo '<center><img src="img/classes/5-0.gif" title="Un-dead" alt="Mort vivant"/></td>';
	}
	else if ($row['race']==6){
		echo '<center><img src="img/classes/6-0.gif" title="Tauren" alt="Tauren"/></td>';
	}
	else if ($row['race']==7){
		echo '<center><img src="img/classes/7-0.gif" title="Gnome" alt="Gnome"/></td>';
	}
	else if($row['race']==8){
		echo '<center><img src="img/classes/8-0.gif" title="Troll" alt="Troll"/></td>';
	}
	else if($row['race']==9){
		echo '<center><img src="img/classes/9-0.gif" title="Troll" alt="Troll"/></td>';
	}
	else if($row['race']==10){
		echo '<center><img src="img/classes/10-0.gif" title="Kikooelf" alt="Elfe de sang"/></td>';
	}
	else if($row['race']==11){
		echo '<center><img src="img/classes/11-0.gif" title="Draneil" alt="Draenei"/></td>';
	}
	$class = $row['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;
}


$cpt++; 
echo '<td><center>'.$row['level'].'</td>';
echo '<td><div align="right">';
$money = $row['money'];
$inverse_money = strrev($money) ;
$pieces = str_split($inverse_money, 2);
$pa_pc = (str_split($inverse_money, 4));
$endroit_papc = strrev($pa_pc[0]);
$remplace = array($endroit_papc);
$po = str_replace($remplace, "", $money);
$pc = strrev($pieces[0]);
$pa = strrev($pieces[1]);
switch ($money) {

case 0 :
    echo "0&nbsp;<img src='img/or.gif' />&nbsp;";
    break;
default: 
    switch ($po) {
    
    case! '' :
    echo $po . "&nbsp;<img src='img/or.gif' />&nbsp;";
    break;
    
    default:
    break;
    
    }
    
    switch ($pa) {
    
    case! '' :
    echo $pa . "&nbsp;<img src='img/argent.gif' />&nbsp;";
    break;
    
    default:
    break;
    
    }
    
    switch ($pc) {
    
    case! '' :
    echo $pc . "&nbsp;<img src='img/cuivre.gif' />&nbsp;";
    break;
    
    default:
    break;
    
    }
    
    break;

}
echo '</td></div>';
echo '</tr>';
}
echo '</table>';
?>    <br />  &nbsp;&nbsp;&nbsp;&nbsp;<a href="listpers.php">Retour a la liste des personnages</a>

<?php
}
}
?>
					</div>
					<div class="spacer"></div>
				</div>
			</div>

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