From cf61f9dc6f87bf3e366f5ea6f97f2dcfda2fcf9d Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 13 Nov 2020 08:50:55 +0100 Subject: [PATCH] Create home page --- config/configuration_exemple.php | 2 +- controllers/c_accueil.php | 2 ++ languages/FR-fr.php | 4 ++-- lib/getPDD.php | 12 ++++++++++++ models/m_accueil.php | 13 +++++++++++++ views/v_accueil.php | 10 ++++++++-- 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 lib/getPDD.php create mode 100644 models/m_accueil.php diff --git a/config/configuration_exemple.php b/config/configuration_exemple.php index de32ccf..97a1939 100644 --- a/config/configuration_exemple.php +++ b/config/configuration_exemple.php @@ -12,7 +12,7 @@ const BD_PWD = ''; const LANG ='FR-fr'; // Paramètres du site : nom de l'auteur ou des auteurs -const AUTEUR = ''; +const AUTEUR = 'Florian Charlaix'; //dossiers racines du site define('PATH_CONTROLLERS','./controllers/c_'); diff --git a/controllers/c_accueil.php b/controllers/c_accueil.php index d85e638..0cab590 100644 --- a/controllers/c_accueil.php +++ b/controllers/c_accueil.php @@ -1,4 +1,6 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $bdd->exec("set names utf8"); + return $bdd; + } catch (Exception $e) { + return $e; + } +} diff --git a/models/m_accueil.php b/models/m_accueil.php new file mode 100644 index 0000000..0c35791 --- /dev/null +++ b/models/m_accueil.php @@ -0,0 +1,13 @@ +prepare("SELECT * FROM Sondage"); + $req->execute(); + $polls = $req->fetchAll(); + $req->closeCursor(); +} elseif ($bdd instanceof Exception) + $alert = choixAlert("query"); diff --git a/views/v_accueil.php b/views/v_accueil.php index d23f73c..b39dd43 100644 --- a/views/v_accueil.php +++ b/views/v_accueil.php @@ -7,8 +7,14 @@ - - +

+ + +