FicheDEtat.php
4a503405
 <?php
 //creation de la session ... inclusion du code ... verification de la session connect�e...
 session_start();
 include ('fonctions.php');
 check_session();
 include ('fonctionsDenTete.php');
 
 //creation de la variable contenant l'image a afficher
 	$poids = $_SESSION['Poids'];
 	$sexe = $_SESSION['Sexe'];
 	if($sexe==1){
 		$image = $poids;
 	}else{
 		$image = 5+$poids;
 	}
 //creation de la variable contena tle denomination du poids du personnage
 switch($poids){
 	case 0:
 		$poidsTxt = "poids plume";
 	break;
 	case 1:
 		$poidsTxt = "l�g�re";
 	break;
 	case 2:
 		$poidsTxt = "moyenne";
 	break;
 	case 3:
 		$poidsTxt = "lourde";
 	break;
 	case 4:
 		$poidsTxt = "poids lourd";
 	break;
 }
 //creation de la variable contenant la denomination de l'heure la journ�e
 switch($_SESSION['repas']){
 	case 0:
 		$heureJournee = "Aube";
 	break;
 	case 1:
 		$heureJournee = "Matin�e";
 	break;
 	case 2:
 		$heureJournee = "Apr�s-midi";
 	break;
 	case 3:
 		$heureJournee = "Soir�e";
 	break;
 }
 //la page prec�dente..
 	if(!isset($_GET['pageprecedente'])){
 		$pageprecedente = $_SERVER['HTTP_REFERER'];
 		if(strpos($_SERVER['HTTP_REFERER'],'?') === FALSE){
 			$pageprecedente .= "?etat=1";
 		}else{
 			if(strpos($_SERVER['HTTP_REFERER'],'etat=1') === FALSE){
 				$pageprecedente .= "&etat=1";
 			}else{
 				$pageprecedente = $_SERVER['HTTP_REFERER'];		
 			}
 		}
 	}else{
 		$pageprecedente=$_GET['pageprecedente'];
 		if(strpos($_GET['pageprecedente'],'?') === FALSE){
 			$pageprecedente .= "?etat=1";
 		}else{
 			if(strpos($_GET['pageprecedente'],'etat=1') === FALSE){
 				$pageprecedente .= "&etat=1";
 			}
 		}
 	}
 //recherche des images des equipements:
 			//sur le corps
 	$req = "SELECT image FROM corps WHERE id_corps='".$_SESSION['corps']."'";
 	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
 	$tableauReponse=mysql_fetch_assoc($resultat);
 	$imageCorps = $tableauReponse['image'];
 			//sur les jambes
 	$req = "SELECT image FROM jambes WHERE id_jambes='".$_SESSION['jambes']."'";
 	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
 
 	$tableauReponse=mysql_fetch_assoc($resultat);
 	$imageJambes = $tableauReponse['image'];
 			//sur la main Droite
 	$req = "SELECT image FROM maindroite WHERE id_maindroite='".$_SESSION['mainDroite']."'";
 	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
 
 	$tableauReponse=mysql_fetch_assoc($resultat);
 	$imageArme = $tableauReponse['image'];
 			//sur la main gauche
 	$req = "SELECT image FROM maingauche WHERE id_maingauche='".$_SESSION['mainGauche']."'";
 	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
 
 	$tableauReponse=mysql_fetch_assoc($resultat);
 	$imageBouclier = $tableauReponse['image'];
 		//sur les mains
 	$req = "SELECT image FROM mains WHERE id_mains='".$_SESSION['mains']."'";
 	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
 
 	$tableauReponse=mysql_fetch_assoc($resultat);
 	$imageMains = $tableauReponse['image'];
 			//sur les pieds
 	$req = "SELECT image FROM pieds WHERE id_pieds='".$_SESSION['pieds']."'";
 	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
 
 	$tableauReponse=mysql_fetch_assoc($resultat);
 	$imagePieds = $tableauReponse['image'];
 			//sur la tete
 	$req = "SELECT image FROM tete WHERE id_tete='".$_SESSION['tete']."'";
 	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
 
 	$tableauReponse=mysql_fetch_assoc($resultat);
 	$imageTete = $tableauReponse['image'];
 			//sac
 	$sac = $_SESSION['sac'];
 
 
 ?>
 <html>
 <head>
 <title>Ville de Dragons</title>
 <link rel='stylesheet' href='Style.css' type='text/css'>
 </head>
 <body>
 <?php
 	AfficheBarreDEtat(1);
 ?>
 <table border="0" height="100%" width="100%">
 	<tr>
 	<td valign="center">
 
 	<table border="0" cellspacing="0" cellpadding="0" align="center">
 		<tr>
 		<td width="400">
 		<center><h2><b><u>Fiche D'Etat</b></u></h2></center>
 	<?php
 	//affichage des caracteristiques
 		echo "	<table border = '0'>"
 			."<tr>"
 			."<td><b>Niveau:</b></td><td colspan=2 width='200' align='center'>".$_SESSION['Niveau']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td><b>Heure de la Journ�e:</b><BR>&nbsp</td><td colspan=2 width='200' align='center'>".$heureJournee."<BR>&nbsp</td>"
 			."</tr>"
 			."<tr>"
 			."<td align='right'><b>Force:</b></td><td align='center' widht='20'>".$_SESSION['For']."</td><td align='left'>+ ".	$_SESSION['Aug_For']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td align='right'><b>Dexterit�:</b></td><td align='center' widht='20'>".$_SESSION['Dex']."</td><td align='left'>+ ".	$_SESSION['Aug_Dex']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td align='right'><b>Vitalit�:</b></td><td align='center' widht='20'>".$_SESSION['Vit']."</td><td align='left'>+ ".	$_SESSION['Aug_Vit']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td align='right'><b>Intelligence:</b></td><td align='center' widht='20'>".$_SESSION['Int']."</td><td align='left'>+ ".	$_SESSION['Aug_Int']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td align='right'><b>Sagesse:</b></td><td align='center' widht='20'>".$_SESSION['Sag']."</td><td align='left'>+ ".	$_SESSION['Aug_Sag']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td align='right'><b>Charisme:</b></td><td align='center' widht='20'>".$_SESSION['Cha']."</td><td align='left'>+ ".	$_SESSION['Aug_Cha']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td><b>&nbsp<BR>Corpulence:</b></td><td align='center' colspan=2> &nbsp <BR>".$poidsTxt."</td>"
 			."</tr>"
 			."<tr>"
 			."<td><b>Indice d'Ivresse:</b></td><td align='center' colspan=2 >".$_SESSION['biereBu']."</td>"
 			."</tr>"
 			."<tr>"
 			."<td><b>Nb de jours pass�s:</b></td><td align='center' colspan=2 >".$_SESSION['Age']." jours.</td>"
 			."</tr>"
 			."<tr>"
 			."<td colspan=3 >&nbsp</td>"
 			."</tr>"
 			."<tr>"
 			."<td colspan=3 align = 'center'><b>EXPERIENCE: </b>".$_SESSION['xp']."/".$_SESSION['xpMax'];
 			AfficheImgBarre(2,$_SESSION['xp'],$_SESSION['xpMax']);
 			echo "</td>"
 			."</tr>"
 		."</table>";
 
 		echo "<br><br><table border='0'><tr><td width='350px'><a href='FicheDEquipement.php?pageprecedente=".$pageprecedente."'>Equipement de ".$_SESSION['Prenom']."</a>"
 			."<br><a href='FicheDHistoire.php?pageprecedente=".$pageprecedente."'>Histoire de ".$_SESSION['Prenom']."</a>"
 			."<br><a href='FicheDPreference.php?pageprecedente=".$pageprecedente."'>Pr�f�rence de "
 			.$_SESSION['Prenom']."</a>";
 		if($sac>0){
 			echo "<br><a href='FicheDSac.php?pageprecedente=".$pageprecedente."'>Sac de ".$_SESSION['Prenom']."</a>";
 		}
 		echo "</td><td><a href='".$pageprecedente."'>Retour</a></td></tr></table>";
 	?>
 			</td>
 			<td width="300">
 			<table border="0" cellspacing="0" cellpadding="0" align="center">
 				<tr>
 					<td background="images/bordure_01.gif" width="14" height="19">
 					</td>
 					<td background="images/bordure_02.gif" width="209" height="19">
 					</td>
 					<td background="images/bordure_03.gif" width="14" height="19">
 					</td>
 				</tr>
 				<tr>
 					<td background="images/bordure_04.gif" width="14" height="310">
 					</td>
 					<td width="209" height="310px" align="center" valign="center">
 						<?php
 							echo "<div style='position:relative;top:0;left:0'><img src='images/dessins/Perso".$image.".jpg' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageTete.$sexe.".png' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageCorps.$sexe.".png' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:188;left:450'><img src='images/dessins/".$imageJambes.$sexe.".png' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imagePieds.$sexe.".png' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageArme.$sexe.".png' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/sac".$sac.".png' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageMains.$sexe.".png' border ='0' width='209' height='310'></div>";
 							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageBouclier.$sexe.".png' border ='0' width='209' height='310'></div>";
 						?>
 					</td>
 					<td background="images/bordure_06.gif" width="14" height="310">
 					</td>
 				</tr>
 				<tr>
 					<td background="images/bordure_07.gif" width="14" height="18">
 					</td>
 					<td background="images/bordure_08.gif" width="209" height="18">
 					</td>
 					<td background="images/bordure_09.gif" width="14" height="18">
 					</td>
 				</tr>
 			</table>
 			</td>
 		</tr>
 	</table>
 	</td>
 	</tr>
 </table>
 </body>
 </html>
 <?php
 	mysql_close()
 ?>