-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublication.php
More file actions
98 lines (77 loc) · 2.75 KB
/
publication.php
File metadata and controls
98 lines (77 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
session_start();
// Connexion à la base de données
include("bdd/identifiants.php");
// Récupération des 10 derniers messages
$reponse_publi = $bdd->query('SELECT m.nom nom, m.prenom prenom, p.message message, p.type_langage type_langage, p.id_publi id_publi FROM FC_LALOY_membre m INNER JOIN FC_LALOY_publication p ON p.id_membre=m.id_membre ORDER BY id_publi DESC LIMIT 0, 10');
?><!DOCTYPE html>
<html>
<head>
<?php
include("raccourcis/link_header.php");
?>
<title>Publications de programmes</title>
</head>
<body>
<?php
include("raccourcis/header.php");
?>
<div class="affichage">
<div class="content">
<div class="programme">
<br/>
<h1>Liste 10 dernières publications :</h1>
<div>
<a href="publication_tot.php">Pour voir toutes les publications !</a>
</div>
<?php while ($donnees_publi = $reponse_publi->fetch())
{ ?>
<div>
<strong><span>Par <?php echo htmlspecialchars($donnees_publi['nom']);?> <?php echo htmlspecialchars($donnees_publi['prenom']);?>, en <?php echo htmlspecialchars($donnees_publi['type_langage']);?></span></strong>
<br/>
<label> <br/> <?php echo htmlspecialchars($donnees_publi['message']);?></label>
<br/>
</div>
<?php $reponse_comments = $bdd->query('SELECT m.nom nom, m.prenom prenom, c.commentaire commentaire, c.id_publi id_publi FROM FC_LALOY_membre m INNER JOIN FC_LALOY_comments c ON c.id_membre=m.id_membre WHERE id_publi='.$donnees_publi['id_publi'].' ORDER BY id_comments');
while ($donnees_comments = $reponse_comments->fetch())
{ ?>
<div>
<p>Commentaires de <?php echo htmlspecialchars($donnees_comments['nom']);?> <?php echo htmlspecialchars($donnees_comments['prenom']);?></p>
<br/>
<h2><?php echo htmlspecialchars($donnees_comments['commentaire']);?></h2>
<br/>
</div>
<?php }
if(isset($_SESSION['id'])){ ?>
<form method="POST" action="bdd/readcomment_bdd.php?id_publi=<?php echo $donnees_publi['id_publi'];?>">
<table style="border:0px; padding:0px; margin:0px;">
<tr>
<td>
Postes-ton commentaire !
<br/>
<textarea cols="80" rows="10" name="msg" placeholder="commentaire"></textarea>
</td>
</tr>
<tr>
<td>
<input type="submit" name="readcomment" value="Poster" />
</td>
</tr>
</table>
</form>
<?php }
if(isset($erreur)) {
echo '<font color="red">'.$erreur."</font>";
}
} ?>
</div>
</div>
<?php
include("raccourcis/footer.php");
?>
</div>
</body>
</html>
<?php
$reponse_publi->closeCursor();
?>