Jump to content

Last Aircraft position


shiljo

Recommended Posts

  • Moderators

You can add this to your page:

<?php
$pilotid = Auth::$userinfo->pilotid;
$report = PIREPData::getlasreports($pilotid, 1);
$aircraft = OperationsData::getaircraftinfo($report->aircraft);
?>
<table>
<tr><td>Aircraft</td><td>Aircraft Location</td></tr>
<tr><td><?php echo $aircraft->name ;?></td><td><?php echo $report->arricao ;?></td></tr>
</table>

You can add this to any page that you want. :D

Link to comment
Share on other sites

Thank you Parkho, but i want that to incorporate that shows last location of aircraft, together wizh all A/C data such as Type, REg, Hours Flown, routes flown, cargo carried, status (GND or flight or reserved)...etc...Thare has been one script...but i lost track of it...So if such thing exist i would be very preciated to have that code...:)

Thank you very much

Link to comment
Share on other sites

You can add this to your page:

<?php
$pilotid = Auth::$userinfo->pilotid;
$report = PIREPData::getlasreports($pilotid, 1);
$aircraft = OperationsData::getaircraftinfo($report->aircraft);
?>
<table>
<tr><td>Aircraft</td><td>Aircraft Location</td></tr>
<tr><td><?php echo $aircraft->name ;?></td><td><?php echo $report->arricao ;?></td></tr>
</table>

You can add this to any page that you want. :D

Here is my code of fleet page...can you give me hint what to edit???

<h3>fleet</h3>
 </br>	
<div class="CSSTableGenerator" >
<table>

<tr>
<td><b>ICAO</b></td>
<td><b>Type</b></td>
<td><b>Registration</b></td>
<td><b>Range</b></td>
<td><b>Empty Weight</b></td>
<td><b>Cruise Alt</b></td>
<td><b>Cargo carried</b></td>
<td><b>Total Hours</b></td>
<td><b>Total Routes Flown</b></td>
<td><b>Aircraft status</b></td>
<td><b>Location</b></td>
</tr>
<?php $fleet = OperationsData::GetAllAircraft(); ?>
<?php foreach ($fleet as $aircraft)
{
?>
<tr>
<td><?php echo $aircraft->icao; ?> </td>
<td><?php echo $aircraft->name; ?> </td>
<td><?php echo $aircraft->registration; ?></td>
<td><?php echo $aircraft->range; ?> </td>
<td><?php echo $aircraft->weight; ?></td>
<td><?php echo $aircraft->cruise; ?></td>
<td><#></td>
<td><?php echo $aircraft->totaltime; ?></td>
<td><?php echo $aircraft->routesflown; ?></td>
<td><#></td>
<?php
$params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED));
$pirep = PIREPData::findPIREPS($params);
$current_location = $pirep[0]->arricao;
$current_location2 = $pirep[0]->arrname;
?>
<td><?php echo $current_location.'-'.$current_location2; ?></td>
</tr>
<?php } ?>
</table>
</div>

I am missing, caego carried...i dont know how to get that...status...GND, FLIGHT or RESERVED if possible and total time and routes flown...number of them...i have code for that inside, but i assume wrong one, doesnt show anything...thank you very much

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