From 2ddf1325e5d2dbd3a9341ccff2896ee2abd02fba Mon Sep 17 00:00:00 2001 From: ALGLAVE Ivan <ivan.alglave8@etu.univ-lorraine.fr> Date: Thu, 3 Dec 2020 11:05:10 +0100 Subject: [PATCH] debug_1 --- Hierarchy.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Hierarchy.php b/Hierarchy.php index 327e6af..50232b2 100644 --- a/Hierarchy.php +++ b/Hierarchy.php @@ -39,6 +39,7 @@ return null; // A FAIRE } + if(!isset($_GET['element'])) { // Si on ouvre la Hiérachie pour la première fois, on part de 'Aliment' $aliment = 'Vin effervescent'; @@ -46,6 +47,8 @@ // Sinon on récupère l'aliment en cours $aliment = $_GET['element']; } + + echo '<script>alert('."'".$aliment."'".');</script>'; $sup_cat = get_super_categories($aliment); $sous_cat = get_sous_categories($aliment); @@ -58,7 +61,7 @@ echo '<div class="category-view">'; echo '<h1> Super-catégories de '.$aliment.' </h1>'; foreach($sup_cat as $cat) { - echo '<li><button onclick="notifyParent('.$cat.');">'.$cat.'</button></li>'; + echo '<li><button onclick="notifyParent('."'".$cat."'".');">'.$cat.'</button></li>'; } echo '</div>'; } @@ -68,7 +71,7 @@ echo '<h1> Sous-catégories de '.$aliment.' </h1>'; foreach($sous_cat as $cat) { //echo '<li><button onclick="notifyParent('.$cat.');">'.$cat.'</button></li>'; - echo '<li><button onclick="alert('.$cat.');">'.$cat.'</button></li>'; + echo '<li><button onclick="notifyParent('."'".$cat."'".');">'.$cat.'</button></li>'; } echo '</div>'; } -- GitLab