Jump to content

Flight Bids Airport name Instead of ID [SOLVED]


LuxuryCEO

Recommended Posts

hi guys

am working on my flight bids board

but instead of the board showing the ID ( ICAO ) i cant it to show the airport name

what i mean is instead of EGAA - EGCC for example i want it to be Belfast - Manchester

the preview is here >> http://www.flyluxva....x.php/FrontBids

heres the code hope you can help me

<div id="mainbox">
<?php
if(!$lastbids)
{
echo '<p align="center">No flights have currently been booked</p>';
return;
}
?>
<table width="101%" class="tablesorter">
<thead>
<tr bgcolor="#000099">
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Airline</font></div></th>	
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Flight Number</font></div></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Departure</font></div></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Arrival</font></div></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Aircraft</font></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Tail No.</font></div></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Flight Time</font></div></th>
<th align="center" background='images/tables/tableheading.png'> <font face='Verdana' size='1' color="#FFFFFF">Status</font></div></th>
</tr>
</thead>
<tbody>
<?php
foreach($lastbids as $lastbid)
{
?>
<tr bgcolor="#333333">
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><img src="/images/airline/LAV/LAV.png">LUXURY AIRWAYS</span></td>
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $lastbid->code . $lastbid->flightnum; ?></a> </td>
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $lastbid->depicao; ?></span></td>
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $lastbid ->arricao;?></span></td>
<?php
$params = $lastbid->pilotid;
$pilot = PilotData::GetPilotData($params);
$pname = $pilot->firstname;
$psurname = $pilot->lastname;
?>
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $lastbid->aircraft; ?></span></td>
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $lastbid->registration?></td>
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $lastbid->flighttime; ?> Hours</span></td>
<td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><img src="/images/blink_gruen_anim.gif"></span></td>
</tr>	
<?php
}
?>
</tbody>
</table>
<hr>
</div>

Regards

Michael

Link to comment
Share on other sites

  • Moderators

Add the following right after bracket where the foreach starts:

$airp1 = OperationsData::getairportinfo($lastbid->depicao);
$airp2 = OperationsData::getairportinfo($lastbid->arricao);

Now in <td> for departure airport data replace the following:

<?php echo $lastbid->depicao :?>

with this:

<?php echo $airp1->name ;?>

And for arrial:

<?php echo $airp2->name ;?>

And your home safe. :D

Link to comment
Share on other sites

Add the following right after bracket where the foreach starts:

$airp1 = OperationsData::getairportinfo($lastbid->depicao);
$airp2 = OperationsData::getairportinfo($lastbid->arricao);

youve lost me on this part

heres what ive got so far >>

  <td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $airp1->name ;?></span></td>
  <td align=center background='images/tables/board.png'> <font face=Verdana size=1 color=#E8D33D><?php echo $airp2->name ;?></span></td>

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