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
| $req_xlaps = mysql_query("select DriverName,VehicleClass,Lap,Sec1,Sec2,Sec3,LapTime from xlaps order by LapTime, DriverName ASC");
echo "<div align='center'><h1> Hotlaps $Track</h1><br /><table width='85%' bgcolor='#0000FF' border='1' id='td1'>
<td width='15%'>Pilotes</td>
<td width='15%'>Teams / Mods</td>
<td width='10%'>Nbr. Tours</td>
<td width='10%'><div align='center'>Best Lap</div></td>
<td width='10%'><div align='center'>Différence</div></td>
<td width='10%'><div align='center'>Sect. 1</div></td>
<td width='10%'><div align='center'>Sect. 2</div></td>
<td width='10%'><div align='center'>Sect. 3</div></td></tr></table>";
$values[0] = '#FFEECC';
$values[1] = '#CCCCCC';
$i=0;
$LapTime2 = 0;
while($resultat2=mysql_fetch_array($req_xlaps)){
$Sec1min = mysql_query("select min(Sec1)as Sec1,min(Sec2)as Sec2,min(Sec3)as Sec3 from xlaps") or die (mysql_error());
$res = mysql_numrows($Sec1min);
$Sec1 = mysql_result($Sec1min,$i,"Sec1");
$Sec2 = mysql_result($Sec1min,$i,"Sec2");
$Sec3 = mysql_result($Sec1min,$i,"Sec3");
$i=0;
while($res!=$i){
if($resultat2['Sec1']==$Sec1){$Sec1color="#00FF00";}else{$Sec1color=" ";}
if($resultat2['Sec2']==$Sec2){$Sec2color="#00FF00";}else{$Sec2color=" ";}
if($resultat2['Sec3']==$Sec3){$Sec3color="#00FF00";}else{$Sec3color=" ";}
$bgcolor1 = $values [$i % 2];
$LapTime = $resultat2['LapTime'];
//requete
$LapTime1 = $resultat2['LapTime'];
// différence :
$diff_LapTime = $LapTime1 - $LapTime2;
if($LapTime2=='$LapTime1'){
$diff_LapTime="00.00.000";
}
$LapTime2 = $LapTime1; // (pour la boucle suivante)
echo "<table width='85%' bgcolor='$bgcolor1' border='1' id='td2'>
<td width='15%'>".$resultat2['DriverName']."</td>
<td width='15%'>".$resultat2['VehicleClass']."</td>
<td width='10%'><div align='center'>".$resultat2['Lap']."</div></td>
<td width='10%'><div align='center'>";
echo formate1_temps($LapTime);
echo "<td width='10%'><div align='center'>";
echo formate1_temps($diff_LapTime);
echo "<td width='10%' bgcolor='$Sec1color'><div align='center'>".$resultat2['Sec1']."</div></td>
<td width='10%' bgcolor='$Sec2color'><div align='center'>".$resultat2['Sec2']."</div></td>
<td width='10%' bgcolor='$Sec3color'><div align='center'>".$resultat2['Sec3']."</div></td></tr></table>";
$i++;
} $i++; } |
Partager