1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| <?php
//les includes..
//connexion à la DB
$rDAO=new RegionDAO($db);
$reg=new Region();
$regions=$rDAO->getList($reg);
$domDAO=new DomaineDAO($db);
$listeChoix = array();
/*Si un element du menu est choisi, on affiche le sous menu correspondant*/
if(isset($_GET['choix'])){
$dms=$domDAO->getListByRegion(($_GET['choix']));
foreach($dms as $domaine){
$listeChoix[] = $domaine->getNom_domaine();
}
} else {
foreach ($regions as $region) {
$listeChoix[$region->getId_region()] = $region->getNom_region();
}
}
?>
<!DOCTYPE hmlt>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>Recherche par étape</title>
</head>
<body>
<fieldset>
<legend></legend>
<?php
foreach($listeChoix as $i=>$choix){ ?>
<a href="?choix=<?php echo $i;?>"> <?php echo $choix;?></a></br>
<?php
}
?>
</fieldset>
</body>
</html> |
Partager