@ -15,10 +15,23 @@
</header>
<div class="sidenav">
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Clients</a>
<a href="#">Contact</a>
<form method="POST" name="goBackHome" id="GoHome">
<input type="submit" value="Public lists"/>
<input type="hidden" name="action" value="goHome"/>
</form>
<?php
if(isset($_SESSION['login'])){
?>
<input type="submit" value="Private lists"/>
<input type="hidden" name="action" value="viewPrivateList"/>
}
</div>
<div class="main">
@ -2,9 +2,9 @@
$rep = __DIR__ . '/../';
$login="thchazot1";
$password="achanger";
$dsn="mysql:host=localhost;dbname=dbthchazot1"; // chemin vers bd (mysql:host=londres.uca.local;dbname=dblibreton => pour l'iut)
$login="root";
$password="root";
$dsn="mysql:host=localhost;port=8888;dbname=bddDeQualite"; // chemin vers bd (mysql:host=londres.uca.local;dbname=dblibreton => pour l'iut)
//$dsn="mysql:host=localhost;port=8888;dbname=bddDeQualite";
/*
@ -68,7 +68,7 @@ class ListeGateway
public function getPublicLists():array{
public function getPublicList():array{
$listes = [];
$taches = array();
try {
@ -101,6 +101,8 @@ class ListeGateway
return $listes;
@ -38,7 +38,7 @@ class UserGateway
$query = "SELECT * FROM Utilisateur WHERE username=:username";
$this->con->executeQuery($query, array(':username' => array($username, PDO::PARAM_STR)));
$results=$this->con->getResults();
return $results;
return $results[0];
public function getLastId(): array{
@ -55,11 +55,14 @@ class MdlListe{
return $tabListe;
public function findByUser(User $u): array{
public function findByUser(string $username): array{
$gate=new ListeGateway($this->con);
$gateTache=new TacheGateway($this->con);
$gateUser=new TacheGateway($this->con);
$results=$gate->findByUserId($u->getId());
$id=$gateUser->findByName($username);
$id=$id['id'];
$results=$gate->findByUserId($id);
$tabListe=[];
foreach ($results as $row ) {
$tabTache=[];