J'ai un probleme avec le codage de cette page : http://skydanceshow.free.fr/dev_final_v ... recherche=
Les boutons de redirection "Faites votre propre recherche" fonctionnent correctement sous Firefox, mais sous IE... si quelqu'un à une idée, je suis preneur.
Cordialement,
Seb
Voici le code de cette page :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Skydance Show - <?php echo "$page"; ?></title>
</head>
<?php include "../../connexion.php3"; ?>
<body background="../../graph/fond.jpg">
<?php
function table2html($tri,$filtre,$recherche){
$sql = "SELECT jour,danse,niveau,lieu,horaire,professeur,couleur_fond,couleur_ecriture,cours.id FROM `cours`,`salle` WHERE lieu=ville ORDER BY $tri,lieu,horaire ASC";
$mysqlResult = mysql_query($sql) or die ('Erreur SQL!<br>'.$sql.'<br>'.mysql_error());
// Détermine la structure du tableau
$fields = mysql_num_fields($mysqlResult);
$totalLen = 0;
// Construction de vecteurs avec les noms et la longueur des champs
for ($i = 0; $i < $fields-1; $i++) {
$tableN[$i] = mysql_field_name($mysqlResult,$i);
$tableL[$i] = mysql_field_len($mysqlResult,$i);
$totalLen = $totalLen + $tableL[$i];
}
$totalLen = $totalLen + 6;
$tableN[0]="Jour";
$tableN[1]="Danse";
$tableN[2]="Niveau";
$tableN[3]="Lieu";
$tableN[4]="Horaires";
$tableN[5]="Professeur";
$tabletri[0]="id_tri";
$tabletri[1]="danse";
$tabletri[2]="niveau";
$tabletri[3]="lieu";
$tabletri[4]="horaire";
$tabletri[5]="professeur";
// Ajout de la largeur des colonnes en % pour le tableau en HTML à afficher.
$som = 6;
for ($i = 0; $i < $fields-2; $i++) {
$tableP[$i] = intval($tableL[$i]/$totalLen*1);
$som = $som + $tableP[$i];
}
// De cette façon je m'assure que la longueur totale du tableau est 100%
$tableP[$fields-2] = 1 - $som;
// Début de la construction du tableau HTML
$htmlTable = "";
$htmlTable .= "<TABLE width=100% border=1>";
// Ajout de l'entête du tableau
$htmlTable .= "<TR>";
for ($i = 0; $i < $fields-3; $i++) {
$htmlTable .= "<TD width=$tableP[$i]% bgcolor=\"#FFFF00\" align=center ><a href=../code/sds_cours_tri_fra.php3?tri=$tabletri[$i]&filtre=$filtre&recherche=$recherche><B>$tableN[$i]</B></a></TD>";
}
$htmlTable .= "</TR>";
// Maitenant le vrai boulot: on construit le tableau!
$rows = mysql_num_rows($mysqlResult);
for ($j = 0; $j < $rows; $j++) {
$id = mysql_result($mysqlResult,$j,5);
}
$bgcolor = "";
$writecolor = "";
$liste_site = mysql_query($sql);
while($site = mysql_fetch_array($liste_site))
{
// Et maintenant en couleur suivant le lieu
if ($ville['lieu'] == $ville)
{
$bgcolor = $site["couleur_fond"];
$writecolor = $site["couleur_ecriture"];
}
else
{
$bgcolor = '';
$writecolor = '';
}
$htmlTable .= "<TR><TD bgcolor=".$bgcolor."><font color=".$writecolor.">\n";
$htmlTable .= $site['jour']."</font>\n";
$htmlTable .= "</TD>\n";
$htmlTable .= "<TD bgcolor=".$bgcolor."><font color=".$writecolor.">\n";
$htmlTable .= $site['danse']."</font>\n";
$htmlTable .= "</TD>\n";
$htmlTable .= "<TD bgcolor=".$bgcolor."><font color=".$writecolor.">\n";
$htmlTable .= $site['niveau']."</font>\n";
$htmlTable .= "</TD>\n";
$htmlTable .= "<TD bgcolor=".$bgcolor."><font color=".$writecolor.">\n";
$htmlTable .= $site['lieu']."</font>\n";
$htmlTable .= "</TD>\n";
$htmlTable .= "<TD bgcolor=".$bgcolor."><font color=".$writecolor.">\n";
$htmlTable .= $site['horaire']."</font>\n";
$htmlTable .= "</TD>\n";
$htmlTable .= "<TD bgcolor=".$bgcolor."><font color=".$writecolor.">\n";
$htmlTable .= $site['professeur']."</font>\n";
$htmlTable .= "</TD>\n";
$htmlTable .= "</TR>\n";
}
// Et le tableau HTML est créé!
$htmlTable .= "</TABLE>";
return $htmlTable;
}
$tri = $_GET["tri"];
$filtre = $_GET["filtre"];
$recherche = $_GET["recherche"];
// Affichage de la liste
print(table2html($tri,$filtre,$recherche));
print(" <br>");
print(" <br>");
print("<a href=../code/sds_cours_tri_fra.php3?tri=id_tri&filtre=jour&recherche=><center><input type='submit' value='Faite votre propre recherche!'></center></a>");
// Fermeture de la connexion MySQL
mysql_close ();
?>
</body>
</html>