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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
$tabPasse= array ();
$tabPresent= array ();
$tabFutur= array ();
$IDPage=1;
$n=0;
array_unshift($tabFutur, $IDPage);
echo "<table border=1>";
echo "<tr>";
for ($i=1;$i<=36;$i++){
echo "<th width=\"50\">P$i</th>";
}
echo "</tr>";
while (count($tabFutur)<>0) {
$n++;
echo "<tr><td width=\"100\">Rang : $n</td>";
foreach ($tabFutur as $IDPage) {
$IDPage = array_shift($tabFutur);
array_push($tabPresent, $IDPage);
}
$p = count($tabPresent);
for ($i=1;$i<=(18-($p+1));$i++){
echo "<td width=\"50\"> </td>";
}
foreach ($tabPresent as $IDPage) {
$IDPage = array_shift($tabPresent);
$trouver=false;
foreach ($tabPasse as $IDPagePasse) {
if ($IDPagePasse==$IDPage) {
$trouver=true;
}
}
if ($trouver==false) {
//IDPage n'a jamais été traité
$colspan=0;
$requete=mysql_db_query($sql_bdd,"select * from bookdem where IDPage=\"$IDPage\"",$db_link) or die(mysql_error());
$Sortie1=mysql_result($requete,0,"Sortie1");
if ($Sortie1<>0) {array_push($tabFutur, $Sortie1);$colspan++;}
$Sortie2=mysql_result($requete,0,"Sortie2");
if ($Sortie2<>0) {array_push($tabFutur, $Sortie2);$colspan++;}
$Sortie3=mysql_result($requete,0,"Sortie3");
if ($Sortie3<>0) {array_push($tabFutur, $Sortie3);$colspan++;}
$Sortie4=mysql_result($requete,0,"Sortie4");
if ($Sortie4<>0) {array_push($tabFutur, $Sortie4);$colspan++;}
$Sortie5=mysql_result($requete,0,"Sortie5");
if ($Sortie5<>0) {array_push($tabFutur, $Sortie5);$colspan++;}
$Sortie5=mysql_result($requete,0,"Sortie6");
if ($Sortie6<>0) {array_push($tabFutur, $Sortie6);$colspan++;}
$IDSpecial=mysql_result($requete,0,"IDSpecial");
echo "<td width=\"50\" colspan=\"$colspan\">$IDPage";
}
echo "</td>";
} Else {
//IDPage a déjà été traité
echo "<td width=\"50\"><font color=\"red\">* $IDPage</font></td>";
}
array_unshift($tabPasse, $IDPage);
}
echo "</tr>";
}
echo "</table>"; |
Partager