diff --git a/business/Task.php b/business/Task.php index 73e88b4..cdea1fb 100644 --- a/business/Task.php +++ b/business/Task.php @@ -14,7 +14,7 @@ # if id = 0, on veut donc creer une nouvelle tache # qui n'est pas encore dans la base de donnée et donc # le id sera fait avec le auto increment - if($id=0) + if($id==0) $this->set_id((int)null); else $this->set_id($id); @@ -24,6 +24,7 @@ $this->set_dateDeb($dateDeb); $this->set_dateFin($dateFin); $this->set_idlist($idl); + $this->set_isDone($isDone); } function get_id() { diff --git a/controller/VisitorCtrl.php b/controller/VisitorCtrl.php index 9341ca8..35fcbcc 100644 --- a/controller/VisitorCtrl.php +++ b/controller/VisitorCtrl.php @@ -20,7 +20,6 @@ class VisitorCtrl else $action = null; - //if(isset($_POST['listId'])) var_dump($_POST['listId']); switch($action){ case null: $this->loadHome(); @@ -77,6 +76,10 @@ class VisitorCtrl # supprimer une tache break; + case 'isDone': + $this->isDone(); + break; + default: # $TMessage[] = 'Unexpected error'; @@ -149,6 +152,10 @@ class VisitorCtrl $this->taskModel->supTask($_POST['idT']); $this->loadHome(); } - + + function isDone(){ + $this->taskModel->modifTask($_POST['idT'],'isDone',true); + $this->loadHome(); + } } ?> \ No newline at end of file diff --git a/view/home.php b/view/home.php index 4d48ded..d9ff41f 100644 --- a/view/home.php +++ b/view/home.php @@ -68,7 +68,7 @@ - + @@ -81,13 +81,31 @@ # IF NO TASKS, display NO TASKS if(!empty($l->get_taches())){ foreach($l->get_taches() as $t){ + if(!$t->get_isDone()){ + echo ' + + + '; + } else { + echo ' + + + '; + } echo ' - - - '; }
'.$t->get_titre().''.$t->get_priorite().'
'.$t->get_titre().''.$t->get_priorite().'
'.$t->get_titre().''.$t->get_priorite().' - - +
+ +
+
+ +