diff --git a/config/config.php b/config/config.php index 39c1aca..7f5428a 100644 --- a/config/config.php +++ b/config/config.php @@ -16,5 +16,6 @@ $TabVues["newList"] = "view/newList.php"; $TabVues["liste"] = "view/liste.php"; $TabVues["about"] = "view/about.php"; + $TabVues["prives"] = "view/privHome.php"; ?> \ No newline at end of file diff --git a/controller/FrontCtrl.php b/controller/FrontCtrl.php index 6322a68..0009027 100644 --- a/controller/FrontCtrl.php +++ b/controller/FrontCtrl.php @@ -14,7 +14,7 @@ class FrontCtrl $this->TMessage = $TMessage; $this->TabVues = $TabVues; $this->usrMdl = new UserModel($con); - $this->action_User = array('deconnecter','loadListePriv','newListPrivate'); + $this->action_User = array('deconnecter','voirListePriv','creerListePriv'); try{ $this->isUser = $this->usrMdl->isConnected(); diff --git a/controller/UserCtrl.php b/controller/UserCtrl.php index e22a11d..9305107 100644 --- a/controller/UserCtrl.php +++ b/controller/UserCtrl.php @@ -28,6 +28,8 @@ class UserCtrl case 'creerListePriv': $this->newListPrivate(); break; + + case 'deconnecter': $this->deconnexion(); break; @@ -44,17 +46,14 @@ class UserCtrl } public function loadListePriv(){ - $name = "Liste privée"; - // $TabList[] = new ListTask(0, "Projet PHP"); - // $TabList[] = new ListTask(1, "Projet Blazor"); - $TabList = $this->taskModel->loadPrivateLists($_SESSION['login']); - require($this->TabVues["liste"]); + $user = $_SESSION['login']; + $private_lists = $this->taskModel->loadPrivateLists($user); + require($this->TabVues["prives"]); } public function newListPrivate(){ - $nom=$_POST['listeNom']; - // $nom = "New List"; - $this->taskModel->addList($nom,$_SESSION['login']); + $this->taskModel->addList($_POST['listName'],$_SESSION['login']); + $this->loadListePriv(); } function loadHome(){ diff --git a/view/newList.php b/view/newList.php index b4fcc6d..423a963 100644 --- a/view/newList.php +++ b/view/newList.php @@ -62,15 +62,15 @@ - + - - '; + '; } ?> diff --git a/view/privHome.php b/view/privHome.php new file mode 100644 index 0000000..781508d --- /dev/null +++ b/view/privHome.php @@ -0,0 +1,130 @@ + + +
+ + + + + + + + +Task | +Importance | +Actions | +
---|---|---|
'.$t->get_titre().' | +'.$t->get_priorite().' | '; + } else { + echo ' +|
+ + + | +