main
Thomas Chazot 2 years ago
parent 09e15e4451
commit 1055187d74

@ -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();
}

@ -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;
}
}

Loading…
Cancel
Save