From 4cb5f6943613072270360d52bc3854972a05c6d2 Mon Sep 17 00:00:00 2001 From: Anna BOUDOUL Date: Fri, 23 Dec 2022 21:39:26 +0100 Subject: [PATCH] merge and task done management --- controller/VisitorCtrl.php | 5 ++++- view/home.php | 22 +++++++++++++++------ view/privHome.php | 39 ++++++++++++++++++++++++-------------- 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/controller/VisitorCtrl.php b/controller/VisitorCtrl.php index b7f3870..7fc0fe4 100644 --- a/controller/VisitorCtrl.php +++ b/controller/VisitorCtrl.php @@ -178,7 +178,10 @@ class VisitorCtrl } function isDone(){ - $this->taskModel->modifTask($_POST['idT'],'isDone',true); + if ($_POST['Tdone']) + $this->taskModel->modifTask($_POST['idT'],'isDone',false); + else + $this->taskModel->modifTask($_POST['idT'],'isDone',true); if(!empty($_POST['isPriv'])) header("Location:index.php?action=voirListePriv"); else diff --git a/view/home.php b/view/home.php index d14d7f3..42b3894 100644 --- a/view/home.php +++ b/view/home.php @@ -100,14 +100,24 @@ } echo ' -
- + '; + if(!$t->get_isDone()){ + echo ''; + } else { + echo ''; + } + echo '
- diff --git a/view/privHome.php b/view/privHome.php index 4499c5d..0cf77b9 100644 --- a/view/privHome.php +++ b/view/privHome.php @@ -95,20 +95,31 @@ } echo ' - - -
-
- -
+
'; + if(!$t->get_isDone()){ + echo ''; + } else { + echo ''; + } + echo ' +
+
+ +
'; }