|
|
|
@ -75,34 +75,31 @@ class ListeGateway
|
|
|
|
|
|
|
|
|
|
$query = "SELECT * FROM Liste WHERE idCreator IS NULL";
|
|
|
|
|
|
|
|
|
|
$co->executeQuery($query, []);
|
|
|
|
|
$this->con->executeQuery($query, []);
|
|
|
|
|
|
|
|
|
|
$results = $this->con->getResults();
|
|
|
|
|
|
|
|
|
|
foreach($results as $row){
|
|
|
|
|
$idListe = $row['id'];
|
|
|
|
|
$queryTaches = "SELECT * FROM Tache WHERE idListe=:idListe";
|
|
|
|
|
$this->con->executeQuery($queryTaches, array(':idListe' => array($idListe, PDO::PARAM_INT)));
|
|
|
|
|
$resultsTaches = $co->getResults();
|
|
|
|
|
|
|
|
|
|
$resultsTaches = $this->con->getResults();
|
|
|
|
|
foreach($resultsTaches as $rowTaches){
|
|
|
|
|
if($rowTaches['complete']=="0"){
|
|
|
|
|
$taches[] = new Tache($rowTaches['id'], $rowTaches['nom'],false,$idListe);
|
|
|
|
|
$taches[] = new Tache($rowTaches['id'], $rowTaches['name'], $rowTaches['content'],false);
|
|
|
|
|
}else{
|
|
|
|
|
$taches[] = new Tache($rowTaches['id'], $rowTaches['nom'],true,$idListe);
|
|
|
|
|
$taches[] = new Tache($rowTaches['id'], $rowTaches['name'], $rowTaches['content'],true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$listes[] = new Liste($row['id'], $row['nom'],null, $taches);
|
|
|
|
|
$listes[] = new Liste($row['id'], $row['name'],false, null, $taches);
|
|
|
|
|
$taches = null;
|
|
|
|
|
}
|
|
|
|
|
echo "wesh";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch(PDOException $Exception) {
|
|
|
|
|
echo 'erreur';
|
|
|
|
|
echo $Exception->getMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $listes;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|