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 @@ - - +

+ + +