echo '<section id = "envoiVotes">'; echo '<form action = commentaire.php method="post">'; echo '<input type = "hidden" name = "idArticle" value = "' . $idArticle . '" >'; echo '<input type = "hidden" name = "tablePage" value = "' . $tablePage . '" >'; echo '<input type = "hidden" name = "votesEnvoi" value = "' . $votesEnvoi . '" >'; echo '<input type="submit" value="voter" />'; echo '</form>'; echo '</section>'; //système de commentaires require 'objets/ObjetCommentaire.php'; echo "</br>"; echo "</br>"; echo 'vos réactions'; //formulaire d ajout des commentaires $idArticle = $projet->id(); $idAuteur = $_SESSION['id']; echo "</br>"; echo "</br>"; //appel des commentaires $request1 = $bdd->query('SELECT * FROM ' . $tableCommentaire . ' c, ' . $tablePage . ' i WHERE c.idArticle = i.id ORDER BY datePost DESC LIMIT 0, 10'); while ($donneesCommentaires = $request1->fetch(PDO::FETCH_ASSOC)) { //affichage des commentaires $commentaire = new Commentaire($donneesCommentaires); echo '<section id="afficherCommentaire">'; echo $commentaire->datePost(); echo " :"; $texte = $commentaire->commentaire(); echo $texte; echo '</section>'; } $request1->closeCursor();
$votes = $infos->votes(); $votesEnvoi = $votes + 1; echo '<section id = "envoiVotes">'; echo '<form action = commentaire.php method="post">'; echo '<input type = "hidden" name = "idArticle" value = "' . $idArticle . '" >'; echo '<input type = "hidden" name = "tablePage" value = "' . $tablePage . '" >'; echo '<input type = "hidden" name = "votesEnvoi" value = "' . $votesEnvoi . '" >'; echo '<input type="submit" value="voter" />'; echo '</form>'; echo '</section>'; //système de commentaires require 'objets/ObjetCommentaire.php'; echo "</br>"; echo "</br>"; echo 'vos réactions'; //formulaire d ajout des commentaires echo "</br>"; echo "</br>"; //appel des commentaires $request1 = $bdd->query('SELECT datePost, commentaire FROM ' . $tableCommentaire . ' c, ' . $tablePage . ' i WHERE i.id = c.idArticle ORDER BY datePost DESC LIMIT 0, 10'); while ($donneesCommentaires = $request1->fetch(PDO::FETCH_ASSOC)) { //affichage des commentaires $com = new Commentaire($donneesCommentaires); echo '<section id="afficherCommentaire">'; echo $com->datePost(); echo " :"; $texte = $com->commentaire(); echo $texte; echo '</section>'; } $request1->closeCursor();