} $contenu = $question['contenu']; $user = userfromid($question['auteur']); $pseudo = $user['pseudo']; echo "<div class='well'>\n <p id='p'> {$pseudo}: </p><p id='m'> {$contenu}</p>"; if ($question['auteur'] == $_SESSION['userid']) { echo "<a id='c' href='back_questions_form.php?edite={$id}'>éditer</a>"; } echo "</div>"; ?> <?php echo "<h1>Liste des réponses:</h1>"; $reponses = reponses($_GET['questionid']); foreach ($reponses as $reponse) { $contenu = $reponse['contenu']; $id = $reponse['id']; $user = userfromid($reponse['auteur']); $pseudo = $user['pseudo']; $vote = $reponse['nbrvotes']; echo "<div class='row'>\n <div class='col-md-1' >{$pseudo}</div>\n <div class='col-md-8'>{$contenu}</div>\n <div class='col-md-1'>+{$vote}</div>"; if ($reponse['auteur'] == $_SESSION['userid']) { echo "<div class='col-md-2'>\n <a class='a' id='a' href='back_reponses_form.php?edite={$id}'>éditer</a>\n <a class='a' id='b' href='?suppr={$id}'>supprimer</a>\n </div>"; } else { echo "<div class='col-md-2'>\n <a href='back_votes.php?vote={$id}'>voter</a>\n </div>"; } echo "</div>"; } ?> </div> </body> </html>
<span class="icon-bar"></span> <span class="icon-bar"></span> </button> <p class="navbar-brand">Mathssupport</p> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="home.php">Accueil</a></li> <li><a href="back_questions_form.php">Poser une question</a></li> <li class="active"><a href="back_questions.php">Toutes les questions</a></li> <li id='li'><a href="index.php?deconnecte=">Déconnexion</a></li> </ul> </div> </div> </div> <div class="container"> <h2 >Toutes les questions:</h2> <?php $questions = questions(); foreach ($questions as $question) { $contenu = $question['contenu']; $questionid = $question['id']; $user = userfromid($question['auteur']); $pseudo = $user['pseudo']; echo "<div class='list-group'>\n <a id='r' class='list-group-item' href='back_reponses.php?questionid={$questionid}'>\n <strong id='c' >{$pseudo}: </strong>\n {$contenu}\n </a>\n </div>"; } ?> </div> </body> </html>