32 lines
1.3 KiB
PHP
Executable File
32 lines
1.3 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
function ongR($ongActif) {
|
|
$sousOngletsLien = array( "./frmAdmin.php?affAdmin=9&affCde=3&affValR=1", "./frmAdmin.php?affAdmin=9&affCde=3&affValR=2", "./frmAdmin.php?affAdmin=9&affCde=3&affValR=3");
|
|
$sousOngletsTexte = array( "<span class=\"fas fa-clipboard\"></span>Conditions", "<span class=\"fad fa-atom-alt\"></span>Avantages", "<span class=\"fad fa-funnel-dollar\"></span>Règles commerciales");
|
|
|
|
$test ="./frmAdmin.php?affAdmin=9&affCde=3&affValR=" .$ongActif;
|
|
// echo 'test=' .$test;
|
|
|
|
$ongRAff= '<div id="sousMenuO"> <ul id="sousOnglets" >';
|
|
|
|
// boucle qui parcours les deux tableaux
|
|
foreach($sousOngletsLien as $cle=>$lien) {
|
|
// si le nom du fichier correspond a celui pointe par l'indice, alors on l'active
|
|
if ($test == $lien ) { $ongRAff=$ongRAff. '<li class="sactive " >';
|
|
$ongRAff=$ongRAff. '<a href="' .$lien. '">' .$sousOngletsTexte[$cle]. '</a>';
|
|
$ongRAff=$ongRAff. '</li>';
|
|
}
|
|
else {
|
|
$ongRAff=$ongRAff. '<li>';
|
|
$ongRAff=$ongRAff. '<a href="' .$lien. '">' .$sousOngletsTexte[$cle]. '</a>';
|
|
$ongRAff=$ongRAff. '</li>';
|
|
}
|
|
}
|
|
$_SESSION['actifOnglet']=$ongActif;
|
|
$ongRAff.= "</ul>\n</div>";
|
|
// on renvoie le code xHTML
|
|
return $ongRAff;
|
|
}
|
|
|
|
$ongletsR= ongR($affValR);
|
|
?>
|