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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
if ($col['journe']===$journee) {
$num_vol=$col['idc'];
$heured=$col['h_depart'];
$heura=$col['h_arrivee'];
$jdep=$col['journe'];
$jarr=$col['jourarr'];
$mode=$col['modele'];
$mode1=substr( $mode, 0, strpos( $mode, '(' ) );
list($h7,$m7)=explode(":",$heur);//heure de connexion
list($h8,$m8,$s8)=explode(":",$heured);//heure de départ
list($h9,$m9,$s9)=explode(":",$heura);//heure d'arrivée
list($a7,$mo7,$j7)=explode("-",$journee);//jour connexion
list($a8,$mo8,$j8)=explode("-",$jarr);//jour arrivée
list($a9,$mo9,$j9)=explode ("-",$jdep);//jour départ
$timestamp7= mktime($h7, $m7, 0, $mo7, $j7, $a7);//heure et jour de connexion
$timestamp8= mktime($h8, $m8, $s8, $mo7, $j7, $a7);//heure départ et jour connexion
$timestamp9= mktime($h9, $m9, $s9, $mo8, $j8, $a8);//heure et jour d'arrivée
$timestamp3= mktime($h8, $m8, $s8, $mo8, $j8, $a8);//heure départ et jour d'arrivée
$timestamp10= mktime($h8, $m8, $s8,$mo9, $j9, $a9);//heure départ et jour de départ
echo "<tr>";
echo "<td align='center' width='60' style='font-family: Verdana; color: black; border-bottom: 2px ridge #990000; border-right: 2px ridge #990000;'>";
echo $num_vol;
echo"</td>";
echo "<td align='center' width='100' style='font-family: Verdana; color: black; border-bottom: 2px ridge #990000; border-right: 2px ridge #990000;'>";
echo "<font size='1'>";
echo $mode1;
echo "</font>";
echo"</td>";
$rechlogo="select * from joueurs where id = '$col[id_com]'";
$trouvlogo=mysql_query($rechlogo);
$logos=mysql_fetch_array($trouvlogo);
$log1=trim($logos['logo']);
echo "<td align='center' width='200' style='font-family: Verdana; color: black; border-bottom: 2px ridge #990000; border-right: 2px ridge #990000'>";
if ($log1=="")
{
echo $logos['Compagnie'];
}
else
{
echo "<img src='http://www.airlines-manager.com/logo/$log1' width='200' height='55' alt='' align='middle' />";
}
echo "</td>";
$requt1="select * from aeroports where hub_ae = '$hub_arr'";
$resul1=mysql_query($requt1);
$col2=mysql_fetch_array($resul1);
$ville1=trim($col2['nom_ville']);
echo "<td align='center' width='200' style='font-family: Verdana; color: black; border-bottom: 2px ridge #990000; border-right: 2px ridge #990000'>";
if ($ville1=="")
{
echo "Aéroport inconnu";
}
else
{
echo $ville1;
}
echo"</td>";
echo "<td align='center' width='50' style='font-family: Verdana; color: black; border-bottom: 2px ridge #990000; border-right: 2px ridge #990000'>";
$heudep=substr($heured,0,5);
echo $heudep;
echo"</td>";
echo "<td align='center' width='200' style='font-family: Verdana; color: black; border-bottom: 2px ridge #990000; border-right: 2px ridge #990000'>";
if (($timestamp7 > $timestamp8) AND ($timestamp7 < $timestamp9))//si l'avion est parti mais pas encore arrivé
{
//pour les 20 premières minutes de vol
$timestamp2 = abs($timestamp7 - $timestamp10);
$dif_heur = floor($timestamp2/3600);
$timestamp2 = $timestamp2 - ($dif_heur * 3600);
$dif_min = $timestamp2 / 60;
if ($dif_heur == 0 AND $dif_min < 2)
{
echo "Airbone";
}
if ($dif_heur == 0 AND $dif_min >= 2 AND $dif_min < 20)
{
echo "Climbing";
}
else
{
//calculer le temps de vol restant
$timestamp4 = abs($timestamp7 - $timestamp9);
$dif_heura = floor($timestamp4/3600);
$timestamp4 = $timestamp4 - ($dif_heura * 3600);
$dif_mina = $timestamp4 / 60;
if ($dif_heura == 0)
{
if ($dif_mina > 35)
{
echo "En-route";
}
elseif ($dif_mina <= 35 AND $dif_mina > 20)
{
echo "Descending";
}
elseif ($dif_mina <= 20 AND $dif_mina > 5)
{
echo "Initial approach";
}
elseif ($dif_mina <= 5 AND $dif_mina >= 3)
{
echo "Final approach";
}
elseif ($dif_mina < 3)
{
echo "Landed";
}
}
else
{
echo "En-route ";//, $dif_heura . " h " . $dif_mina;
}
}
}
elseif ($timestamp7 == $timestamp8) //si l'heure départ est égale à l'heure actuelle
{
echo "Taking-off";
}
elseif ($timestamp7 < $timestamp10) // si l'heure actuelle est inférieure à l'heure de départ
{
$timestamp5 = abs($timestamp7 - $timestamp10);
$diff_heure = floor($timestamp5 / 3600); //Calcul des heures écoulées/restantes
$timestamp5 = $timestamp5 - ($diff_heure * 3600);
$diff_min = $timestamp5 / 60; //Calcul des minutes écoulées/restantes
if ($diff_heure > 0)
{
echo "Départ dans ", $diff_heure . ' h' ." ". $diff_min;
}
if ($diff_heure == 0)
{
if ($diff_min > 30 )
{
echo "Départ dans ", $diff_min . 'mn';
}
elseif ($diff_min <= 30 AND $diff_min > 5)
{
echo "Boarding";
}
elseif ($diff_min <= 5)
{
echo "Taxiing";
}
else
{
echo " ";
}
}
}
elseif ($timestamp7 > $timestamp9)//si l'heure actuelle est supérieure à l'heure d'arrivée
{
echo "Arrived";
}
else
{
echo "pas encore";
}
echo"</td>";
echo"</tr>";
}
}
} |
Partager