From 65d4ad2d24ea4cba6b93c7a66bbbf686d4c1d2bb Mon Sep 17 00:00:00 2001 From: Anna BOUDOUL Date: Wed, 14 Dec 2022 17:31:05 +0100 Subject: [PATCH 1/5] suite controleur --- controller/FrontCtrl.php | 11 +++--- controller/UserCtrl.php | 39 +++++++++++---------- dal/TaskGateway.php | 12 ++++--- index.php | 4 +-- model/TaskModel.php | 2 +- tests/credentials.php | 2 +- tests/test.php | 8 +++-- view/liste.php | 29 +++++++++------- view/{newList.html => newList.php} | 0 view/{list.html => task.php} | 56 ++++++++++++------------------ 10 files changed, 83 insertions(+), 80 deletions(-) rename view/{newList.html => newList.php} (100%) rename view/{list.html => task.php} (60%) diff --git a/controller/FrontCtrl.php b/controller/FrontCtrl.php index 96e95dd..a6118a8 100644 --- a/controller/FrontCtrl.php +++ b/controller/FrontCtrl.php @@ -3,26 +3,27 @@ require_once('../model/UserModel.php'); class FrontController { - private UserModel $ursMdl; + private UserModel $ursMdl; // private $action_User; function __construct(){ session_start(); $ursMdl = new UserModel(); try{ - $user = $this->usrMdl.isUser(); // cette fonction retourne quoi? + $user = $this->usrMdl->isUser(); // cette fonction retourne quoi? $action = $_REQUEST['action']; if(($i = array_search($action,$action_User)) !== false){ # si action dans la liste d'actions user if($user == null){ # si pas conncter # appel controlleur visiteur avec action connecter require("VisitCtrl.php"); - $visitCtrl = new VisitCtrl(); - $visitCtrl->goconnexion(); + $visitCtrl = new VisitCtrl(); + $visitCtrl->goconnexion(); //header ou inclure vue conn } else { # sinon # handle action avec controlleur user require("UserCtrl.php"); - $userCtrl = new UserCtrl(); + $userCtrl = new UserCtrl();$visitCtrl = new VisitCtrl(); + $visitCtrl->goconnexion(); } } else { # sinon forcement action visiteur diff --git a/controller/UserCtrl.php b/controller/UserCtrl.php index 063ae51..435e6b6 100644 --- a/controller/UserCtrl.php +++ b/controller/UserCtrl.php @@ -8,33 +8,36 @@ class UserCtrl public function __construct(Connection $con){ $this->con = $con; $this->model = new UserModel($this->con); - try{ - $action=$_REQUEST['action']; - switch($action){ + // try{ + // $action=$_REQUEST['action']; + // switch($action){ - // voir les listes privees - case 'voir_liste_priv': - $this->loadListePriv(); - break; + // // voir les listes privees + // case 'voir_liste_priv': + // $this->loadListePriv(); + // break; - // ajouter une liste privee - case 'creer_liste_priv': - $this->newListPrivate(); - break; + // // ajouter une liste privee + // case 'creer_liste_priv': + // $this->newListPrivate(); + // break; - } - } catch(Exception $e) { - require("../view/erreur.php"); - } + // } + // } catch(Exception $e) { + // require("../view/erreur.php"); + // } } public function loadListePriv(){ $name = "Liste privée"; - $TabList = array(); + $taskmdl = new TaskModel($this->con); + $TabTask = $taskmdl->loadPublicLists(); + var_dump($TabTask); // $TabList[] = new ListTask(0, "Projet PHP"); // $TabList[] = new ListTask(1, "Projet Blazor"); - $TabListPriv = $this->model->getPrivateList(); - require("../view/liste.php"); + // $TabListPriv = $this->model->loadPrivateLists(); + // require("../view/liste.php"); + require("../view/task.php"); } public function newListPrivate(){ diff --git a/dal/TaskGateway.php b/dal/TaskGateway.php index 8bff2ee..dc4c141 100644 --- a/dal/TaskGateway.php +++ b/dal/TaskGateway.php @@ -55,6 +55,7 @@ class TaskGateway # une fois pour prendre toutes les listes qui ont l'id de l'user # pour toutes ces listes (foreach), find toutes chaque tache associé public function find($table, $element="", $valeur=""){ + $tabResult = array(); if($table =='task'){ if(strcmp($element,"")==0) { @@ -71,10 +72,10 @@ class TaskGateway $results=$this->con->getResults(); foreach($results as $row) { - $tabTaches[]=new Task($row['id'],$row['titre'],$row['description'],$row['priorite'], + $tabResult[]=new Task($row['id'],$row['titre'],$row['description'],$row['priorite'], $row['idList'],$row['dateDebut'],$row['dateFin'],$row['isDone']); } - return $tabTaches; + return $tabResult; } else if($table == 'list'){ if(strcmp($element,"")==0) @@ -92,12 +93,15 @@ class TaskGateway $results=$this->con->getResults(); foreach($results as $row) { - $tabList[]=new ListTask($row['id'],$row['nom'],$row['user'],$row['dc']); + $tabResult[]=new ListTask($row['id'],$row['nom'],$row['user'],$row['dc']); } - return $tabList; + return $tabResult; } } +// SELECT tache.id FROM Tache tache, Liste liste +// tache.idListe = liste.id AND liste.user IS NULL; + /* # LIST FUNCTIONS */ /*create, update, delete, read(select info)*/ public function insertL(ListTask $l){ diff --git a/index.php b/index.php index 5fe3c7f..efbdd90 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ $fc = new FrontCtrl(); $TMessage = array(); - require_once(controller/FrontCtrl.php); - require(erreur.php); + require_once("controller/FrontCtrl.php"); + require("erreur.php"); ?> diff --git a/model/TaskModel.php b/model/TaskModel.php index 7554801..2542815 100644 --- a/model/TaskModel.php +++ b/model/TaskModel.php @@ -60,7 +60,7 @@ class TaskModel function loadPublicLists() { - return $this->gtw->find('list','user','NULL'); + return $this->gtw->find('list','user', 'RicharlisonR9'); } } ?> diff --git a/tests/credentials.php b/tests/credentials.php index 9d5efdf..e7d7377 100644 --- a/tests/credentials.php +++ b/tests/credentials.php @@ -1,4 +1,4 @@ diff --git a/tests/test.php b/tests/test.php index 0f867d3..5c7b402 100644 --- a/tests/test.php +++ b/tests/test.php @@ -7,15 +7,16 @@ echo "

2do test

"; # Test de la Gateway Tache # nouvelle tache -$t = new Task(5,'tacheNotErr','desc.','urgent','001'); + # connection include("credentials.php"); $con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'achanger'); # gateway +// $t = new Task(3,'richarlison voltar pro flu','desc.','urgent','0'); // $tgt = new TaskGateway($con); -//$tgt->insert($t); +// $tgt->insertT($t); //$tgt->delete('10'); # test find @@ -27,7 +28,7 @@ foreach($tasks as $i) // $mt= new TaskModel($con); //$mt->addTask('3','testIsDone','desc.','urgent','001'); //$mt->modifTask('3','isDone','1'); -//$tasks = $mt->getTaskBy('titre','tache1'); +// //$tasks = $mt->getTaskBy('titre','tache1'); // $tasks = $mt->getAllTask(); // foreach($tasks as $i) // echo $i->get_id()."
"; @@ -66,6 +67,7 @@ require('../controller/UserCtrl.php'); // $mdl->connexion('Aeryn', 'wtfmec'); $usrctrl = new UserCtrl($con); +// $usrctrl->loadListePriv(); $usrctrl->loadListePriv(); ?> diff --git a/view/liste.php b/view/liste.php index d11235d..0cf1a4c 100644 --- a/view/liste.php +++ b/view/liste.php @@ -1,14 +1,19 @@ - + + + - '; - echo '

'.$name.'

'; - echo '
'; - foreach($TabList as $liste){ - echo ''; - } - echo '
'; -?> \ No newline at end of file + rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" + crossorigin="anonymous"> + + + '.$name.'
'; + echo '
'; + foreach($TabList as $liste){ + echo ''; + } + echo '
'; + ?> + + diff --git a/view/newList.html b/view/newList.php similarity index 100% rename from view/newList.html rename to view/newList.php diff --git a/view/list.html b/view/task.php similarity index 60% rename from view/list.html rename to view/task.php index 7563734..dc58cc5 100644 --- a/view/list.html +++ b/view/task.php @@ -23,40 +23,28 @@ - - - - - - - - - - - - - - - - - - - - - - - -
TaskImportanceActions
Faire le controlleurUrgent - - -
Finir les vuesMoyen - - -
Gestion des erreursImportant - - - -
+ + + Task + Importance + Actions + + + + + '.$task->get_titre().' + '.$task->get_priorite().' + + + + + '; + } + ?> + + From 3754eba1d695c6320eab6483dfdff0852b726cef Mon Sep 17 00:00:00 2001 From: Anna BOUDOUL Date: Wed, 21 Dec 2022 18:49:29 +0100 Subject: [PATCH 2/5] small changes --- controller/UserCtrl.php | 7 ++++--- tests/test.php | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/controller/UserCtrl.php b/controller/UserCtrl.php index 063ae51..1790a59 100644 --- a/controller/UserCtrl.php +++ b/controller/UserCtrl.php @@ -1,13 +1,13 @@ con = $con; - $this->model = new UserModel($this->con); + $this->usrmodel = new UserModel($this->con); try{ $action=$_REQUEST['action']; switch($action){ @@ -33,13 +33,14 @@ class UserCtrl $TabList = array(); // $TabList[] = new ListTask(0, "Projet PHP"); // $TabList[] = new ListTask(1, "Projet Blazor"); - $TabListPriv = $this->model->getPrivateList(); + $TabListPriv = $this->taskmodel->getPrivateList(); require("../view/liste.php"); } public function newListPrivate(){ $nom=$_POST['listeNom']; insertL(new ListTask(0, $nom, $_SESSION['login'])); + require("../view/liste.php"); } } ?> diff --git a/tests/test.php b/tests/test.php index 2c4112e..48b3e02 100644 --- a/tests/test.php +++ b/tests/test.php @@ -37,16 +37,16 @@ foreach($tasks as $i) // echo $i->get_id()."
"; # Test LOAD PRIVATE TASKS -$mt= new TaskModel($con); -$lists = $mt->loadPublicLists(); - -foreach($lists as $l){ - echo 'List: '.$l->get_id()."
"; - echo "Tasks:
"; - foreach($l->get_taches() as $t){ - echo $t->get_id()."
"; - } -} +// $mt= new TaskModel($con); +// $lists = $mt->loadPublicLists(); + +// foreach($lists as $l){ +// echo 'List: '.$l->get_id()."
"; +// echo "Tasks:
"; +// foreach($l->get_taches() as $t){ +// echo $t->get_id()."
"; +// } +// } // $mt->addList('002','todo2','nifranco'); // $mt->modifList('2','nom','22do'); From 114dfccefbc4c8d4efabc9ababcc45c804d96c09 Mon Sep 17 00:00:00 2001 From: Anna BOUDOUL Date: Thu, 22 Dec 2022 16:18:46 +0100 Subject: [PATCH 3/5] change UserCtrl --- controller/UserCtrl.php | 34 +++++++++++++++++++++------------- model/TaskModel.php | 2 +- tests/credentials.php | 2 +- tests/test.php | 15 +++++++++------ 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/controller/UserCtrl.php b/controller/UserCtrl.php index 3c96233..40be171 100644 --- a/controller/UserCtrl.php +++ b/controller/UserCtrl.php @@ -12,20 +12,23 @@ class UserCtrl $action=$_REQUEST['action']; switch($action){ - // // voir les listes privees - // case 'voir_liste_priv': - // $this->loadListePriv(); - // break; + // voir les listes privees + case 'voir_liste_priv': + $this->loadListePriv(); + break; - // // ajouter une liste privee - // case 'creer_liste_priv': - // $this->newListPrivate(); - // break; + // ajouter une liste privee + case 'creer_liste_priv': + $this->newListPrivate(); + break; + case 'deconnexion': + $this->deconnexion(); + break; - // } - // } catch(Exception $e) { - // require("../view/erreur.php"); - // } + } + } catch(Exception $e) { + require("../view/erreur.php"); + } } public function loadListePriv(){ @@ -35,7 +38,7 @@ class UserCtrl var_dump($TabTask); // $TabList[] = new ListTask(0, "Projet PHP"); // $TabList[] = new ListTask(1, "Projet Blazor"); - $TabListPriv = $this->taskmodel->getPrivateList(); + $TabListPriv = $this->taskmodel->loadPrivateLists($user); require("../view/liste.php"); } @@ -44,5 +47,10 @@ class UserCtrl insertL(new ListTask(0, $nom, $_SESSION['login'])); require("../view/liste.php"); } + + public function deconnexion(){ + $usrmodel->deconnexion(); + + } } ?> diff --git a/model/TaskModel.php b/model/TaskModel.php index b3ea54b..980f105 100644 --- a/model/TaskModel.php +++ b/model/TaskModel.php @@ -43,7 +43,7 @@ class TaskModel /* LIST FUNCTIONS */ public function addList($id,$nom,$owner="",$dc=0) { - $l = new ListTask($id,$nom,$owner="",$dc=0); + $l = new ListTask($id,$nom,$owner,$dc); $this->gtw->insertL($l); // retourne quoi? con->lastInsertId() ?? } diff --git a/tests/credentials.php b/tests/credentials.php index e7d7377..ae601d6 100644 --- a/tests/credentials.php +++ b/tests/credentials.php @@ -1,4 +1,4 @@ diff --git a/tests/test.php b/tests/test.php index 22e10c0..7ed2df7 100644 --- a/tests/test.php +++ b/tests/test.php @@ -11,7 +11,7 @@ echo "

2do test

"; # connection include("credentials.php"); -$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'achanger'); +$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'mdpMYSQL'); # gateway // $t = new Task(3,'richarlison voltar pro flu','desc.','urgent','0'); @@ -29,7 +29,7 @@ foreach($tasks as $i) echo $i->get_id()."
"; */ # Test du modele Tache -// $mt= new TaskModel($con); +$mt= new TaskModel($con); //$mt->addTask('3','testIsDone','desc.','urgent','001'); //$mt->modifTask('3','isDone','1'); //$tasks = $mt->getTaskBy('titre','tache1'); @@ -79,16 +79,19 @@ require('../controller/UserCtrl.php'); // Test Modèle User -// $mdl = new UserModel($con); +$mdl = new UserModel($con); // $mdl->ajouter('Anna', 'unmdptrescomplique'); // $mdl->modifLogin('Anna', 'Aeryn'); // $mdl->modifMdp('Aeryn', 'wtfmec'); // $mdl->supprimer('Aeryn'); -// $mdl->connexion('Aeryn', 'wtfmec'); +$mdl->connexion('Aeryn', 'wtfmec'); -$usrctrl = new UserCtrl($con); +// $usrctrl = new UserCtrl($con); +// // $usrctrl->loadListePriv(); // $usrctrl->loadListePriv(); -$usrctrl->loadListePriv(); + +// $mt->addList(0, "Test Liste"); +$mt->addList(1, "Liste privée", "Aeryn"); ?> From 0e60561ef96dcda21ff196a17783475831213ea2 Mon Sep 17 00:00:00 2001 From: Anna BOUDOUL Date: Thu, 22 Dec 2022 16:32:19 +0100 Subject: [PATCH 4/5] Test --- tests/test.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test.php b/tests/test.php index 7ed2df7..feba98b 100644 --- a/tests/test.php +++ b/tests/test.php @@ -91,7 +91,11 @@ $mdl->connexion('Aeryn', 'wtfmec'); // $usrctrl->loadListePriv(); // $mt->addList(0, "Test Liste"); -$mt->addList(1, "Liste privée", "Aeryn"); +// // $mt->addList(1, "Liste privée", "Aeryn"); +// $mt->addList(2, "Projet de PHP", "Aeryn"); +// $mt->addList(3, "Projet Blazor", "Aeryn"); +// $mt->addList(4, "Projet de PHP", "RicharlisonR9"); +// $mt->addList(5, "Projet Blazor", "RicharlisonR9"); ?> From 7b122c7d82038ee7f446b68857346a652573775c Mon Sep 17 00:00:00 2001 From: Anna BOUDOUL Date: Thu, 22 Dec 2022 19:04:21 +0100 Subject: [PATCH 5/5] UserCtrl almost finished --- controller/UserCtrl.php | 63 +++++++++++++++++++++----------------- controller/VisitorCtrl.php | 2 +- dal/TaskGateway.php | 12 ++------ index.php | 5 +-- tests/test.php | 53 +++++++++++++++----------------- 5 files changed, 66 insertions(+), 69 deletions(-) diff --git a/controller/UserCtrl.php b/controller/UserCtrl.php index 40be171..1dfa5c6 100644 --- a/controller/UserCtrl.php +++ b/controller/UserCtrl.php @@ -1,56 +1,63 @@ con = $con; - $this->usrmodel = new UserModel($this->con); - try{ - $action=$_REQUEST['action']; - switch($action){ + $this->userModel = new UserModel($this->con); + $this->taskModel = new TaskModel($this->con); + // try{ + // $action=$_REQUEST['action']; + // switch($action){ - // voir les listes privees - case 'voir_liste_priv': - $this->loadListePriv(); - break; + // // voir les listes privees + // case 'voirListePriv': + // $this->loadListePriv(); + // break; - // ajouter une liste privee - case 'creer_liste_priv': - $this->newListPrivate(); - break; - case 'deconnexion': - $this->deconnexion(); - break; + // // ajouter une liste privee + // case 'creerListePriv': + // $this->newListPrivate(); + // break; + // case 'deconnecter': + // $this->deconnexion(); + // break; - } - } catch(Exception $e) { - require("../view/erreur.php"); - } + // } + // } catch(Exception $e) { + // require("../view/erreur.php"); + // } } public function loadListePriv(){ $name = "Liste privée"; - $taskmdl = new TaskModel($this->con); - $TabTask = $taskmdl->loadPublicLists(); - var_dump($TabTask); // $TabList[] = new ListTask(0, "Projet PHP"); // $TabList[] = new ListTask(1, "Projet Blazor"); - $TabListPriv = $this->taskmodel->loadPrivateLists($user); + $TabList = $this->taskModel->loadPrivateLists($_SESSION['login']); require("../view/liste.php"); } public function newListPrivate(){ $nom=$_POST['listeNom']; - insertL(new ListTask(0, $nom, $_SESSION['login'])); - require("../view/liste.php"); + // $nom = "New List"; + $this->taskModel->addList($nom,$_SESSION['login']); + } + + function loadHome(){ + $user = false; + $public_lists = $this->taskModel->loadPublicLists(); + require("../view/home.php"); } public function deconnexion(){ - $usrmodel->deconnexion(); - + $usrModel->deconnexion(); + loadHome(); } } ?> diff --git a/controller/VisitorCtrl.php b/controller/VisitorCtrl.php index 8807105..a4545dd 100644 --- a/controller/VisitorCtrl.php +++ b/controller/VisitorCtrl.php @@ -74,7 +74,7 @@ class VisitorCtrl } function loadHome(){ - $public_lists = $this->taskModel.loadPublicList(); + $public_lists = $this->taskModel->loadPublicLists(); require("../view/home.php"); } diff --git a/dal/TaskGateway.php b/dal/TaskGateway.php index 4db8f33..072cd6c 100644 --- a/dal/TaskGateway.php +++ b/dal/TaskGateway.php @@ -72,13 +72,8 @@ class TaskGateway $results=$this->con->getResults(); foreach($results as $row) { -<<<<<<< HEAD - $tabResult[]=new Task($row['id'],$row['titre'],$row['description'],$row['priorite'], - $row['idList'],$row['dateDebut'],$row['dateFin'],$row['isDone']); -======= $tabTaches[]=new Task($row['titre'],$row['description'],$row['priorite'], $row['idList'],$row['dateDebut'],$row['dateFin'],$row['isDone'],$row['id']); ->>>>>>> 55a7b525b1da9fc9a167f6044dbe963c2f3dde57 } return $tabResult; @@ -98,11 +93,7 @@ class TaskGateway $results=$this->con->getResults(); foreach($results as $row) { -<<<<<<< HEAD - $tabResult[]=new ListTask($row['id'],$row['nom'],$row['user'],$row['dc']); -======= $tabList[]=new ListTask($row['nom'],$row['user'],$row['dc'],$row['id']); ->>>>>>> 55a7b525b1da9fc9a167f6044dbe963c2f3dde57 } return $tabResult; } @@ -131,7 +122,7 @@ class TaskGateway $this->con->executeQuery($query, array( ':user' => array($user,PDO::PARAM_STR) )); - + $tabLists = array(); $results = $this->con->getResults(); foreach($results as $row){ $tabLists[]= new ListTask($row[1],$row[2],$row[3],$row[0]); @@ -161,6 +152,7 @@ class TaskGateway $query='SELECT * from uList where user is NULL'; $this->con->executeQuery($query); + $tabLists = array(); $results = $this->con->getResults(); foreach($results as $row){ $tabLists[]= new ListTask($row[1],$row[2],$row[3],$row[0]); diff --git a/index.php b/index.php index efbdd90..08ca4c4 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,9 @@ diff --git a/tests/test.php b/tests/test.php index e1b780d..8162c46 100644 --- a/tests/test.php +++ b/tests/test.php @@ -12,11 +12,7 @@ require_once("../controller/VisitorCtrl.php"); # connection include("credentials.php"); -<<<<<<< HEAD $con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'mdpMYSQL'); -======= -$con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'achanger'); ->>>>>>> 55a7b525b1da9fc9a167f6044dbe963c2f3dde57 # gateway // $t = new Task(3,'richarlison voltar pro flu','desc.','urgent','0'); @@ -29,13 +25,12 @@ $con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'ach // } # test find -/*$tasks=$tgt->find('idList','001'); -foreach($tasks as $i) - echo $i->get_id()."
"; */ +// $tasks=$tgt->find('idList','001'); +// foreach($tasks as $i) +// echo $i->get_id()."
"; -<<<<<<< HEAD # Test du modele Tache -$mt= new TaskModel($con); +// $mt= new TaskModel($con); //$mt->addTask('3','testIsDone','desc.','urgent','001'); //$mt->modifTask('3','isDone','1'); //$tasks = $mt->getTaskBy('titre','tache1'); @@ -43,13 +38,11 @@ $mt= new TaskModel($con); // foreach($tasks as $i) // echo $i->get_id()."
"; -# Test LOAD PRIVATE TASKS -// $mt= new TaskModel($con); -======= # Test LOAD PRIVATE TASKS $mt= new TaskModel($con); -$mt->addList('private','nifranco'); ->>>>>>> 55a7b525b1da9fc9a167f6044dbe963c2f3dde57 +# Test LOAD PRIVATE TASKS +// $mt= new TaskModel($con); +// $mt->addList('private','nifranco'); // $lists = $mt->loadPublicLists(); // foreach($lists as $l){ @@ -59,7 +52,6 @@ $mt->addList('private','nifranco'); // echo $t->get_id()."
"; // } // } -<<<<<<< HEAD // //$tasks = $mt->getTaskBy('titre','tache1'); // $tasks = $mt->getAllTask(); // foreach($tasks as $i) @@ -67,14 +59,12 @@ $mt->addList('private','nifranco'); // $tasks = $mt->loadPublicLists(); // foreach($tasks as $i) // echo $i->get_id()."
"; -======= ->>>>>>> 55a7b525b1da9fc9a167f6044dbe963c2f3dde57 // $mt->addList('002','todo2','nifranco'); // $mt->modifList('2','nom','22do'); //mt->supList('2'); -$public_lists = $mt->loadPrivateLists('nifranco'); -$user = true; +// $public_lists = $mt->loadPrivateLists('nifranco'); +// $user = true; //require("../view/home.php"); //require("../view/register.php"); //require("../view/connection.php"); @@ -104,16 +94,23 @@ $mdl = new UserModel($con); // $mdl->supprimer('Aeryn'); $mdl->connexion('Aeryn', 'wtfmec'); -// $usrctrl = new UserCtrl($con); -// // $usrctrl->loadListePriv(); -// $usrctrl->loadListePriv(); +$mt->addList("Test Liste"); +$mt->addList("Liste publique"); +$mt->addList("Liste privée", "Aeryn"); +$mt->addList("Projet de PHP", "Aeryn"); +$mt->addList("Projet Blazor", "Aeryn"); +$mt->addList("Projet de PHP", "RicharlisonR9"); +$mt->addList("Projet Blazor", "RicharlisonR9"); + +// TEST USER CONTROLLER + + +session_start(); +$_SESSION['login'] = 'RicharlisonR9'; +$usrctrl = new UserCtrl($con); +$usrctrl->loadHome(); + -// $mt->addList(0, "Test Liste"); -// // $mt->addList(1, "Liste privée", "Aeryn"); -// $mt->addList(2, "Projet de PHP", "Aeryn"); -// $mt->addList(3, "Projet Blazor", "Aeryn"); -// $mt->addList(4, "Projet de PHP", "RicharlisonR9"); -// $mt->addList(5, "Projet Blazor", "RicharlisonR9"); ?>