Visualisation du fichier genere_barre.php
<?php
// Récupération des variables
// Exemple d'appel de cette page :
// genere_barre?php?nom_raid=Arcachon . Narbonne & onglet=Fiche
// On récupère les différents paramètre du query en créant les variables avec les noms et les valeurs
//---------------------------------------------------------------------------------------------------
$query_string = getenv("QUERY_STRING");
$query_string = substr($query_string,strpos($query_string, '-')+1,strlen($query_string));
$env_array = split("-", $query_string);
while (list($key, $val) = each($env_array)) {
list($name, $value) = split("=", $val);
$name = urldecode($name);
$value = urldecode($value);
$$name = trim($value) ;
}
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="11"><img src="img/haut_gauche.jpg" width="11" height="15" alt=""/></td>
<?php
$titre_tab = substr($nom_raid, 0, strpos($nom_raid, '.', 0));
$titre_tab .= ' - '.substr($nom_raid, strpos($nom_raid, '.', 0)+1, strlen($nom_raid));
echo "<td class=\"big_title_in_the_ass\" align=\"left\">".$titre_tab."</td>";
echo "<td align=\"left\"><img src=\"img/dh_gros.gif\" width=\"7\" height=\"15\" alt=\"\"/></td>";
echo "</tr>";
echo "<tr valign=\"top\">";
//<!-- on passe au gros contenu -->
echo "<td align=\"left\" width=\"11\"><img src=\"img/bg.jpg\" width=\"11\" height=\"".$hauteur."\"></td>";
echo "<td>";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
echo "<tr><td><br></td></tr>";
echo "<tr>";
// <!-- on dessine les onglets de ce raid -->
echo "<td></td>";
echo "<td valign=\"top\">";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
echo "<tr valign=\"top\">";
// On inclut les variables liée à ce raid
//---------------------------------------
include $nom_raid.".php";
$k = 1;
$separateur = ";";
$n = substr_count($liste_ong, $separateur);
$position_fin = 0;
while ($k < $n) {
$position_dep = strpos($liste_ong, $separateur, $position_fin);
$position_fin = strpos($liste_ong, $separateur, $position_dep+1);
// Il ne faut prendre que le libellé de l'onglet -> avant le -
// Le reste est placé dans le lien.
//------------------------------------------------------------
$ong_tot = substr($liste_ong, $position_dep+1, ($position_fin - $position_dep - 1));
$ong_temp = trim(substr($ong_tot, 0, strpos($ong_tot, '-',0)));
$ad_temp = substr($ong_tot, strpos($ong_tot, '-')+1, strlen($ong_tot));
if ($onglet == $ong_temp) {
// c'est l'onglet demandé par le mec
//----------------------------------
echo "<td><img height=\"20\" src=\"img/ong_gauche_actif.jpg\" alt=\"\"></td>\n\t\t";
echo "<td>\n\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t";
echo "<tr><td><img width=\"100%\" height=\"7\" src=\"img/ong_haut_actif.jpg\" alt=\"\"></td></tr>\n\t\t\t";
echo "<tr valign=\"top\"><td class=\"ong_actif\"><a href=\"".$ad_temp."\">".$ong_temp."</a></td></tr>\n\t\t\t";
echo "</table>\n\t\t</td>\n\t\t";
echo "<td><img height=\"20\" src=\"img/ong_droite_actif.jpg\" alt=\"\"></td>\n\t\t";
} else {
// ben c'est un autre ou alors ça marche pas !!
//---------------------------------------------
echo "<td><img height=\"20\" src=\"img/ong_gauche_inactif.jpg\" alt=\"\"></td>\n\t\t";
echo "<td>\n\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t";
echo "<tr><td><img width=\"100%\" height=\"7\" src=\"img/ong_haut_inactif.jpg\" alt=\"\"></td></tr>\n\t\t\t";
echo "<tr valign=\"top\"><td class=\"ong_inactif\"><a href=\"".$ad_temp."\">".$ong_temp."</a></td></tr>\n\t\t\t";
echo "</table>\n\t\t</td>\n\t\t";
echo "<td><img height=\"20\" src=\"img/ong_droite_inactif.jpg\" alt=\"\"></td>\n\t\t";
}
$k = $k+1;
}
?>
</tr>
</table>
</td>
<td></td>
</tr>
<tr>
<!-- la ligne du bas de l'onglet -->
<td align="right" width="4"><img src="img/gauche_gris.jpg" width="4" height="20"></td>
<td valign="top"><img src="img/haut_gris.gif" width="100%" height="1" alt=""></td>
<td align="right" width="1"><img src="img/droit_gris.gif" width="1" height="20"></td>
</tr>
<tr valign="top">
<!-- le contenu de l'onglet choisi, c'est le seul truc qui change ici -->
<?php
echo "<td align=\"right\" width=\"4\"><img src=\"img/gauche_gris.jpg\" width=\"4\" height=\"".($hauteur-60)."\"></td>";
echo "<td align=\"center\" valign=\"top\">";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
// La génération de la fiche va tenir compte du fichier à importer
//----------------------------------------------------------------
include $fichier;
echo "</table>";
echo "</td>";
echo "<td><img src=\"img/droit_gris.gif\" width=\"1\" height=\"".($hauteur-60)."\"></td>";
?>
</tr>
<tr>
<!-- la barre en bas de la fiche de l'nogelt pour fermer totalement -->
<td></td>
<td><img src="img/bas_gris.jpg" width="100%" height="4" alt=""></td>
<td></td>
</tr>
</table>
</td>
<?php
echo "<td align=\"right\"><img src=\"img/db.gif\" width=\"1\" height=\"".$hauteur."\"></td>";
?>
</tr>
<tr>
<!-- la barre en bas de la fiche de l'nogelt pour fermer totalement -->
<td><img src="img/bas_gauche.jpg" width="100%" height="4" alt=""></td>
<td><img src="img/bas.jpg" width="100%" height="4" alt=""></td>
<td><img src="img/bas.jpg" width="7" height="4" alt=""></td>
</tr>
</table>