<?php include "core/menu.php" ?>
							<br/><br/>
						</div>
					</div>
				</div>
				
				<div class="spacer"></div>				<div class="news">
				<div />
				<div>
				<?php
error_reporting(0);
include ('config/config.php');

function deconnexion()
{
	$_SESSION = array(); //Destruction des variables.
	session_destroy(); //Destruction de la session.
	?>
	<script language="JavaScript">
	<!--
	window.location.href="index.php"
	//-->
	</script>
	<?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 "
<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
{
?><center>
	<?php
	if ($_SESSION['niveau'] == 0){
mysql_select_db($realmd,$connexion) or die(mysql_error());
		$post = $_SESSION['id'];
			$resultat = mysql_query("SELECT * FROM account WHERE id='$post'")or die ("Erreur requette SQL");
			$info=mysql_fetch_array($resultat);?>
	Bienvenue, <b><?php echo $_SESSION['username']; ?>!<br /></b>
	<u>Votre compte est de niveau :<b> Administrateur</b></u><br /><br><br>
	
</b>      <hr size="1" noshade="noshade" />

<?php
switch ($_GET['action'])
		{
					case "":
		echo'<a href="admin.php?action=boutique"><font color=white>[Administration de la boutique]</font></a><br />
		<a href="admin.php?action=site"><font color=white>[Administration du site]</font></a><br />
			 <a href="admin.php?action=players"><font color=white>[Administration des joueurs]</font></a><br><br>
			<a href="membre.php">Retour a la gestion de compte</a>
';
				     
		break;
					case "boutique":
					echo'<a href="admin.php?action=item"><font color=white>[Ajouter des objets]</font></a><br />
					<a href="admin.php?action=money"><font color=white>[Ajouter de l\'argent]</font></a><br />
					<a href="admin.php?action=level"><font color=white>[Ajouter des niveaux]</font></a><br /><br />
					
					<a href="admin.php?action=delitem"><font color=red>[Supprimer des objets]</font></a><br />
					<a href="admin.php?action=delevel"><font color=red>[Supprimer des niveaux]</font></a><br />
					<a href="admin.php?action=delmoney"><font color=red>[Supprimer de l\'argent]</font></a><br /><br /><a href="admin.php">Retour</a>
					';
					break;
					
					case "site":
					echo'<a href="admin.php?action=news"><font color=white>[&Eacute;crire des news]</font></a><br />
					<a href="admin.php?action=staff"><font color=white>[Modifier le staff]</font></a><br />
					<a href="admin.php?action=conf"><font color=white>[Reconfigurer le site]</font></a><br /><br />
					<a href="admin.php">Retour</a>
					';
					break;
					
										case "players":
					echo'<a href="admin.php?action=accsel"><font color=white>[G&eacute;rer les comptes]</font></a><br />
					<a href="admin.php?action=charsel"><font color=white>[G&eacute;rer les personnages]</font></a><br />
					<a href="admin.php?action=poisel"><font color=white>[Ajouter des points]</font><br><br>
					<a href="admin.php?action=bansel"><font color=red>[Bannir un membre]</font></a><br /><a href="admin.php">Retour</a>
					';
					break;
					
					case "accsel":
					echo'<form method="post" action="admin.php?action=account">
					Compte: <input type=text name=account><br>
					<input type=submit value=Envoyer><br><br><a href="admin.php">Retour</a>
					</form>';
					break;
					
										case "bansel":
					echo'<form method="post" action="admin.php?action=ban">
					Compte a bannir: <input type=text name=banacc><br>
					Nombre de jours: <input type=text name=deband><br>
					Raison: <input type=text name=reason><br>
					<input type=submit value=Bannir><br><br>
					</form>
					<a href="admin.php">Retour</a>';
					break;
					
					case "conf":
					echo'<h3>Configurer le site</h3>
<p><form method="post" action="admin.php?action=config">
Serveur de la base de donnees : <input type="text" name="host" value='.$host.'><br />
Utilisateur : <input type="text" name="user" value='.$user.'><br />
Mot de passe : <input type="text" name="pass" value='.$pass.'><br /><br />
Base de donnees de mangos : <input type="text" name="mangos" value='.$mangos.'><br />
Base de donnees des comptes : <input type="text" name="realmd" value='.$realmd.'><br />
Base de donnees des personnages : <input type="text" name="characters" value='.$characters.'><br />
Base de donnees du site : <input type="text" name="site" value="site">(Si elle n\'existe pas, elle sera cr&eacute;e.)<br />
<br />
Nom du serveur : <input type="text" name="serveur" value='.$serveur.' /><br />
Adresse du forum : <input type="text" name="lien" value='.$forum.' /><br />
Lien de vote RPG Paradize : <input type="text" name="paradize" value='.$paradize.'><br />
Lien de vote Gowonda : <input type="text" name="gowonda" value='.$gowonda.'><br />
Realmlist : <input type="text" name="realmlist" value="Set realmlist"><br />
Version du serveur : <input type="text" name="version" value='.$version.'><br />

<br /><center><input type="submit" name="conf" value="Configurer"></center></form></p>';
					break;
					
										case "config":

					$fichier = fopen('config/config.php', 'w+');
					$config = '<?php
$host = \''.$_POST['host'].'\';
$user = \''.$_POST['user'].'\';
$pass = \''.$_POST['pass'].'\';
$connexion = mysql_connect($host ,$user ,$pass) or die(mysql_error());
$realmd = \''.$_POST['realmd'].'\';
$mangos = \''.$_POST['world'].'\';
$characters = \''.$_POST['characters'].'\';
$forum= \''.$_POST['lien'].'\';
$realmlist = \''.$_POST['realmlist'].'\';
$version = \''.$_POST['version'].'\';
$serveur = \''.$_POST['serveur'].'\';
$paradize = \''.$_POST['paradize'].'\';
$gowonda = \''.$_POST['gowonda'].'\';
$connect = TRUE;
$ip = "127.0.0.1";
$port = "3306";
$site = \''.$_POST['site'].'\';
$alow_connexion = "1";
$installed = 1;
?>
';
fwrite($fichier, $config);
fclose($fichier);
echo'Le site a &eacute;t&eacute; configur&eacute; avec succes. <meta http-equiv="refresh" content="3;url=admin.php" />';
break;
					
										case "ban":
										$accoban = $_POST['banacc'];
										$debanda = $_POST['deband'];
										
						$username = $_SESSION['username'];
						$reason = $_POST['reason'];
						mysql_select_db($realmd,$connexion);
						$datey = date("Y");
						$datem = date("m");
						$dated = date("d");
$dateban =''.$datey.''.$datem.''.$dated.'';
$deband = $dateban + $debanda;

						$infos=mysql_query("SELECT * FROM account WHERE username='$accoban'");
						$acc=mysql_fetch_assoc($infos);
						$idban = $acc['id'];
						if (empty($acc['id']) OR empty($accoban))
						{
						echo 'Impossible de trouver ce compte.<br><a href=admin.php?action=bansel>Reessayer</a>';
						}
						else
						{
						mysql_query("INSERT INTO account_banned VALUES ('$idban','$dateban','$deband','$username','$reason',1)");
	echo"Le compte <font color=white>".$acc['username']."</font> a &eacute;t&eacute; banni par <font color=green>".$username."</font> pour une dur&eacute;e de ".$debanda." jours.<br>Motif : <font color=white>".$reason."</font>
<br><br><a href=admin.php>Retour</a>	";
}
					break;
					
					case "poisel":
					echo'<form method="post" action="admin.php?action=points">
					Compte: <input type=text name=account><br>
					Nombre de points a ajouter : <input type=text name=points><br>
					<input type=submit value=Envoyer><br><br><a href="admin.php">Retour</a>
					</form>';
					break;
					
					case "charsel":
					echo'<form method="post" action="admin.php?action=character">
					Personnage: <input type=text name=character><br>
					<input type=submit value=Envoyer><br><br><a href="admin.php">Retour</a>
					</form>';
					break;
					
															case "points":
						$username = $_POST['account'];
						mysql_select_db($realmd,$connexion);
						$infos=mysql_query("SELECT * FROM account WHERE username='$username'");
						$acc=mysql_fetch_assoc($infos);
						$pointsadd = $acc['dp'] + $_POST['dp'];
						if (empty($acc['id']))
						{
						echo 'Impossible de trouver ce compte.<br><a href=admin.php?action=poisel>Reessayer</a>';
						}
						else
						{
						echo '<h3>Compte: '.$acc['username'].'</h3>';
						mysql_query("UPDATE account SET points='$pointsadd' WHERE username='$username'");
	echo"Les points ont &eacute;t&eacute; donn&eacute;s.
<br><a href=admin.php>Retour</a>	";
}
					break;
					
										case "account":
						$username = $_POST['account'];
						mysql_select_db($realmd,$connexion);
						$infos=mysql_query("SELECT * FROM account WHERE username='$username'");
						$acc=mysql_fetch_assoc($infos);
						if (empty($acc['id']))
						{
						echo 'Impossible de trouver ce compte.<br><a href=admin.php?action=accsel>Reessayer</a>';
						}
						else
						{
						echo '<h3>Compte: '.$acc['username'].'</h3>Id : <font color=white>'.$acc['id'].'</font><br>
						Niveau Mj : <font color=white>';
						if ($acc['gmlevel'] ==0) echo 'joueur';
	if ($acc['gmlevel'] ==1) echo 'Moderateur';
if ($acc['gmlevel'] ==2) echo 'Maitre de jeu';
if ($acc['gmlevel'] ==3) echo 'Administrateur';
echo'</font><br>Adresse email :<font color=white> '.$acc['email'].'</font><br> Date d\'inscription : <font color=white>'.$acc['joindate'].'</font> <br>Derni&egrave;re adresse IP : <font color=white>'.$acc['last_ip'].'</font>
<br>Expansion : <font color=white>';
if ($info["expansion"] ==0) echo 'World of Warcraft classique';  
	if ($info["expansion"] ==1) echo 'The Burning Crusade';
	if ($info["expansion"] ==2) echo 'Wrath of The Lich King';
	if ($info["expansion"] ==3) echo 'Cataclysme';
	echo"
	<form method=post action=admin.php?action=modacc>
	</font><br>Points :<font color=white> ".$acc['points']."</font><br><hr>
Modifier niveau mj : <select name=gmlev>
											<option value=0>Joueur</option>
											<option value=1>Moderateur</option>
											<option value=2>Maitre de jeu</option>
											<option value=3>Administrateur</option>											
										</select><br>
Modifier Adresse email : <input type=text name=modemail value=".$acc['email']."><br>
Modifier expansion : <select name=nexp>
											<option value=2>Wrath of the Lich King</option>
											<option value=1>Burning Crusade</option>
											<option value=0>World of Warcraft</option>
										</select>										
										</select><br><br>
										<input type=submit value=Modifier>
										<input type=hidden name=id value=".$acc['id']."</form>
<br><a href=admin.php?action=accsel>G&eacute;rer un autre compte</a>	";
}
					break;
					
															case "character":
						$character = $_POST['character'];
						mysql_select_db($characters,$connexion);
						$infos=mysql_query("SELECT * FROM characters WHERE name='$character'");
						$acc=mysql_fetch_assoc($infos);
						if (empty($acc['guid']))
						{
						echo 'Impossible de trouver ce personnage.<br><a href=admin.php?action=charsel>Reessayer</a>';
						}
						else
						{
						$acco= $acc['account'];
												mysql_select_db($realmd,$connexion);
						$infosu=mysql_query("SELECT * FROM account WHERE id='$acco'");
						$infuser=mysql_fetch_assoc($infosu);
						echo '<h3>Personnage: '.$acc['name'].'	(';
if($acc['online'] ==1) echo '<font color=green>En ligne</font>';
if($acc['online'] ==0) echo '<font color=red>Hors ligne</font>';
echo')</h3>Compte : <font color=white>'.$infuser['username'].'</font><br>
						Guid : <font color=white>'.$acc['guid'].'</font><br>
						Race : <font color=white>';
							if ($acc['race']==1){
		echo 'Humain';
	}
	else if ($acc['race']==2){
		echo 'Orc';
	}
	else if ($acc['race']==3){
		echo 'Nain</td>';
	}
	else if ($acc['race']==4){
		echo 'Elfe de la nuit';
	}
	else if ($acc['race']==5){
		echo 'Mort vivant';
	}
	else if ($acc['race']==6){
		echo 'Tauren';
	}
	else if ($acc['race']==7){
		echo 'Gnome';
	}
	else if($acc['race']==8){
		echo 'Troll';
	}
	else if($acc['race']==9){
		echo 'Troll';
	}
	else if($acc['race']==10){
		echo 'Elfe de sang';
	}
	else if($acc['race']==11){
		echo 'Draenei';
	}
echo'</font><br>Classe :<font color=white> ';
if ($acc['class']==1){
		echo 'Guerrier';
	}
	else if ($acc['class']==2){
		echo 'Paladin';
	}
	else if ($acc['class']==3){
		echo 'Chasseur</td>';
	}
	else if ($acc['class']==4){
		echo 'Voleur';
	}
	else if ($acc['class']==5){
		echo 'Pretre';
	}
	else if ($acc['class']==6){
		echo 'Chevalier de la mort';
	}
	else if ($acc['class']==7){
		echo 'Chaman';
	}
	else if($acc['class']==8){
		echo 'Mage';
	}
	else if($acc['class']==9){
		echo 'Demoniste';
	}
	else if($acc['class']==11){
		echo 'Druide';
	}

echo'</font><br> Argent : <font color=white>';
$money = $acc['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'</font>
<br>Niveau: <font color=white>'.$acc['level'].'';
	echo"
	<form method=post action=admin.php?action=modchar>
	</font><br>Points d'arene :<font color=white> ".$acc['arenaPoints']."</font>
	</font><br>Points d'honneur :<font color=white> ".$acc['totalHonorPoints']."</font>
	</font><br>Victoires honorables :<font color=white> ".$acc['totalKills']."</font><br>

	<hr>
Modifier niveau : <input type=text name=nlev value=".$acc['level']."><br>
Modifier points d'arene : <input type=text name=naren value=".$acc['arenaPoints']."><br>
Modifier points d'honneur : <input type=text name=nhonor value=".$acc['totalHonorPoints']."><br>
<br><br>
										<input type=submit value=Modifier>
										<input type=hidden name=id value=".$acc['guid']."</form>
<br><a href=admin.php?action=charsel>G&eacute;rer un autre personnage</a>";
}
					break;
					
							case "modchar":
										$nlev = $_POST['nlev'];
										$naren = $_POST['naren'];
										$nhonor = $_POST['nhonor'];
										$idch = $_POST['id'];
					mysql_select_db($characters,$connexion);
					mysql_query("UPDATE characters SET level='$nlev',arenaPoints='$naren',totalHonorPoints='$nhonor' WHERE guid='$idch'") OR DIE("Erreur lors de la modification du compte");
					echo "Le personnage a &eacute;t&eacute; modifi&eacute; avec succ&egrave;s.<meta http-equiv='refresh' content='3;url=membre.php' />";
					break;
					
										case "modacc":
										$gmlev = $_POST['gmlev'];
										$newmail = $_POST['modemail'];
										$newexp = $_POST['exp'];
										$idacc = $_POST['id'];
					mysql_select_db($realmd,$connexion);
					mysql_query("UPDATE account SET gmlevel='$gmlev',email='$newmail',expansion='$newexp' WHERE username='$idacc'") OR DIE("Erreur lors de la modification du compte");
					echo "Le compte a &eacute;t&eacute; modifi&eacute; avec succ&egrave;s.<meta http-equiv='refresh' content='3;url=membre.php' />";
					break;
					
					case "item":
					echo'<a href="admin.php?action=weapon"><font color=white>[Ajouter des armes]</font></a><br />
					<a href="admin.php?action=armor"><font color=white>[Ajouter des armures]</font></a><br />
					<a href="admin.php?action=other"><font color=white>[Ajouter des objets divers]</font></a><br><br><a href="admin.php">Retour</a>
					';
					break;
					
					case "news":
					echo'<form method="post" action="admin.php?action=nnews">
					&Eacute;crire les news: <br><textarea name=nnew></textarea><br><input type=submit value=Envoyer><br><br><a href="admin.php">Retour</a>';
					break;
					
					case "nnews":
                    $fichier = fopen('index.php', 'w+');
					$config = '<?php include "core/menu.php";
session_start();
error_reporting(0);
htmlspecialchars($input);
addslashes($input);?>		
<h1><?php
if(file_exists("config/config.php"))
				{
		include "config/config.php";
echo "$serveur"; 
echo "</h1>'.$_POST['nnew'].'<br>
<br><br></center>            </div>
            <div id=\'contenu_b\'></div>
    </div>
        <div id=\'menu-v\'>
				<hr />";
				}
else 
{
			echo"<script language=\'JavaScript\'>
	window.location.href=\'install.php\'
	//-->
	</script>";
}
?>
<?php include "core/menud.php" ?>
<?php include "core/end.php" ?>';
fwrite($fichier, $config);
fclose($fichier);
echo 'Les news ont &eacute;t&eacute; modifi&eacute;es.<meta http-equiv="refresh" content="3;url=admin.php" /';
					break;
					
										case "staff":
					echo'<form method="post" action="admin.php?action=nnews">
					Modifier le staff: <br><br>
					Administrateur:<br> <input type=text name=admin><br><br>
					Developpeur:<br> -<input type=text name=dev1><br>
								-<input type=text name=dev2><br>
					<br>Maitre de jeu:<br> -<input type=text name=mj1><br>			            
								-<input type=text name=mj2><br>
								-<input type=text name=mj3><br>
								-<input type=text name=mj4><br>
								
					<br>Mod&eacute;rateur / animateur:<br> -<input type=text name=modo><br><br>
					<input type=submit value=Envoyer><br><br><a href="admin.php">Retour</a>';
					break;
					
					case "delitem":
					echo'<a href="admin.php?action=delweapon"><font color=white>[Supprimer des armes]</font></a><br />
					<a href="admin.php?action=delarmor"><font color=white>[Supprimer des armures]</font></a><br />
					<a href="admin.php?action=delother"><font color=white>[Supprimer des objets divers]</font></a><br><br><a href="admin.php">Retour</a>';
					break;
					
					case "delevel":
					echo'<center><form method="POST" action="admin.php?action=dlvl">
	
						  <SELECT NAME="level">';
					mysql_select_db($site,$connexion);
	$result = mysql_query("SELECT * FROM `level`") or die("Erreur SQL");
	while ($datal = mysql_fetch_array($result))
	{
		echo "<OPTION VALUE='".$datal[id]."'> ".$datal[name]."  </option>";
	}
	echo'</SELECT><br /><br />
	<input type="submit" value="Supprimer" /><br />
	</form>
	<br><br><center><a href="admin.php">Retour</a></center>';
	break;
	
	case "delother":
					echo'<center><form method="POST" action="admin.php?action=doth">
	
						  <SELECT NAME="other">';
					mysql_select_db($site,$connexion);
	$result = mysql_query("SELECT * FROM `divers`") or die("Erreur SQL");
	while ($datal = mysql_fetch_array($result))
	{
		echo "<OPTION VALUE='".$datal[id]."'> ".$datal[name]."  </option>";
	}
	echo'</SELECT><br /><br />
	<input type="submit" value="Supprimer" /><br />
	</form>
	<center><a href="admin.php">Retour</a></center>';
	break;
	
						case "delmoney":
					echo'<center><form method="POST" action="admin.php?action=dmon">
	
						  <SELECT NAME="money">';
					mysql_select_db($site,$connexion);
	$result = mysql_query("SELECT * FROM `money`") or die("Erreur SQL");
	while ($datal = mysql_fetch_array($result))
	{
		echo "<OPTION VALUE='".$datal[id]."'> ".$datal[name]."  </option>";
	}
	echo'</SELECT><br /><br />
	<input type="submit" value="Supprimer" /><br />
	</form>
	<br><br><center><a href="admin.php">Retour</a></center>';
	break;
	
							case "delarmor":
					echo'<center><form method="POST" action="admin.php?action=darm">
	
						  <SELECT NAME="armor">';
					mysql_select_db($site,$connexion);
	$result = mysql_query("SELECT * FROM `armor`") or die("Erreur SQL");
	while ($datal = mysql_fetch_array($result))
	{
		echo "<OPTION VALUE='".$datal[id]."'> ".$datal[name]."  </option>";
	}
	echo'</SELECT><br /><br />
	<input type="submit" value="Supprimer" />
	</form>
	<br><center><a href="admin.php">Retour</a></center>';
	break;
	
	case "delweapon":
					echo'<center><form method="POST" action="admin.php?action=dweap">
	
						  <SELECT NAME="weapon">';
					mysql_select_db($site,$connexion);
	$result = mysql_query("SELECT * FROM `weapon`") or die("Erreur SQL");
	while ($datal = mysql_fetch_array($result))
	{
		echo "<OPTION VALUE='".$datal[id]."'> ".$datal[name]."  </option>";
	}
	echo'</SELECT><br /><br />
	<input type="submit" value="Supprimer" />
	</form>
	<br><center><a href="admin.php">Retour</a></center>';
	break;
	
	
					
					case "weapon":
					echo'<a href="admin.php?action=onehand"><font color=white>[Armes a une main]</font></a><br />
					<a href="admin.php?action=twohands"><font color=white>[Armes a deux mains]</font></a><br />
					<a href="admin.php?action=ranged"><font color=white>[Armes a distance]</font></a><br />
					<a href="admin.php?action=shield"><font color=white>[Boucliers]</font></a><br />
					';
					break;
					
					case "armor":
					echo'<form method="POST" action="admin.php?action=addarmor">
					Nom : <input type=text name=name><br />
					ID de l\'item : <input type=text name=item><br />
					Prix : <input type=text name=prix><br />
					Type : <select name="type">
											<option value="1">Armures en plaques</font></option>
											<option value="2">Armures en mailles</option>
											<option value="3">Armures en cuir</option>
											<option value="4">Armures en tissu</option>
											<option value="5">Joaillerie et capes</option>
										</select><br /><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
										case "other":
					echo'<form method="POST" action="admin.php?action=addother">
					Nom : <input type=text name=name><br />
					ID de l\'item : <input type=text name=item><br />
					Prix : <input type=text name=prix><br />
					Type : <select name="type">
											<option value="3">Montures</font></option>
											<option value="2">Compagnons</option>
										</select><br /><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
					case "onehand":
					echo'<form method="POST" action="admin.php?action=addonehand">
					Nom : <input type=text name=name><br />
					ID de l\'item : <input type=text name=item><br />
					Prix : <input type=text name=prix><br />
					Type : <select name="type">
											<option value="1">Haches a une main</font></option>
											<option value="2">Masses a une main</option>
											<option value="3">Epees a une main</option>
											<option value="4">Dagues</option>
										</select><br /><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
					case "twohands":
					echo'<form method="POST" action="admin.php?action=addtwohands">
					Nom : <input type=text name=name><br />
					ID de l\'item : <input type=text name=item><br />
					Prix : <input type=text name=prix><br />
					Type : <select name="type">
											<option value="1">Haches a deux mains</font></option>
											<option value="2">Masses a deux mains</option>
											<option value="3">Epees a deux mains</option>
											<option value="4">Batons</option>
										</select><br /><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
					case "ranged":
					echo'<form method="POST" action="admin.php?action=addranged">
					Nom : <input type=text name=name><br />
					ID de l\'item : <input type=text name=item><br />
					Prix : <input type=text name=prix><br />
					Type : <select name="type">
											<option value="1">Arcs</font></option>
											<option value="2">Arbal&egrave;tes</option>
											<option value="3">Armes a feu</option>
											<option value="4">Armes de jet</option>
											<option value="5">Baguettes</option>
										</select><br /><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
					case "shield":
					echo'<form method="POST" action="admin.php?action=addshield">
					Nom : <input type=text name=name><br />
					ID de l\'item : <input type=text name=item><br />
					Prix : <input type=text name=prix><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
						case "addonehand":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM weapon ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$name = $_POST['name'];
$item = $_POST['item'];
$price = $_POST['prix'];
$type = $_POST['type'];
			mysql_query("INSERT INTO weapon VALUES ('$lod', '$name ($price points)', '$item', 1 ,'$price','$type')");
			echo "<center><h3>Les armes ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
					
					case "addother":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM divers ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$name = $_POST['name'];
$item = $_POST['item'];
$price = $_POST['prix'];
$type = $_POST['type'];
			mysql_query("INSERT INTO weapon VALUES ('$lod', '$name ($price points)', '$item', 1 ,'$price','$type')");
			echo "<center><h3>Les objets ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
					
							case "addtwohands":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM weapon ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$name = $_POST['name'];
$item = $_POST['item'];
$price = $_POST['prix'];
$type = $_POST['type'];
			mysql_query("INSERT INTO weapon VALUES ('$lod', '$name ($price points)', '$item', 2 ,'$price','$type')");
			echo "<center><h3>Les armes ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
					
																				case "addranged":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM weapon ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$name = $_POST['name'];
$item = $_POST['item'];
$price = $_POST['prix'];
$type = $_POST['type'];
			mysql_query("INSERT INTO weapon VALUES ('$lod', '$name ($price points)', '$item', 3 ,'$price','$type')");
			echo "<center><h3>Les armes ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
					
																				case "addshield":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM weapon ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$name = $_POST['name'];
$item = $_POST['item'];
$price = $_POST['prix'];
			mysql_query("INSERT INTO weapon VALUES ('$lod', '$name ($price points)', '$item', 5 ,'$price',1)");
			echo "<center><h3>Les boucliers ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
					
										case "addarmor":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM armor ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$name = $_POST['name'];
$item = $_POST['item'];
$price = $_POST['prix'];
$type = $_POST['type'];
			mysql_query("INSERT INTO armor VALUES ('$lod', '$name ($price points)', '$item', '$type','$price')");
			echo "<center><h3>Les armures ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
					
					case "level":
					echo'<form method="POST" action="admin.php?action=addl">
					Niveau : <input type=num name=level><br />
					Prix : <input type=text name=prix><br /><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
					case "addl":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM level ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$level = $_POST['level'];
$price = $_POST['prix'];
			mysql_query("INSERT INTO level VALUES ('$lod', 'Niveau $level ($price points)', '$level', '$price')");
			echo "<center><h3>Les niveaux ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
					
					case "dlvl":
		mysql_select_db($site,$connexion) or die(mysql_error());
$datalid = $_POST['level'];
			mysql_query("DELETE FROM level WHERE id='$datalid'");
			echo "<center><h3>Les niveaux ont ete supprimes de la boutique ! <meta http-equiv='refresh' content='3;url=membre.php' /></h3></center>";
					break;
					
					case "dmon":
		mysql_select_db($site,$connexion) or die(mysql_error());
$datalid = $_POST['money'];
			mysql_query("DELETE FROM money WHERE id='$datalid'");
			echo "<center><h3>Les pieces d\'or ont ete supprimees de la boutique ! <meta http-equiv='refresh' content='3;url=membre.php' /></h3></center>";
					break;
					
					case "darm":
		mysql_select_db($site,$connexion) or die(mysql_error());
$datalid = $_POST['armor'];
			mysql_query("DELETE FROM armor WHERE id='$datalid'");
			echo "<center><h3>Les armures ont ete supprimees de la boutique ! <meta http-equiv='refresh' content='3;url=membre.php' /></h3></center>";
					break;
					
					case "dweap":
		mysql_select_db($site,$connexion) or die(mysql_error());
$datalid = $_POST['weapon'];
			mysql_query("DELETE FROM weapon WHERE id='$datalid'");
			echo "<center><h3>Les armes ont ete supprimees de la boutique ! <meta http-equiv='refresh' content='3;url=membre.php' /></h3></center>";
					break;
					
					case "doth":
		mysql_select_db($site,$connexion) or die(mysql_error());
$datalid = $_POST['other'];
			mysql_query("DELETE FROM divers WHERE id='$datalid'");
			echo "<center><h3>Les objets ont ete supprimes de la boutique ! <meta http-equiv='refresh' content='3;url=membre.php' /></h3></center>";
					break;
					
										case "money":
					echo'<form method="POST" action="admin.php?action=addm">
					Argent (Pieces d\'or) : <input type=num name=money><br />
					Prix : <input type=text name=prix><br /><br />
						<input type=submit value=Envoyer name=submit><br><br><center><a href="admin.php">Retour</a></center>
					';
					break;
					
					case "addm":
		mysql_select_db($site,$connexion) or die(mysql_error());
		$lol = mysql_query("SELECT * FROM money ORDER BY id DESC LIMIT 1");
$lo = mysql_fetch_assoc($lol);
$lod = $lo["id"] + 1;
$mon = $_POST['money'];
$money = $mon * 10000;
$price = $_POST['prix'];
			mysql_query("INSERT INTO money VALUES ('$lod', '$mon po ($price points)', '$money', '$price')");
			echo "<center><h3>Les niveaux ont &eacute;t&eacute; ajout&eacute;s a la boutique !</h3></center><meta http-equiv=refresh content=3;url=admin.php />";
					break;
}
}
else echo 'Vous n\'etes pas autorise a acceder a cette partie.<meta http-equiv="refresh" content="3;url=membre.php" />';
}
?>
</div>
					</div>
					<div class="spacer"></div>
				</div>
			</div>

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