Jump to content

Where do I put this code?


lol767

Recommended Posts

<?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>

I've found this code to make a table of the recent flights

Where should I put this, I've put this code on the layout.tpl but it appears on every page

site: aeroviarias.cz.cc

Link to comment
Share on other sites

  • 2 weeks later...

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...
×
×
  • Create New...