diff --git a/assets/bin.png b/assets/bin.png new file mode 100644 index 0000000..bc4a00f Binary files /dev/null and b/assets/bin.png differ diff --git a/assets/done.png b/assets/done.png new file mode 100644 index 0000000..0146337 Binary files /dev/null and b/assets/done.png differ diff --git a/assets/checklist.png b/assets/logo.png similarity index 100% rename from assets/checklist.png rename to assets/logo.png diff --git a/assets/to-do.png b/assets/to-do.png new file mode 100644 index 0000000..1793eb5 Binary files /dev/null and b/assets/to-do.png differ diff --git a/config/Autoload.php b/config/Autoload.php index 87afab1..b1ddb59 100644 --- a/config/Autoload.php +++ b/config/Autoload.php @@ -38,10 +38,9 @@ class Autoload { global $rep; $filename = $class.'.php'; - $dir = array('./','config/','controleurs/','modeles/Gateways/','modeles/Métier/','modeles/Modele'); + $dir = array('./','config/','controleurs/','modeles/Gateways/','modeles/Métier/','modeles/Modele/'); foreach ($dir as $d){ - $file=$rep.$d.$filename; - echo $file; + $file=$rep.$d.$filename; if (file_exists($file)) { include $file; diff --git a/config/config.php b/config/config.php index 55d6596..f6edb98 100644 --- a/config/config.php +++ b/config/config.php @@ -3,7 +3,7 @@ //Prefixe $rep=__DIR__.'/../'; //BD -$bd['dsn'] = "mysql:host=localhost;port=8888;dbname=bdPhp"; +$bd['dsn'] = "mysql:host=localhost;port=8888;dbname=dbPhp"; $bd['user'] = "root"; $bd['pswd'] = "root"; //Vues @@ -16,11 +16,14 @@ $vues['listesPrivees']='vues/listesPrivees.php'; $vues['creationListe']='vues/creationListe.php'; $vues['infosListe']='vues/infosListe.php'; $vues['creationTache']='vues/creationTache.php'; + // Styles -$styles['commun']='vues/styles/commonStyles.css'; -$styles['connection']='vues/styles/connectionStyle.css'; +$styles['commun']='styles/commonStyles.css'; +$styles['acceuil']='styles/acceuilStyles.css'; +$styles['connection']='styles/connectionStyles.css'; +$styles['listesPv']="styles/privateListsStyles.css"; // Assets -$assets['logo']='assets/chekliste.png'; +$assets['logo']='assets/logo.png'; ?> \ No newline at end of file diff --git a/controleurs/ControleurUtilisateur.php b/controleurs/ControleurUtilisateur.php index fa4e665..2a7ae48 100644 --- a/controleurs/ControleurUtilisateur.php +++ b/controleurs/ControleurUtilisateur.php @@ -6,38 +6,21 @@ class ControleurUtilisateur{ global $rep,$vues, $dataView,$styles,$assets; $arrayErrorViews= array(); - $action = $_REQUEST['action']??null; + $action = $_REQUEST['action']; switch($action){ case "accessPrivateLists": $this->accessPrivateLists($arrayErrorViews); - case "accessProfilePage": - require($rep.$vues['profile']); - break; - case "deconnection": - $this->deconnection($arrayErrorViews); - break; + case "creerListePv": $this->creerListe($arrayErrorViews); break; - case "desinscription": - $this->desinctription($arrayErrorViews); - break; - case "changerInfos": - $this->changerPassword($arrayErrorViews); - break; - default : + default: $arrayErrorViews[]="Erreur innatendue !!!"; require($rep.$vues['error']); } } - function deconnection($arrayErrorViews){ - global $rep, $vues, $dataView; - $model = new UserModel(); - $retour = $model->deconnection(); - $_REQUEST['action']=null; - $control= new ControleurVisiteur(); - } + function creerListePv($arrayErrorViews){ global $rep, $vues, $dataView; @@ -67,21 +50,6 @@ class ControleurUtilisateur{ } } - function changerPassword($arrayErrorViews){ - global $rep, $vues, $dataView; - $password1=$_POST['password1']; - $passwordConfirm=$_POST['passwordConfirm']; - $newPassword=Validation::val_changer_password($password1,$passwordConfirm); - - try{ - UserModel::changerPassword($newPassword); - require($rep.$vues['profil']); - }catch(PDOException $e){ - $dataView[]="Erreur inatendue"; - require($rep.$vues['erreur']); - } - } - function accessPrivateLists($arrayErrorViews){ global $rep, $vues, $dataView; $model = new UserModel(); diff --git a/controleurs/ControleurVisiteur.php b/controleurs/ControleurVisiteur.php index cd8b231..a679155 100644 --- a/controleurs/ControleurVisiteur.php +++ b/controleurs/ControleurVisiteur.php @@ -50,6 +50,9 @@ class ControleurVisiteur { case "delListe": $this->delListe($arrayErrorViews); break; + case "deconnection": + $this->deconnection($arrayErrorViews); + break; default : $arrayErrorViews[]="Erreur innatendue !!!"; require($rep.$vues['acceuil']); @@ -61,8 +64,17 @@ class ControleurVisiteur { exit(0); } + + function deconnection($arrayErrorViews){ + global $rep, $vues, $dataView; + $model = new UserModel(); + $retour = $model->deconnection(); + $_REQUEST['action']=null; + $control= new ControleurVisiteur(); + } + public function reinit(){ - global $rep,$vues,$dataView; + global $rep,$vues,$dataView,$styles; $model = new VisiteurModel(); $dataView = $model->pullPublicLists(); require($rep.$vues['acceuil']); diff --git a/controleurs/FrontControleur.php b/controleurs/FrontControleur.php index d03e037..57facd0 100644 --- a/controleurs/FrontControleur.php +++ b/controleurs/FrontControleur.php @@ -3,13 +3,13 @@ class FrontControleur{ public function __construct(){ - $liste_actions_utilisateur = array('accessPrivateLists','accessProfilePage','deconnection','crerListePv','desinscription','changerPassword'); - $liste_actions_visiteur = array('goHome','changeCompletedTache','accessCreationTachePage','addTache','delTache','accessListInfos','accessCreationListePage','accessInscription','accessConnectionPage','creerListe','delListe','connection','inscription'); + $liste_actions_utilisateur = array('accessPrivateLists','crerListePv'); + $liste_actions_visiteur = array('goHome','changeCompletedTache','accessCreationTachePage','addTache','delTache','accessListInfos','accessCreationListePage','accessInscription','accessConnectionPage','creerListe','delListe','connection','inscription','deconnection'); global $rep,$vues,$bd,$dataView,$styles,$assets; session_start(); try{ $user=$_SESSION??null; - $action = !empty($_REQUEST['action']) ? (string)$_REQUEST['action']:null; + $action = $_REQUEST['action']; if (in_array($action,$liste_actions_utilisateur)){ if($user == null){ diff --git a/index.php b/index.php index 1acc24c..c92edb4 100644 --- a/index.php +++ b/index.php @@ -5,24 +5,8 @@ require_once(__DIR__.'/controleurs/FrontControleur.php'); require_once(__DIR__.'/config/config.php'); // Autoload des classes -//require_once(__DIR__.'/config/Autoload.php'); -//Autoload::charger(); - -require_once(__DIR__.'/config/Validation.php'); -require_once(__DIR__.'/controleurs/ControleurUtilisateur.php'); -require_once(__DIR__.'/controleurs/ControleurVisiteur.php'); -require_once(__DIR__.'/controleurs/FrontControleur.php'); -require_once(__DIR__.'/modeles/Gateways/Connection.php'); -require_once(__DIR__.'/modeles/Gateways/ListeGateway.php'); -require_once(__DIR__.'/modeles/Gateways/UserGateway.php'); -require_once(__DIR__.'/modeles/Métier/Liste.php'); -require_once(__DIR__.'/modeles/Métier/Tache.php'); -require_once(__DIR__.'/modeles/Métier/Utilisateur.php'); -require_once(__DIR__.'/modeles/Modele/UserModel.php'); -require_once(__DIR__.'/modeles/Modele/VisiteurModel.php'); -require_once(__DIR__.'/modeles/Modele/ListModel.php'); - - +require_once(__DIR__.'/config/Autoload.php'); +Autoload::charger(); // Construction du controleur //$cont=new FrontControleur(); diff --git a/modeles/Modele/ListModel.php b/modeles/Modele/ListeModel.php similarity index 100% rename from modeles/Modele/ListModel.php rename to modeles/Modele/ListeModel.php diff --git a/modeles/Métier/Liste.php b/modeles/Métier/Liste.php index f731528..9d7dd68 100644 --- a/modeles/Métier/Liste.php +++ b/modeles/Métier/Liste.php @@ -1,10 +1,10 @@ id=$i; @@ -12,6 +12,22 @@ class Liste { $this->nomCreateur=$nomCrea; $this->taches=$t; } + + public function get_id():int{ + return $this->id; + } + + public function get_nom():string{ + return $this->nom; + } + + public function get_nomCreateur():string{ + return $this->nomCreateur; + } + + public function get_taches():?array{ + return $this->taches; + } } ?> \ No newline at end of file diff --git a/modeles/Métier/Tache.php b/modeles/Métier/Tache.php index 123f746..50351f6 100644 --- a/modeles/Métier/Tache.php +++ b/modeles/Métier/Tache.php @@ -1,17 +1,33 @@ id = $i; $this->nom = $in; $this->isCompleted = $is; $this->idListe=$idListe; } + + public function get_id():int{ + return $this->id; + } + + public function get_nom():string{ + return $this->nom; + } + + public function get_isCompleted():bool{ + return $this->isCompleted; + } + + public function get_idListe():int{ + return $this->idListe; + } } ?> \ No newline at end of file diff --git a/modeles/Métier/Utilisateur.php b/modeles/Métier/Utilisateur.php index 7c3297e..8a3a471 100644 --- a/modeles/Métier/Utilisateur.php +++ b/modeles/Métier/Utilisateur.php @@ -10,9 +10,7 @@ Class Utilisateur { $this->password=$p; $this->listListe=$liste; } - function get_id(): int { - return $this->id; - } + function get_nom(): string { return $this->nom; } diff --git a/vues/styles/.DS_Store b/styles/.DS_Store similarity index 100% rename from vues/styles/.DS_Store rename to styles/.DS_Store diff --git a/styles/acceuilStyles.css b/styles/acceuilStyles.css new file mode 100644 index 0000000..4d5b306 --- /dev/null +++ b/styles/acceuilStyles.css @@ -0,0 +1,69 @@ +.head-body{ + display:flex; + flex-direction: row; + height: 100px; + margin-bottom: 50px; + place-content: end space-between; + align-items: center; +} + +.connection{ + width: 125px; + padding: 15%; + background: none; + font-family: sans-serif; + font-size: 20; + color: #212F3D; + border: solid 2px; + border-radius: 10px; + border-color: #212F3D; +} + +.deconnection{ + width: 125px; + padding: 15%; + border: none; + color:#B2BABB; + background-color: #212F3D; + font-family: sans-serif; + border-radius: 10px; +} + +#accessList{ + color: #212F3D; + background-color: #E4F8FF; + margin: 2%; + padding: 3%; + border-radius: 30px; + display: flex; + place-content: end space-between; +} + +.private-lists{ + background: none; + border:none; + color: #212F3D; + background-color: #F7F9F9; + font-family: sans-serif; + font-size: 25; + padding : 40px; + border-radius: 25px; +} + +.create-list{ + margin-top: 2%; + background: none; + border:none; + color: #212F3D; + background-color: #F7F9F9; + font-family: sans-serif; + font-size: 25; + padding : 40px; + border-radius: 50px; + margin-left: 25%; + width: 50%; +} + +.private-lists:hover{ + background-color: #E4F8FF; +} \ No newline at end of file diff --git a/styles/commonStyles.css b/styles/commonStyles.css new file mode 100644 index 0000000..681577a --- /dev/null +++ b/styles/commonStyles.css @@ -0,0 +1,80 @@ +header{ + padding-top: 2%; + padding-bottom: 2%; + height: 5%; + width: 100%; + background:none; + display: flex; + justify-content: center; + align-items: center; + vertical-align: middle; + place-content: start space-evenly; +} +body{ + display: flex; + flex-direction: column; + align-items: center; + align-content: center; +} +h1{ + font-family: sans-serif; + font-size: 30; +} +h2{ + margin-top: 35px; + font-family: sans-serif; + font-size: 25; + color: #E4F8FF; +} + +.body{ + animation: changeColor 5s infinite alternate linear; + width: 81%; + padding-left: 10%; + padding-right: 10%; + padding-bottom: 10%; + padding-top: 5%; + display: flex; + flex-direction: column; +} + +@keyframes changeColor{ + 0% { + background-color: #004D67; + } + 25% { + background: #005F80; + } + 50%{ + background: #007198; + } + 75%{ + background: #0081AD; + } + 100%{ + background: #0089B8; + } +} + + +h4{ + margin-left: 5%; + align-self: center; + font-size: 20; + font-family: sans-serif; + color: #212F3D; +} + +.button{ + border: none; + color:#B2BABB; + background-color: #212F3D; + font-family: sans-serif; + padding:30px; + border-radius: 20px; +} + +#GoHome > input[type="image"] { + height: 50px; + width: 50px; +} \ No newline at end of file diff --git a/styles/connectionStyles.css b/styles/connectionStyles.css new file mode 100644 index 0000000..130ac47 --- /dev/null +++ b/styles/connectionStyles.css @@ -0,0 +1,60 @@ +.body{ + align-items: center; +} + +header{ + place-content: start center; +} + +h1{ + margin-left: 5%; +} + +#connectionForm{ + background-color: #E4F8FF; + width: 50%; + padding: 5%; + border-radius: 50px; + place-content: start center; +} + +#connectionForm > input[type="text"]{ + width: 60%; + height: 40px; + margin-left: 20%; + border-radius: 10px; + border: 1px solid #212F3D; + margin-bottom: 3%; +} + +#connectionForm > input[type="password"]{ + width: 60%; + height: 40px; + margin-left: 20%; + border-radius: 10px; + border: 1px solid #212F3D; + margin-bottom: 3%; +} + +.button{ + border-radius: 50px; + width: 50%; + margin-left: 25%; + margin-top: 10%; +} + +.accesInscription{ + margin-top: 2%; + background: none; + border:none; + color: #212F3D; + background-color: #F7F9F9; + font-family: sans-serif; + font-size: 25; + padding-left : 100px; + padding-right : 100px; + padding-top:30px; + padding-bottom:30px; + border-radius: 50px; + width: 100%; +} diff --git a/styles/creationStyles.css b/styles/creationStyles.css new file mode 100644 index 0000000..adb8683 --- /dev/null +++ b/styles/creationStyles.css @@ -0,0 +1,46 @@ +header{ + place-content: start center; +} + +h1{ + margin-left: 5%; +} + +.body{ + align-items: center; +} + +#creationForm{ + background-color: #E4F8FF; + width: 50%; + padding: 5%; + border-radius: 50px; + place-content: start center; + } + +#creationForm > input[type="text"]{ + width: 60%; + height: 40px; + margin-left: 20%; + border-radius: 10px; + border: 1px solid #212F3D; + margin-bottom: 3%; +} + +label{ + font-family: sans-serif; + font-weight: bold; + font-size: 20; + color: #212F3D; +} + +p{ + margin-left: 5%; +} + +.button{ + border-radius: 50px; + width: 50%; + margin-left: 25%; + margin-top: 10%; +} \ No newline at end of file diff --git a/styles/detailsListStyles.css b/styles/detailsListStyles.css new file mode 100644 index 0000000..aee1788 --- /dev/null +++ b/styles/detailsListStyles.css @@ -0,0 +1,61 @@ +header{ + place-content: start center; +} + +h1{ + margin-left: 5%; +} + +#delTache > input[type='image']{ + height: 50px; + width: 50px; +} + +#check > input[type='image']{ + height: 50px; + width: 50px; +} + +#uncheck > input[type='image']{ + height: 50px; + width: 50px; +} + +.tache{ + color: #212F3D; + background-color: #E4F8FF; + margin: 2%; + padding: 3%; + border-radius: 30px; + display: flex; + place-content: end space-between; +} + +.add-task{ + margin-top: 2%; + background: none; + border:none; + color: #212F3D; + background-color: #F7F9F9; + font-family: sans-serif; + font-size: 25; + padding : 40px; + border-radius: 50px; + margin-left: 25%; + width: 50%; +} + +.del-list{ + margin-top: 2%; + background: none; + border:none; + color: #212F3D; + background-color: #F7F9F9; + font-family: sans-serif; + font-size: 25; + padding : 25px; + border-radius: 50px; + margin-left: 35%; + width: 30%; +} + diff --git a/styles/privateListsStyles.css b/styles/privateListsStyles.css new file mode 100644 index 0000000..6960bc8 --- /dev/null +++ b/styles/privateListsStyles.css @@ -0,0 +1,8 @@ +header{ + place-content: start center; +} + +h1{ + margin-left: 5%; +} + diff --git a/vues/acceuil.php b/vues/acceuil.php index bdb4909..6208762 100644 --- a/vues/acceuil.php +++ b/vues/acceuil.php @@ -3,64 +3,70 @@