Browse code

Version initiale du programme sous forme de boucle conditionnelle

Emmanuel ROY authored on 01/05/2022 12:54:29
Showing 1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,180 @@
1
+<?php
2
+//creation de la session ... inclusion du code ... verification de la session connect�e...
3
+session_start();
4
+include ('fonctions.php');
5
+check_session();
6
+include ('fonctionsDenTete.php');
7
+
8
+//creation de la variable contenant l'image a afficher
9
+	$poids = $_SESSION['Poids'];
10
+	$sexe = $_SESSION['Sexe'];
11
+	if($sexe==1){
12
+		$image = $poids;
13
+	}else{
14
+		$image = 5+$poids;
15
+	}
16
+//la page prec�dente..
17
+	$pageprecedente=$_GET['pageprecedente'];
18
+	if(strpos($_GET['pageprecedente'],'?') === FALSE){
19
+		$pageprecedente .= "?etat=1";
20
+	}else{
21
+		if(strpos($_GET['pageprecedente'],'etat=1') === FALSE){
22
+			$pageprecedente .= "&etat=1";
23
+		}
24
+	}
25
+//recherche des images des equipements:
26
+			//sur le corps
27
+	$req = "SELECT image FROM corps WHERE id_corps='".$_SESSION['corps']."'";
28
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
29
+	$tableauReponse=mysql_fetch_assoc($resultat);
30
+	$imageCorps = $tableauReponse['image'];
31
+			//sur les jambes
32
+	$req = "SELECT image FROM jambes WHERE id_jambes='".$_SESSION['jambes']."'";
33
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
34
+
35
+	$tableauReponse=mysql_fetch_assoc($resultat);
36
+	$imageJambes = $tableauReponse['image'];
37
+			//sur la main Droite
38
+	$req = "SELECT image FROM maindroite WHERE id_maindroite='".$_SESSION['mainDroite']."'";
39
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
40
+
41
+	$tableauReponse=mysql_fetch_assoc($resultat);
42
+	$imageArme = $tableauReponse['image'];
43
+			//sur la main gauche
44
+	$req = "SELECT image FROM maingauche WHERE id_maingauche='".$_SESSION['mainGauche']."'";
45
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
46
+
47
+	$tableauReponse=mysql_fetch_assoc($resultat);
48
+	$imageBouclier = $tableauReponse['image'];
49
+		//sur les mains
50
+	$req = "SELECT image FROM mains WHERE id_mains='".$_SESSION['mains']."'";
51
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
52
+
53
+	$tableauReponse=mysql_fetch_assoc($resultat);
54
+	$imageMains = $tableauReponse['image'];
55
+			//sur les pieds
56
+	$req = "SELECT image FROM pieds WHERE id_pieds='".$_SESSION['pieds']."'";
57
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
58
+
59
+	$tableauReponse=mysql_fetch_assoc($resultat);
60
+	$imagePieds = $tableauReponse['image'];
61
+			//sur la tete
62
+	$req = "SELECT image FROM tete WHERE id_tete='".$_SESSION['tete']."'";
63
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
64
+
65
+	$tableauReponse=mysql_fetch_assoc($resultat);
66
+	$imageTete = $tableauReponse['image'];
67
+			//sac
68
+	$sac = $_SESSION['sac'];
69
+
70
+?>
71
+<html>
72
+<head>
73
+<title>Ville de Dragons</title>
74
+<link rel='stylesheet' href='Style.css' type='text/css'>
75
+</head>
76
+<body>
77
+<?php
78
+	AfficheBarreDEtat(1);
79
+?>
80
+<table border="0" height="100%" width="100%">
81
+	<tr>
82
+	<td valign="center">
83
+
84
+	<table border="0" cellspacing="0" cellpadding="0" align="left">
85
+		<tr>
86
+		<td width="400">
87
+		<center><h2><b><u>Fiche De Pr�f�rence Gastronomique</b></u></h2></center>
88
+	<?php
89
+	//affichage des objets
90
+		echo "<table border='0' cellspacing='0' align='center'>"
91
+			."<tr>"
92
+			."<td width='300' align='center'><b>Fruits: </b>".$_SESSION['N_pomme']."/100";
93
+			AfficheImgBarre(2,$_SESSION['N_pomme'],100);
94
+			echo "</td>"
95
+			."</tr>"
96
+			."<tr>"
97
+			."<td width='300' align='center'><b>Prot�ines: </b>".$_SESSION['N_viandeSeche']."/100";
98
+			AfficheImgBarre(2,$_SESSION['N_viandeSeche'],100);
99
+			echo "</td>"
100
+			."</tr>"
101
+			."<tr>"
102
+			."<td width='300' align='center'><b>Agrumes: </b>".$_SESSION['N_orange']."/100";
103
+			AfficheImgBarre(2,$_SESSION['N_orange'],100);
104
+			echo "</td>"
105
+			."</tr>"
106
+			."<tr>"
107
+			."<td width='300' align='center'><b>F�culents: </b>".$_SESSION['N_pain']."/100";
108
+			AfficheImgBarre(2,$_SESSION['N_pain'],100);
109
+			echo "</td>"
110
+			."</tr>"
111
+			."<tr>"
112
+			."<td width='300' align='center'><b>Gourmandises: </b>".$_SESSION['N_chocolat']."/100";
113
+			AfficheImgBarre(2,$_SESSION['N_chocolat'],100);
114
+			echo "</td>"
115
+			."</tr>"
116
+			."<tr>"
117
+			."<td width='300' align='center'><b>Laitages: </b>".$_SESSION['N_lait']."/100";
118
+			AfficheImgBarre(2,$_SESSION['N_lait'],100)."</td>";
119
+			echo "</tr>"
120
+			."</table>";
121
+
122
+			echo "<br><br><table border='0'><tr><td width='350px'><a href='FicheDEtat.php?pageprecedente=".$pageprecedente."'>Etat de ".$_SESSION['Prenom']."</a>"
123
+				."<br><a href='FicheDHistoire.php?pageprecedente=".$pageprecedente."'>Histoire de ".$_SESSION['Prenom']."</a>"
124
+				."<br><a href='FicheDEquipement.php?pageprecedente=".$pageprecedente."'>Equipement de "
125
+				.$_SESSION['Prenom']."</a>";
126
+			if($sac>0){
127
+				echo "<br><a href='FicheDSac.php?pageprecedente=".$pageprecedente."'>Sac de ".$_SESSION['Prenom']."</a>";
128
+			}
129
+			echo "</td><td><a href='".$pageprecedente."'>Retour</a></td></tr></table>";
130
+	?>
131
+			</td>
132
+			<td width="300">
133
+			<table border="0" cellspacing="0" cellpadding="0" align="center">
134
+				<tr>
135
+					<td background="images/bordure_01.gif" width="14" height="19">
136
+					</td>
137
+					<td background="images/bordure_02.gif" width="209" height="19">
138
+					</td>
139
+					<td background="images/bordure_03.gif" width="14" height="19">
140
+					</td>
141
+				</tr>
142
+				<tr>
143
+					<td background="images/bordure_04.gif" width="14" height="310">
144
+					</td>
145
+					<td width="209" height="310" align="center" valign="center">
146
+						<?php
147
+							echo "<div style='position:relative;top:0;left:0'><img src='images/dessins/Perso".$image.".jpg' border ='0' width='209' height='310'></div>";
148
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageTete.$sexe.".png' border ='0' width='209' height='310'></div>";
149
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageCorps.$sexe.".png' border ='0' width='209' height='310'></div>";
150
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageJambes.$sexe.".png' border ='0' width='209' height='310'></div>";
151
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imagePieds.$sexe.".png' border ='0' width='209' height='310'></div>";
152
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageArme.$sexe.".png' border ='0' width='209' height='310'></div>";
153
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/sac".$sac.".png' border ='0' width='209' height='310'></div>";
154
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageMains.$sexe.".png' border ='0' width='209' height='310'></div>";
155
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageBouclier.$sexe.".png' border ='0' width='209' height='310'></div>";
156
+						?>
157
+					</td>
158
+					<td background="images/bordure_06.gif" width="14" height="310">
159
+					</td>
160
+				</tr>
161
+				<tr>
162
+					<td background="images/bordure_07.gif" width="14" height="18">
163
+					</td>
164
+					<td background="images/bordure_08.gif" width="209" height="18">
165
+					</td>
166
+					<td background="images/bordure_09.gif" width="14" height="18">
167
+					</td>
168
+				</tr>
169
+			</table>
170
+			</td>
171
+		</tr>
172
+	</table>
173
+	</td>
174
+	</tr>
175
+</table>
176
+</body>
177
+</html>
178
+<?php
179
+	mysql_close();
180
+?>