diff --git a/Hierarchy.php b/Hierarchy.php index bfc8dbb4376eb3d423da14b8691d1a9112608946..6c065a60900353bebf36bb36942136c774e18a29 100644 --- a/Hierarchy.php +++ b/Hierarchy.php @@ -45,6 +45,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'; @@ -52,6 +53,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); @@ -64,7 +67,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>'; } @@ -74,7 +77,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>'; }