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,239 @@
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
+//creation de la variable contena tle denomination du poids du personnage
17
+switch($poids){
18
+	case 0:
19
+		$poidsTxt = "poids plume";
20
+	break;
21
+	case 1:
22
+		$poidsTxt = "l�g�re";
23
+	break;
24
+	case 2:
25
+		$poidsTxt = "moyenne";
26
+	break;
27
+	case 3:
28
+		$poidsTxt = "lourde";
29
+	break;
30
+	case 4:
31
+		$poidsTxt = "poids lourd";
32
+	break;
33
+}
34
+//creation de la variable contenant la denomination de l'heure la journ�e
35
+switch($_SESSION['repas']){
36
+	case 0:
37
+		$heureJournee = "Aube";
38
+	break;
39
+	case 1:
40
+		$heureJournee = "Matin�e";
41
+	break;
42
+	case 2:
43
+		$heureJournee = "Apr�s-midi";
44
+	break;
45
+	case 3:
46
+		$heureJournee = "Soir�e";
47
+	break;
48
+}
49
+//la page prec�dente..
50
+	if(!isset($_GET['pageprecedente'])){
51
+		$pageprecedente = $_SERVER['HTTP_REFERER'];
52
+		if(strpos($_SERVER['HTTP_REFERER'],'?') === FALSE){
53
+			$pageprecedente .= "?etat=1";
54
+		}else{
55
+			if(strpos($_SERVER['HTTP_REFERER'],'etat=1') === FALSE){
56
+				$pageprecedente .= "&etat=1";
57
+			}else{
58
+				$pageprecedente = $_SERVER['HTTP_REFERER'];		
59
+			}
60
+		}
61
+	}else{
62
+		$pageprecedente=$_GET['pageprecedente'];
63
+		if(strpos($_GET['pageprecedente'],'?') === FALSE){
64
+			$pageprecedente .= "?etat=1";
65
+		}else{
66
+			if(strpos($_GET['pageprecedente'],'etat=1') === FALSE){
67
+				$pageprecedente .= "&etat=1";
68
+			}
69
+		}
70
+	}
71
+//recherche des images des equipements:
72
+			//sur le corps
73
+	$req = "SELECT image FROM corps WHERE id_corps='".$_SESSION['corps']."'";
74
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
75
+	$tableauReponse=mysql_fetch_assoc($resultat);
76
+	$imageCorps = $tableauReponse['image'];
77
+			//sur les jambes
78
+	$req = "SELECT image FROM jambes WHERE id_jambes='".$_SESSION['jambes']."'";
79
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
80
+
81
+	$tableauReponse=mysql_fetch_assoc($resultat);
82
+	$imageJambes = $tableauReponse['image'];
83
+			//sur la main Droite
84
+	$req = "SELECT image FROM maindroite WHERE id_maindroite='".$_SESSION['mainDroite']."'";
85
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
86
+
87
+	$tableauReponse=mysql_fetch_assoc($resultat);
88
+	$imageArme = $tableauReponse['image'];
89
+			//sur la main gauche
90
+	$req = "SELECT image FROM maingauche WHERE id_maingauche='".$_SESSION['mainGauche']."'";
91
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
92
+
93
+	$tableauReponse=mysql_fetch_assoc($resultat);
94
+	$imageBouclier = $tableauReponse['image'];
95
+		//sur les mains
96
+	$req = "SELECT image FROM mains WHERE id_mains='".$_SESSION['mains']."'";
97
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
98
+
99
+	$tableauReponse=mysql_fetch_assoc($resultat);
100
+	$imageMains = $tableauReponse['image'];
101
+			//sur les pieds
102
+	$req = "SELECT image FROM pieds WHERE id_pieds='".$_SESSION['pieds']."'";
103
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
104
+
105
+	$tableauReponse=mysql_fetch_assoc($resultat);
106
+	$imagePieds = $tableauReponse['image'];
107
+			//sur la tete
108
+	$req = "SELECT image FROM tete WHERE id_tete='".$_SESSION['tete']."'";
109
+	$resultat = mysql_query($req)or exit('Erreur ' . mysql_errno() . ' : ' . mysql_error());
110
+
111
+	$tableauReponse=mysql_fetch_assoc($resultat);
112
+	$imageTete = $tableauReponse['image'];
113
+			//sac
114
+	$sac = $_SESSION['sac'];
115
+
116
+
117
+?>
118
+<html>
119
+<head>
120
+<title>Ville de Dragons</title>
121
+<link rel='stylesheet' href='Style.css' type='text/css'>
122
+</head>
123
+<body>
124
+<?php
125
+	AfficheBarreDEtat(1);
126
+?>
127
+<table border="0" height="100%" width="100%">
128
+	<tr>
129
+	<td valign="center">
130
+
131
+	<table border="0" cellspacing="0" cellpadding="0" align="center">
132
+		<tr>
133
+		<td width="400">
134
+		<center><h2><b><u>Fiche D'Etat</b></u></h2></center>
135
+	<?php
136
+	//affichage des caracteristiques
137
+		echo "	<table border = '0'>"
138
+			."<tr>"
139
+			."<td><b>Niveau:</b></td><td colspan=2 width='200' align='center'>".$_SESSION['Niveau']."</td>"
140
+			."</tr>"
141
+			."<tr>"
142
+			."<td><b>Heure de la Journ�e:</b><BR>&nbsp</td><td colspan=2 width='200' align='center'>".$heureJournee."<BR>&nbsp</td>"
143
+			."</tr>"
144
+			."<tr>"
145
+			."<td align='right'><b>Force:</b></td><td align='center' widht='20'>".$_SESSION['For']."</td><td align='left'>+ ".	$_SESSION['Aug_For']."</td>"
146
+			."</tr>"
147
+			."<tr>"
148
+			."<td align='right'><b>Dexterit�:</b></td><td align='center' widht='20'>".$_SESSION['Dex']."</td><td align='left'>+ ".	$_SESSION['Aug_Dex']."</td>"
149
+			."</tr>"
150
+			."<tr>"
151
+			."<td align='right'><b>Vitalit�:</b></td><td align='center' widht='20'>".$_SESSION['Vit']."</td><td align='left'>+ ".	$_SESSION['Aug_Vit']."</td>"
152
+			."</tr>"
153
+			."<tr>"
154
+			."<td align='right'><b>Intelligence:</b></td><td align='center' widht='20'>".$_SESSION['Int']."</td><td align='left'>+ ".	$_SESSION['Aug_Int']."</td>"
155
+			."</tr>"
156
+			."<tr>"
157
+			."<td align='right'><b>Sagesse:</b></td><td align='center' widht='20'>".$_SESSION['Sag']."</td><td align='left'>+ ".	$_SESSION['Aug_Sag']."</td>"
158
+			."</tr>"
159
+			."<tr>"
160
+			."<td align='right'><b>Charisme:</b></td><td align='center' widht='20'>".$_SESSION['Cha']."</td><td align='left'>+ ".	$_SESSION['Aug_Cha']."</td>"
161
+			."</tr>"
162
+			."<tr>"
163
+			."<td><b>&nbsp<BR>Corpulence:</b></td><td align='center' colspan=2> &nbsp <BR>".$poidsTxt."</td>"
164
+			."</tr>"
165
+			."<tr>"
166
+			."<td><b>Indice d'Ivresse:</b></td><td align='center' colspan=2 >".$_SESSION['biereBu']."</td>"
167
+			."</tr>"
168
+			."<tr>"
169
+			."<td><b>Nb de jours pass�s:</b></td><td align='center' colspan=2 >".$_SESSION['Age']." jours.</td>"
170
+			."</tr>"
171
+			."<tr>"
172
+			."<td colspan=3 >&nbsp</td>"
173
+			."</tr>"
174
+			."<tr>"
175
+			."<td colspan=3 align = 'center'><b>EXPERIENCE: </b>".$_SESSION['xp']."/".$_SESSION['xpMax'];
176
+			AfficheImgBarre(2,$_SESSION['xp'],$_SESSION['xpMax']);
177
+			echo "</td>"
178
+			."</tr>"
179
+		."</table>";
180
+
181
+		echo "<br><br><table border='0'><tr><td width='350px'><a href='FicheDEquipement.php?pageprecedente=".$pageprecedente."'>Equipement de ".$_SESSION['Prenom']."</a>"
182
+			."<br><a href='FicheDHistoire.php?pageprecedente=".$pageprecedente."'>Histoire de ".$_SESSION['Prenom']."</a>"
183
+			."<br><a href='FicheDPreference.php?pageprecedente=".$pageprecedente."'>Pr�f�rence de "
184
+			.$_SESSION['Prenom']."</a>";
185
+		if($sac>0){
186
+			echo "<br><a href='FicheDSac.php?pageprecedente=".$pageprecedente."'>Sac de ".$_SESSION['Prenom']."</a>";
187
+		}
188
+		echo "</td><td><a href='".$pageprecedente."'>Retour</a></td></tr></table>";
189
+	?>
190
+			</td>
191
+			<td width="300">
192
+			<table border="0" cellspacing="0" cellpadding="0" align="center">
193
+				<tr>
194
+					<td background="images/bordure_01.gif" width="14" height="19">
195
+					</td>
196
+					<td background="images/bordure_02.gif" width="209" height="19">
197
+					</td>
198
+					<td background="images/bordure_03.gif" width="14" height="19">
199
+					</td>
200
+				</tr>
201
+				<tr>
202
+					<td background="images/bordure_04.gif" width="14" height="310">
203
+					</td>
204
+					<td width="209" height="310px" align="center" valign="center">
205
+						<?php
206
+							echo "<div style='position:relative;top:0;left:0'><img src='images/dessins/Perso".$image.".jpg' border ='0' width='209' height='310'></div>";
207
+							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageTete.$sexe.".png' border ='0' width='209' height='310'></div>";
208
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imageCorps.$sexe.".png' border ='0' width='209' height='310'></div>";
209
+							echo "<div style='position:absolute;top:188;left:450'><img src='images/dessins/".$imageJambes.$sexe.".png' border ='0' width='209' height='310'></div>";
210
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/".$imagePieds.$sexe.".png' border ='0' width='209' height='310'></div>";
211
+							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageArme.$sexe.".png' border ='0' width='209' height='310'></div>";
212
+							echo "<div style='position:absolute;top:200;left:450'><img src='images/dessins/sac".$sac.".png' border ='0' width='209' height='310'></div>";
213
+							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageMains.$sexe.".png' border ='0' width='209' height='310'></div>";
214
+							echo "<div style='position:absolute;top:228;left:476'><img src='images/dessins/".$imageBouclier.$sexe.".png' border ='0' width='209' height='310'></div>";
215
+						?>
216
+					</td>
217
+					<td background="images/bordure_06.gif" width="14" height="310">
218
+					</td>
219
+				</tr>
220
+				<tr>
221
+					<td background="images/bordure_07.gif" width="14" height="18">
222
+					</td>
223
+					<td background="images/bordure_08.gif" width="209" height="18">
224
+					</td>
225
+					<td background="images/bordure_09.gif" width="14" height="18">
226
+					</td>
227
+				</tr>
228
+			</table>
229
+			</td>
230
+		</tr>
231
+	</table>
232
+	</td>
233
+	</tr>
234
+</table>
235
+</body>
236
+</html>
237
+<?php
238
+	mysql_close()
239
+?>