diff --git a/controller/VisitorCtrl.php b/controller/VisitorCtrl.php index 8417cbc..2c62cc7 100644 --- a/controller/VisitorCtrl.php +++ b/controller/VisitorCtrl.php @@ -16,7 +16,7 @@ class VisitorCtrl $action = $_REQUEST['action']; else $action = null; - + switch($action){ case null: $this->loadHome(); @@ -106,11 +106,15 @@ class VisitorCtrl function go_list(){ $user = $this->isUser; + $dataVue['newList'] = null; require("view/newList.php"); } - function makeList(){ - + function makeList(){ + // $user = $this->isUser; + // $public_lists = $this->taskModel->loadPublicLists(); + $this->taskModel->addList($_POST['listName']); + $this->loadHome(); } function eraseList(){ diff --git a/index.php b/index.php index 7b15af8..f6ab28f 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ diff --git a/model/TaskModel.php b/model/TaskModel.php index c0b05ec..b34832c 100644 --- a/model/TaskModel.php +++ b/model/TaskModel.php @@ -43,7 +43,7 @@ class TaskModel /* LIST FUNCTIONS */ public function addList($nom,$owner="",$dc=0,$id=0) { - $l = new ListTask($nom,$owner,$dc); + $l = new ListTask($nom,$owner,$dc); $this->gtw->insertL($l); // retourne quoi? con->lastInsertId() ?? } diff --git a/tests/test.php b/test.php similarity index 76% rename from tests/test.php rename to test.php index cf707c8..e5b100d 100644 --- a/tests/test.php +++ b/test.php @@ -1,9 +1,9 @@ 2do test"; # Test de la Gateway Tache @@ -11,8 +11,7 @@ require_once("../controller/VisitorCtrl.php"); # $t = new Task(5,'tacheNotErr','desc.','urgent','001'); # connection -include("credentials.php"); -$con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'mdpMYSQL'); +$con = new Connection('mysql:host=localhost;dbname=phpproject', 'nifranco', 'achanger'); # gateway // $t = new Task(3,'richarlison voltar pro flu','desc.','urgent','0'); @@ -40,7 +39,7 @@ $con = new Connection('mysql:host=localhost;dbname=dbanboudoul', 'anboudoul', 'm # Test LOAD PRIVATE TASKS $mt= new TaskModel($con); -//$mt->addList('private','nifranco'); +$mt->addList('Nicolas2do'); # Test LOAD PRIVATE TASKS // $mt= new TaskModel($con); // $mt->addList('private','nifranco'); @@ -96,23 +95,23 @@ $mdl = new UserModel($con); // $mdl->modifLogin('Anna', 'Aeryn'); // $mdl->modifMdp('Aeryn', 'wtfmec'); // $mdl->supprimer('Aeryn'); -$mdl->connexion('Aeryn', 'wtfmec'); +// $mdl->connexion('Aeryn', 'wtfmec'); -$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"); +// $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(); +// session_start(); +// $_SESSION['login'] = 'RicharlisonR9'; +// $usrctrl = new UserCtrl($con); +// $usrctrl->loadHome(); diff --git a/view/newList.php b/view/newList.php index a25c394..8afbc1a 100644 --- a/view/newList.php +++ b/view/newList.php @@ -55,16 +55,16 @@