Jump to content

Booked Flights


Fernando

Recommended Posts

I searched here in the forum something like Booked Flights,

thought, but nothing worked properly.

I visualized the Admin Center, my pilots booked 18 flights, but not me this script returns the same flights on the Frontpage_main.tpl,.

Someone has something similar like this

http://airmaltavirtu...ex.php/bookings

The script I have is this, but he did not return the you that I see in the admin center.

Current Booked Flights</h3>
<?php /*echo '<pre>'; print_r($allbids); echo '</pre>';*/
if(!$allbids)
{
 echo 'There are no bids!';
 return;
}
?>
<table id="tabledlist" class="tablesorter">
<thead>
<tr>
 <th>Route</th>
 <th>Pilot</th>
 <th>Day Filed</th>
 <th>Options</th>
</tr>
</thead>
<tbody>
<?php
foreach($allbids as $bid)
{?>
<tr id="row<?php echo $bid->bidid?>">
 <td><?php echo $bid->code.$bid->flightnum."({$bid->depicao} - {$bid->arricao})"?></td>
 <td><?php echo PilotData::GetPilotCode($bid->code, $bid->flightnum).' - '.$bid->firstname.' '.$bid->lastname; ?></td>
 <td><?php echo $bid->dateadded; ?></td>
 <td>
 <button href="<?php echo url('/schedules/brief/'.$bid->routeid);?>">
				 Brief</button>
		 </td>
 </tr>
<?php } ?>
</tbody>
</table>

GLO0004.png

Commercial Pilot

www.voegolv.net

Link to comment
Share on other sites

  • Moderators

I would do this in the following order.

First, place this in your front page:

<?php MainController::Run('FrontBids', 'RecentFrontPage', 10); ?>

Secondly, go to frontpage_recentbids.tpl and put what you want to show there. Below is the default code in there:

<?php
if(!$lastbids)
{
echo 'No bids have been made';
return;

}
foreach($lastbids as $lastbid);
{
?>
<style type="text/css">
<!--
.style2 {
font-family: Arial;
font-size: 10px;
}
-->
</style>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
 <tr>
   <td><p class="style2"><?php echo $lastbid->bidid . ' - ' . $lastbid->code.$lastbid->flightnum.' - '.$lastbid->depicao.' to '.$lastbid->arricao?></a>
       </p>
       <?php
}
?></p></td>
 </tr>
</table>

Remember you can put any number instead of 10 in the first code and that's the number of rows it will return. ;)

Link to comment
Share on other sites

  • Moderators

Replace the entire code in frontpage_recentbids.tpl with the following:

<?php
if(!$lastbids)
{
echo 'No bids have been made';
return;

}
foreach($lastbids as $lastbid);
{
?>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td>Flight #</td>
<td>Pilot</td>
<td>Departure</td>
<td>Arrival</td>
<td>Aircraft</td>
</tr>
<tr>
<td><?php echo $lastbid->code.$lastbid->flightnum ;?></td>
<td>
<?php
$pilotid = $lastbid->pilotid;
$pilot = PilotData::getPilotData($pilotid);
echo $pilot->firstname.' '.$pilot->lastname ;?>
</td>
<td><?php echo $lastbid->depicao ;?></td>
<td><?php echo $lastbid->arricao ;?></td>
<td><?php echo $lastbid->aircraft ;?></td>
</tr>
</table>
<?php
}
?>

Link to comment
Share on other sites

  • 1 month later...
  • Administrators

Are you setting the number of records to return as parkho indicates in the first post?

<?php MainController::Run('FrontBids', 'RecentFrontPage', 10); ?>

The '10' is how many to return.

You also could move the foreach loop further down in the code to not include the title row for every record and just include the body of the table in the loop.

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