Jump to content
Sign in to follow this  
Colin

Latest Flights Map [SOLVED]

Recommended Posts

Hi Guys,

Another quick one, how do I display the latest flights flown on the homepage ?I've tried creating this map a number of times but always results in errors, the type of map I have in mind is the one currently used by Qantas Virtual (pic attached) http://qantasvirtual.com/,

As always any help appreciated and thanks in advance

ZAP0001.png

post-3200-0-79569200-1341064015_thumb.jpg

Share this post


Link to post
Share on other sites

they have modified it but the basic code is

<?php
    $flights = PIREPData::getRecentReportsByCount(10);																	 
    $string = "";
    foreach($flights as $flight)
    {	 
		    $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+';
    }																	 
?>
<img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=wls&MR=900&MX=720x360&PM=b:disc7%2b%25U" width="725 px" /><br />
Maps generated by the <a href="http://www.gcmap.com/">Great Circle Mapper</a> - copyright © <a href="http://www.kls2.com/~karl/">Karl L. Swartz</a>
<!--Start Table-->
<?php
$count = 5;
$pireps = PIREPData::getRecentReportsByCount($count);
?>
<table width="725 px" border="1" bordercolor="#FFFFFF">
  <thead>
 <tr align="center" valign="middle" bgcolor="#7D95AF">
   <th>Flight #</th>
   <th>Departure</th>
   <th>Arrival</th>
   <th>Duration</th>
   <th>Pilot</th>
   <th>Landing Rate</th>
   <th>Aircraft</th>
 </tr>
   </thead>
   <tbody>

<?php
if(count($pireps) > 0)
{
 foreach ($pireps as $pirep)
 {
   $pilotinfo = PilotData::getPilotData($pirep->pilotid);
   $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid);
   echo "<tr>";
   echo "<td align=center> $pirep->code $pirep->flightnum </td>";
   echo "<td align=center> $pirep->depicao </td>";
   echo "<td align=center> $pirep->arricao </td>";
   echo "<td align=center> $pirep->flighttime </td>";
   echo "<td align=center> $pilotid $pilotinfo->firstname $pilotinfo->lastname </td>";
   echo "<td align=center> $pirep->landingrate </td>";
   echo "<td align=center> $pirep->aircraft </td>";
   echo "</tr>";
 }
}
else
{
   echo "<tr><td>There are no recent flights!</td></tr>";
}
?>
</table>
</td>

Share this post


Link to post
Share on other sites

You can also try this

[b]	Ultimos Arrivos[/b]


';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';

echo '';

foreach ($pireps as $pirep)
{

$pilotinfo = PilotData::getPilotData($pirep->pilotid);
$pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid);

echo "";
echo '';
echo "";
//echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
}
echo "</p>										 							Vuelo							Tiempo							Piloto							Landing Rate							Aeronave													[img='.SITE_URL.]							$pirep->code $pirep->flightnum							$pirep->depicao - $pirep->arricao							$pirep->flighttime							$pilotinfo->firstname $pilotinfo->lastname							echo $pirep->landingrate							echo $pirep->aircraft			
";
}
?>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...