From 19af04b9f233ebce1b979c283d92788876e52b04 Mon Sep 17 00:00:00 2001 From: thchazot1 Date: Fri, 23 Dec 2022 17:20:19 +0100 Subject: [PATCH] yes --- Vues/addTask.php | 2 +- controllers/VisitorController.php | 1 + metier/Tache.php | 4 ++++ modeles/MdlListe.php | 2 +- modeles/MdlTache.php | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Vues/addTask.php b/Vues/addTask.php index 0d0bc81..cfe8e0e 100644 --- a/Vues/addTask.php +++ b/Vues/addTask.php @@ -35,7 +35,7 @@ - + diff --git a/controllers/VisitorController.php b/controllers/VisitorController.php index 852ad07..411492d 100644 --- a/controllers/VisitorController.php +++ b/controllers/VisitorController.php @@ -39,6 +39,7 @@ class VisitorController { case "accessAddTask": $dataView=$_POST['list']; + echo $dataView; require($rep.$vues['addTask']); break; diff --git a/metier/Tache.php b/metier/Tache.php index 57e4d4b..3377015 100644 --- a/metier/Tache.php +++ b/metier/Tache.php @@ -42,6 +42,10 @@ class Tache $this->name=$name; } + public function setId(int $id){ + $this->id=$id; + } + public function setContent(string $content){ $this->content=$content; } diff --git a/modeles/MdlListe.php b/modeles/MdlListe.php index c42ec34..e6b33da 100644 --- a/modeles/MdlListe.php +++ b/modeles/MdlListe.php @@ -82,7 +82,7 @@ class MdlListe{ $tabTache=[]; $taches=$gateTache->getTacheFromIdList($row['id']); foreach($taches as $tata){ - $tabTache[]=new Tache($tata['id'], $tata['name'], $tata['content'], $tata['completed']); + $tabTache[]=new Tache($tata->getId(), $tata->getName(), $tata->getContent(), $tata->getCompleted()); } $tabListe[]=new Liste($row['id'], $row['name'], $row['private'], $user, $tabTache); } diff --git a/modeles/MdlTache.php b/modeles/MdlTache.php index f91669a..36e3487 100644 --- a/modeles/MdlTache.php +++ b/modeles/MdlTache.php @@ -15,9 +15,9 @@ class MdlTache{ public function insert(string $name, string $content ,bool $completed, string $idListe): Tache{ $gate=new TacheGateway($this->con); $t=new Tache(0, $name, $content, $completed); - $gate->insert($t); + $gate->insert($t, $idListe); $id=$gate->getLastId(); - $t->setId($id[0]['oldId']); + $t->setId($id); return $t; }