diff --git a/controllers/VisitorController.php b/controllers/VisitorController.php index 67ab5ff..e69a1c2 100644 --- a/controllers/VisitorController.php +++ b/controllers/VisitorController.php @@ -13,7 +13,6 @@ class VisitorController { $action = $_REQUEST['action']??null; switch($action) { case NULL: - echo "pd2"; $this->Reinit(); break; case "goHome": @@ -43,6 +42,7 @@ class VisitorController { global $rep,$vues,$dataView,$styles; $model = new MdlListe(); $dataView = $model->getPublicList(); + require($rep.$vues['accueil']); $vues_erreur= array(); } diff --git a/gateway/ListeGateway.php b/gateway/ListeGateway.php index edc0f43..c7e19b1 100644 --- a/gateway/ListeGateway.php +++ b/gateway/ListeGateway.php @@ -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; } }