Donc j'essai toujours de m'en sortir ....
J'arrive donc à afficher le numéro de département suivant la selection de l'internaute reste juste a afficher le nom du départemant en fonction du numéro.
$nb = $req->rowCount();
if ($req->fetchColumn() > 0) {
// on affiche le h1 en fonction de la region
$region_id = !empty($_REQUEST['region']) ? regionByUrl($_REQUEST['region']) : NULL;
$region_id = !empty($_SESSION['membre']['id_region']) && empty($_REQUEST['region']) ? $_SESSION['membre']['id_region'] : $region_id;
$h1 = $nb.' annonces pour sortir en';
$h1 .= !empty($_REQUEST['loisir']) ? ' <strong> '.$aLoisirs[$_REQUEST['loisir']]."</strong>" : NULL;
$h1 .= !empty($region_id) ? "<strong> - " .$aRegion[$region_id]."</strong>" : NULL;
$h1 .= !empty($_REQUEST['departement']) ? ' '.$_REQUEST['departement'] : NULL; // la ligne ou j'ai fait le changement
$h1 .= !empty($du) ? ", le <strong>" .date('d/m/Y', strtotime($du))."</strong>" : NULL;
echo '<h1>'.$h1.'</h1>'."\n";
}
Donc pour cela je me sert de mon array qui est sous la forme:
$aDepartement = array(
1 => array(67 => 'Bas-Rhin', 68 => 'Haut-Rhin'),
2 => array(24 => 'Dordogne', 33 => 'Gironde', 40 => 'Landes', 47 => 'Lot-et-Garonne', 64 => 'Pyrénées-Atlantiques'),
Donc je penser faire : ( mais ça ne marche pas... Je ne vois pas pourquoi) ...
Il me sort :
Notice: Undefined offset: 67 in Pour le coup 67 correspond bien a l'Alsace...
PS: Mon fichier qui contient mon array est bien intégrer à ma page je vous rassure...
$h1 .= !empty($_REQUEST['departement']) ? ' '.$aDepartement[$_REQUEST['departement']] : NULL; // la ligne ou j'ai fait le changement
Donc j'essai toujours de m'en sortir ....
J'arrive donc à afficher le numéro de département suivant la selection de l'internaute reste juste a afficher le nom du départemant en fonction du numéro.
[php]$nb = $req->rowCount();
if ($req->fetchColumn() > 0) {
// on affiche le h1 en fonction de la region
$region_id = !empty($_REQUEST['region']) ? regionByUrl($_REQUEST['region']) : NULL;
$region_id = !empty($_SESSION['membre']['id_region']) && empty($_REQUEST['region']) ? $_SESSION['membre']['id_region'] : $region_id;
$h1 = $nb.' annonces pour sortir en';
$h1 .= !empty($_REQUEST['loisir']) ? ' <strong> '.$aLoisirs[$_REQUEST['loisir']]."</strong>" : NULL;
$h1 .= !empty($region_id) ? "<strong> - " .$aRegion[$region_id]."</strong>" : NULL;
$h1 .= !empty($_REQUEST['departement']) ? ' '.$_REQUEST['departement'] : NULL; // la ligne ou j'ai fait le changement
$h1 .= !empty($du) ? ", le <strong>" .date('d/m/Y', strtotime($du))."</strong>" : NULL;
echo '<h1>'.$h1.'</h1>'."\n";
}[/php]
Donc pour cela je me sert de mon array qui est sous la forme:
[php]$aDepartement = array(
1 => array(67 => 'Bas-Rhin', 68 => 'Haut-Rhin'),
2 => array(24 => 'Dordogne', 33 => 'Gironde', 40 => 'Landes', 47 => 'Lot-et-Garonne', 64 => 'Pyrénées-Atlantiques'),[/php]
Donc je penser faire : ( mais ça ne marche pas... Je ne vois pas pourquoi) ...
Il me sort : [b]Notice: Undefined offset: 67 in[/b] Pour le coup 67 correspond bien a l'Alsace...
PS: Mon fichier qui contient mon array est bien intégrer à ma page je vous rassure...
[php]$h1 .= !empty($_REQUEST['departement']) ? ' '.$aDepartement[$_REQUEST['departement']] : NULL; // la ligne ou j'ai fait le changement[/php]