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

@ -13,7 +13,6 @@ class VisitorController {
$action = $_REQUEST['action']??null; $action = $_REQUEST['action']??null;
switch($action) { switch($action) {
case NULL: case NULL:
echo "pd2";
$this->Reinit(); $this->Reinit();
break; break;
case "goHome": case "goHome":
@ -43,6 +42,7 @@ class VisitorController {
global $rep,$vues,$dataView,$styles; global $rep,$vues,$dataView,$styles;
$model = new MdlListe(); $model = new MdlListe();
$dataView = $model->getPublicList(); $dataView = $model->getPublicList();
require($rep.$vues['accueil']); require($rep.$vues['accueil']);
$vues_erreur= array(); $vues_erreur= array();
} }

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

Loading…
Cancel
Save