diff --git a/Vues/seeList.php b/Vues/seeList.php index 71e3887..c19114a 100644 --- a/Vues/seeList.php +++ b/Vues/seeList.php @@ -60,12 +60,6 @@ else{

List details

- + +
diff --git a/config/config.php b/config/config.php index 6dabb93..af90257 100644 --- a/config/config.php +++ b/config/config.php @@ -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"; /* $login="thchazot1"; diff --git a/controllers/VisitorController.php b/controllers/VisitorController.php index 44787ae..122c81c 100644 --- a/controllers/VisitorController.php +++ b/controllers/VisitorController.php @@ -32,7 +32,7 @@ class VisitorController { require($rep.$vues['signUp']); break; - case "supprimerListe": + case "delList": $this->DelList($dVueEreur); break; case "accessListInfos": @@ -127,11 +127,9 @@ class VisitorController { function DelList($dVueEreur) { global $rep, $vues; - $idListe=$_POST['liste']; - $name=$_POST['name']; - $private=$_POST['private']; + $idListe=$_POST['list']; $model = new MdlListe(); - $model->delete($idListe, $name, $private); + $model->delete($idListe); $_REQUEST['action']=null; $this->reinit(); $dVueEreur= array(); diff --git a/gateway/ListeGateway.php b/gateway/ListeGateway.php index dbfba12..7f36217 100644 --- a/gateway/ListeGateway.php +++ b/gateway/ListeGateway.php @@ -25,13 +25,14 @@ class ListeGateway } } - public function delete(Liste $l): void{ + public function delete(int $id): void{ + $results=findById($id); $tacheGateway=new TacheGateway($this->con); - foreach($l->getTaches() as $taches){ + foreach($results[0]->getTaches() as $taches){ $tacheGateway->delete($taches); } $query = "DELETE FROM Liste where id=:id"; - $this->con->executeQuery($query, array(':id' => array($l->getId(), PDO::PARAM_INT))); + $this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT))); } public function update(Liste $l): void{ diff --git a/modeles/MdlListe.php b/modeles/MdlListe.php index d317e99..37d9c70 100644 --- a/modeles/MdlListe.php +++ b/modeles/MdlListe.php @@ -20,9 +20,9 @@ class MdlListe{ return $l; } - public function delete(Liste $liste){ + public function delete(int $id){ $gate=new ListeGateway($this->con); - $gate->delete($liste); + $gate->delete($id); } public function update(Liste $liste, string $name, bool $private){