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,105 @@
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
+<html>
9
+<head>
10
+<title>Ville de Dragons</title>
11
+<link rel='stylesheet' href='Style.css' type='text/css'>
12
+</head>
13
+<body>
14
+<?php
15
+	AfficheBarreDEtat(0);
16
+?>
17
+<table border="0" height="100%" width="100%">
18
+	<tr>
19
+	<td valign="center">
20
+	<table border="0" cellspacing="0" cellpadding="0" align="center">
21
+		<tr>
22
+			<td width="700" height="500">
23
+			<table border="0" cellspacing="0" cellpadding="0" align="center">
24
+				<tr>
25
+					<td background="images/bordure_01.gif" width="14" height="19">
26
+					</td>
27
+					<td background="images/bordure_02.gif" width="541" height="19">
28
+					</td>
29
+					<td background="images/bordure_03.gif" width="14" height="19">
30
+					</td>
31
+				</tr>
32
+				<tr>
33
+					<td background="images/bordure_04.gif" width="14" height="400">
34
+					</td>
35
+					<td width="541" height="400" align="center" valign="center">
36
+						<?php
37
+						echo "<table background='images/dessins/T_Tableau.jpg' border='0' height='400' width='541' bgcolor='#FFFFFF'>"
38
+							."<tr>"
39
+							."<td valign ='top' align='center'>"
40
+							."<table border='0' height='100%' width='350'>"
41
+							."<tr>"
42
+							."<td class='tableau' valign ='top' align='left'>";
43
+							if($_SESSION['tableauEcrit']==0){
44
+								//commande pour pouvoir �crire dans le tableau
45
+								echo "<br><br><form method='get' action='TraitementTableau.php'>"
46
+									."<span class='tableauTitre'>Tu veux inscrire quelquechose?</span>"
47
+									.":<input type='text' name='corps' size='25'>:"
48
+									."<input type='submit' value='Ecrire!'><br>"
49
+									."</form>";
50
+							}
51
+							//commande pour afficher les 30 dernier messages du gueuloir
52
+							$sql = 'SELECT * FROM tableau ORDER BY id DESC'; 
53
+							$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); 
54
+							$i=0;
55
+							 if($_SESSION['tableauEcrit']!=0){
56
+							 echo "<br><br>";
57
+							 }	
58
+							 //boucle d'affichage des messages du tableau
59
+							 while($data = mysql_fetch_assoc($req)){ 
60
+							 $i++;
61
+							 //commande pour transformer les chaines de caract�res en chaine html affichable
62
+							 $data['pseudo'] = HTML_ChaineDeCaracteres($data['pseudo']);
63
+							 $data['text'] = HTML_ChaineDeCaracteres ($data['text']);
64
+							 echo $data['pseudo']."&nbsp";
65
+							 echo "<span class='tableauHoraire'>".$data['heure'].":&nbsp</span>";
66
+							 echo $data['text']."<br>"; 
67
+							if($i==30){
68
+							 echo "<align='left'>.....";
69
+							 break;
70
+							 }
71
+							 }
72
+						echo "</td></tr>"
73
+							."</table>"
74
+							."</td></tr>"
75
+							."</table>";
76
+						?>
77
+					</td>
78
+					<td background="images/bordure_06.gif" width="14" height="400">
79
+					</td>
80
+				</tr>
81
+				<tr>
82
+					<td background="images/bordure_07.gif" width="14" height="18">
83
+					</td>
84
+					<td background="images/bordure_08.gif" width="541" height="18">
85
+					</td>
86
+					<td background="images/bordure_09.gif" width="14" height="18">
87
+					</td>
88
+				</tr>
89
+				<tr>
90
+					<td align ='right' colspan='3'>
91
+					<a href='taverne.php?DejaEntre=1'>Retour</a>
92
+					</td>
93
+				</tr>
94
+			</table>
95
+			</td>
96
+		</tr>
97
+	</table>
98
+	</td>
99
+	</tr>
100
+</table>
101
+</body>
102
+</html>
103
+<?php
104
+	mysql_close();
105
+?>
0 106
\ No newline at end of file