From f807700358651cadeb03f9f6f415ab09330e11d7 Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 13 Nov 2020 09:18:41 +0100 Subject: [PATCH] Create poll page --- controllers/c_poll.php | 13 +++++++++++++ languages/FR-fr.php | 1 + models/m_poll.php | 24 ++++++++++++++++++++++++ views/v_poll.php | 28 ++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 controllers/c_poll.php create mode 100644 models/m_poll.php create mode 100644 views/v_poll.php 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 @@ + + + + + + + + +

+ +

:

+ +
+ + + + > +
+ + + + +