diff --git a/Hierarchy.php b/Hierarchy.php index 327e6af66be89c6e45b6536050fbf6115f5307fc..50232b294b432280ac1851e8e3484cce682509a7 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>'; }