From ff617d449a50a725e68ef11bb30ed140f2bd9e4f Mon Sep 17 00:00:00 2001 From: Lucie Bedouret Date: Wed, 30 Nov 2022 15:54:23 +0100 Subject: [PATCH 1/2] ADD : first view of the website --- .DS_Store | Bin 0 -> 6148 bytes index.php | 24 ++++++++++++++++++++ userController.php | 40 ++++++++++++++++++++++++++++++++++ views/connection.html | 27 +++++++++++++++++++++++ views/error.html | 8 +++++++ views/signUp.html | 27 +++++++++++++++++++++++ views/styles/commonStyles.css | 26 ++++++++++++++++++++++ 7 files changed, 152 insertions(+) create mode 100644 .DS_Store create mode 100644 index.php create mode 100644 userController.php create mode 100644 views/connection.html create mode 100644 views/error.html create mode 100644 views/signUp.html create mode 100644 views/styles/commonStyles.css diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..32b4894a0a50e361617c710681e75b3bf0d45fec GIT binary patch literal 6148 zcmeHKO-lnY5PhQ+DjqDJya@RP1^>ZX>%p^sK>7g+>u#~FdfdA|#-FHfW}9wTNBeZJvL^shuhC}o^^&Zdl(ERzIC6w0P9-{3@)JXx&i<6+ij0k;(;@ls zA$jKS$BWqP%%3bAQaDB(3WNe}1rEJA()0g@f0^D#ewz}lP#_f8GX-QYy_-(BseHEn z+Mb@ZiRGR}P2(DMX!Ki`05 + + + + Acceuil + + + +
+

Welcome to our fantastic to do list app !

+ + + +
+ +
+

Todo listes publiques

+

oooooh fdp change

+
+ + + + + diff --git a/userController.php b/userController.php new file mode 100644 index 0000000..7594872 --- /dev/null +++ b/userController.php @@ -0,0 +1,40 @@ +action(); + break; + case "connection": + $this->connection(/* valeurs du login et du mdp dans le formulaire */); + break; + }catch(PDOException $e){ + $dataView[]="Erreur inatendue"; + require(__DIR__.'/../vues/erreur.php'); + } + } + } + + public function connection(string $login, string $password){ + + /* Doit faire: + * vider les input du formulaire + * vérifier avec la bd qu'il y a bien un user + */ + + } +} + +?> \ No newline at end of file diff --git a/views/connection.html b/views/connection.html new file mode 100644 index 0000000..d236ba0 --- /dev/null +++ b/views/connection.html @@ -0,0 +1,27 @@ + + + + connection + + + +
+

You are back ?!

+
+
+

Username

+ +

Password

+ +
+
+ +
+
+

You are new here?

+ + + +
+ + \ No newline at end of file diff --git a/views/error.html b/views/error.html new file mode 100644 index 0000000..f72c671 --- /dev/null +++ b/views/error.html @@ -0,0 +1,8 @@ + + +
+

Error!

+

There was an error in the fields you filled...

+

Please enter correct values

+
+ \ No newline at end of file diff --git a/views/signUp.html b/views/signUp.html new file mode 100644 index 0000000..4fcd0cb --- /dev/null +++ b/views/signUp.html @@ -0,0 +1,27 @@ + + + + connection + + + +
+

Join the good side of the force

+ +
+
+

Please enter all the informations :

+

Username

+ +

Password

+ +

Email

+ +

Date Of Birth

+ +
+
+ +
+ + \ No newline at end of file diff --git a/views/styles/commonStyles.css b/views/styles/commonStyles.css new file mode 100644 index 0000000..51b1e68 --- /dev/null +++ b/views/styles/commonStyles.css @@ -0,0 +1,26 @@ +header{ + display: flex; + flex-direction: row; + background-color: #0971C9; +} +body{ + background-color: #0D2350; + +} +h1{ + font-family: sans-serif; + font-weight: bolder; + color: #6da8e2; +} +.button{ + width: 150%; + height: 75%; + background-color: #FFFEFD; + border-radius: 20%; + border-color: #0971C9; + color: #0D2350; + +} +.button:hover{ + background-color: grey; +} \ No newline at end of file From 2021f8a16590a855e5b1e14e9ba8ff2f0804a5bf Mon Sep 17 00:00:00 2001 From: Lucie BEDOURET Date: Wed, 30 Nov 2022 17:33:45 +0100 Subject: [PATCH 2/2] =?UTF-8?q?ADD=20:=20ajout=20des=20controleurs=20et=20?= =?UTF-8?q?de=20vues,=20tentatives=20des=20premi=C3=A8res=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/Autoload.php | 50 +++++++++++++++++++++++++++ config/config.php | 18 ++++++++++ controleurs/ControleurUtilisateur.php | 39 +++++++++++++++++++++ controleurs/ControleurVisiteur.php | 47 +++++++++++++++++++++++++ controleurs/FrontControleur.php | 12 +++++++ index.php | 30 ++++++---------- modeles/blbl | 0 views/styles/commonStyles.css | 2 +- vues/acceuil.php | 23 ++++++++++++ vues/connection.php | 27 +++++++++++++++ vues/erreur.php | 17 +++++++++ vues/inscription.php | 27 +++++++++++++++ vues/styles/commonStyles.css | 26 ++++++++++++++ 13 files changed, 297 insertions(+), 21 deletions(-) create mode 100644 config/Autoload.php create mode 100644 config/config.php create mode 100644 controleurs/ControleurUtilisateur.php create mode 100644 controleurs/ControleurVisiteur.php create mode 100644 controleurs/FrontControleur.php create mode 100644 modeles/blbl create mode 100644 vues/acceuil.php create mode 100644 vues/connection.php create mode 100644 vues/erreur.php create mode 100644 vues/inscription.php create mode 100644 vues/styles/commonStyles.css diff --git a/config/Autoload.php b/config/Autoload.php new file mode 100644 index 0000000..d651342 --- /dev/null +++ b/config/Autoload.php @@ -0,0 +1,50 @@ + \ No newline at end of file diff --git a/config/config.php b/config/config.php new file mode 100644 index 0000000..d4892cd --- /dev/null +++ b/config/config.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/controleurs/ControleurUtilisateur.php b/controleurs/ControleurUtilisateur.php new file mode 100644 index 0000000..17b5a66 --- /dev/null +++ b/controleurs/ControleurUtilisateur.php @@ -0,0 +1,39 @@ +Reinit(); + break; + case "deconnection": + $this->deconnection($arrayErrorViews); + break; + case "creerListe": + $this->creerListe($arrayErrorViews); + break; + case "supprListe": + $this->supprListe($arrayErrorViews); + break; + default : + $arrayErrorViews[]="Erreur innatendue !!!"; + require($rep.$vues['error']); + } + */ + }catch(PDOException $e){ + $dataView[]="Erreur inatendue"; + require(__DIR__.'/../vues/erreur.php'); + } + } +} + +?> \ No newline at end of file diff --git a/controleurs/ControleurVisiteur.php b/controleurs/ControleurVisiteur.php new file mode 100644 index 0000000..59b22ed --- /dev/null +++ b/controleurs/ControleurVisiteur.php @@ -0,0 +1,47 @@ +reinit(); + break; + case "connection": + $this->connection($arrayErrorViews); + break; + case "creerListe": + $this->creerListe($arrayErrorViews); + break; + case "supprListe": + $this->supprListe($arrayErrorViews); + break; + default : + $arrayErrorViews[]="Erreur innatendue !!!"; + require($rep.$vues['error']); + } + }catch(PDOException $e){ + $dataView[]="Erreur inatendue"; + require(__DIR__.'/../vues/erreur.php'); + } + } + + public function reinit(){ + global $rep,$vues; + require($rep.$vues['acceuil']); + } + + public function connection(array $vues_erreur){ + global $rep,$vues; + require($rep.$vues['connection']); + } +} + +?> \ No newline at end of file diff --git a/controleurs/FrontControleur.php b/controleurs/FrontControleur.php new file mode 100644 index 0000000..bf3caa7 --- /dev/null +++ b/controleurs/FrontControleur.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/index.php b/index.php index 68a62c0..17c7315 100644 --- a/index.php +++ b/index.php @@ -1,24 +1,14 @@ - - + - Acceuil - - - -
-

Welcome to our fantastic to do list app !

- - - -
- -
-

Todo listes publiques

-

oooooh fdp change

-
- +// Chargement config +require_once(__DIR__.'/config/config.php'); +// Autoload des classes +require_once(__DIR__.'/config/Autoload.php'); +Autoload::charger(); + +// Construction du controleur +$cont=new FrontControleur(); +?> - diff --git a/modeles/blbl b/modeles/blbl new file mode 100644 index 0000000..e69de29 diff --git a/views/styles/commonStyles.css b/views/styles/commonStyles.css index 51b1e68..b6264e7 100644 --- a/views/styles/commonStyles.css +++ b/views/styles/commonStyles.css @@ -7,7 +7,7 @@ body{ background-color: #0D2350; } -h1{ +h1,h2,h3,h4,p{ font-family: sans-serif; font-weight: bolder; color: #6da8e2; diff --git a/vues/acceuil.php b/vues/acceuil.php new file mode 100644 index 0000000..3efad0d --- /dev/null +++ b/vues/acceuil.php @@ -0,0 +1,23 @@ + + + + + Acceuil + + + +
+

Welcome to our fantastic to do list app !

+
+ + +
+
+ +
+

Todo listes publiques

+
+
+
+ + diff --git a/vues/connection.php b/vues/connection.php new file mode 100644 index 0000000..a25ae94 --- /dev/null +++ b/vues/connection.php @@ -0,0 +1,27 @@ + + + + connection + + + +
+

You are back ?!

+
+
+

Username

+ +

Password

+ +
+
+ +
+
+

You are new here?

+ + + +
+ + \ No newline at end of file diff --git a/vues/erreur.php b/vues/erreur.php new file mode 100644 index 0000000..d3a6385 --- /dev/null +++ b/vues/erreur.php @@ -0,0 +1,17 @@ + + + +
+

Error!

+ + + +
+ + \ No newline at end of file diff --git a/vues/inscription.php b/vues/inscription.php new file mode 100644 index 0000000..4ffa4ee --- /dev/null +++ b/vues/inscription.php @@ -0,0 +1,27 @@ + + + + connection + + + +
+

Join the good side of the force

+ +
+
+

Please enter all the informations :

+

Username

+ +

Password

+ +

Email

+ +

Date Of Birth

+ +
+
+ +
+ + \ No newline at end of file diff --git a/vues/styles/commonStyles.css b/vues/styles/commonStyles.css new file mode 100644 index 0000000..2a24d51 --- /dev/null +++ b/vues/styles/commonStyles.css @@ -0,0 +1,26 @@ +header{ + display: flex; + flex-direction: row; + background-color: #0971C9; +} +body{ + background-color: #0D2350; + +} +h1, h2, h3, h4, p{ + font-family: sans-serif; + font-weight: bolder; + color: #FFFEFD; +} +.button{ + width: 50%; + height: 100%; + background-color: #FFFEFD; + border-radius: 20%; + border-color: #0971C9; + color: #0D2350; + +} +.button:hover{ + background-color: grey; +} \ No newline at end of file