verifications faites apres ajout de isDone

list-Gtw-Mdl
Nicolas FRANCO 2 years ago
parent 362497143d
commit 21de950b9f

@ -15,7 +15,7 @@ class TaskGateway
// functions // functions
// code de retour pour les fonctions i,u,d? // code de retour pour les fonctions i,u,d?
public function insert(Task $t){ public function insert(Task $t){
$query='INSERT INTO Tache VALUES (:id,:titre,:descript,NULL,NULL,:priorite,:idList,NULL)'; $query='INSERT INTO Tache VALUES (:id,:titre,:descript,NULL,NULL,:priorite,:idList,false)';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':id'=> array($t->get_id(),PDO::PARAM_STR), ':id'=> array($t->get_id(),PDO::PARAM_STR),
@ -65,7 +65,7 @@ class TaskGateway
foreach($results as $row) foreach($results as $row)
{ {
$tabTaches[]=new Task($row['id'],$row['titre'],$row['description'],$row['priorite'], $tabTaches[]=new Task($row['id'],$row['titre'],$row['description'],$row['priorite'],
$row['idList'],$row['dateDebut'],$row['dateFin']); $row['idList'],$row['dateDebut'],$row['dateFin'],$row['isDone']);
} }
return $tabTaches; return $tabTaches;
} }

@ -13,9 +13,9 @@ class TaskModel
$this->gtw= new TaskGateway($con); $this->gtw= new TaskGateway($con);
} }
public function addTask($id,$titre,$desc,$priorite,$idList,$dateDeb="",$dateFin="") public function addTask($id,$titre,$desc,$priorite,$idList,$dateDeb="",$dateFin="",$isDone=false)
{ {
$t = new Task($id,$titre,$desc,$priorite,$idList,$dateDeb,$dateFin); $t = new Task($id,$titre,$desc,$priorite,$idList,$dateDeb,$dateFin,$isDone);
$this->gtw->insert($t); $this->gtw->insert($t);
// retourne quoi? con->lastInsertId() ?? // retourne quoi? con->lastInsertId() ??
} }

@ -25,11 +25,13 @@ foreach($tasks as $i)
# Test du modele Tache # Test du modele Tache
$mt= new TaskModel($con); $mt= new TaskModel($con);
$mt->addTask('6','tacheModel','desc.','urgent','001'); //$mt->addTask('3','testIsDone','desc.','urgent','001');
$mt->modifTask('3','isDone','1');
//$tasks = $mt->getTaskBy('titre','tache1'); //$tasks = $mt->getTaskBy('titre','tache1');
//$tasks = $mt->getAllTask(); $tasks = $mt->getAllTask();
/*foreachh($tasks as $i) foreach($tasks as $i)
echo $i->get_id()."<br>"; */ echo $i->get_id()."<br>";
$l1 = new ListTask('001','todo1' ,'nifranco'); //$l1 = new ListTask('001','todo1' ,'nifranco');
//$li->set_taches($mt->)

Loading…
Cancel
Save