diff --git a/controllers/c_poll.php b/controllers/c_poll.php new file mode 100644 index 0000000..da8a671 --- /dev/null +++ b/controllers/c_poll.php @@ -0,0 +1,13 @@ +prepare("UPDATE Reponse SET nbChoisi = nbChoisi+1 WHERE repId = ?"); + $req->execute(array($answer)); + $req->closeCursor(); + } + + $req = $bdd->prepare("SELECT * FROM Sondage WHERE sonId = ?"); + $req->execute(array($pollId)); + $poll = $req->fetch(); + $req->closeCursor(); + + $req = $bdd->prepare("SELECT * FROM Reponse WHERE sondId = ?"); + $req->execute(array($pollId)); + $answers = $req->fetchAll(); + $req->closeCursor(); +} elseif ($bdd instanceof Exception) + $alert = choixAlert("query"); diff --git a/views/v_poll.php b/views/v_poll.php new file mode 100644 index 0000000..3de2b5a --- /dev/null +++ b/views/v_poll.php @@ -0,0 +1,28 @@ + + + + + + + + +
= $answer["texte"] ?>: = str_repeat("+", $answer["nbChoisi"]) ?>
+ + + + + + +