faraz Posted December 18, 2009 Report Share Posted December 18, 2009 HI I need show aircraft current location in Fleet page in public and in schedule result . please help me! TNX Quote Link to comment Share on other sites More sharing options...
RogerB Posted December 19, 2009 Report Share Posted December 19, 2009 If you search I believe this has been explained. Quote Link to comment Share on other sites More sharing options...
hjhjhgjgjh Posted December 19, 2009 Report Share Posted December 19, 2009 i am interested in that also but didnt find anything via search function Quote Link to comment Share on other sites More sharing options...
faraz Posted December 19, 2009 Author Report Share Posted December 19, 2009 If you search I believe this has been explained. didnt find anything via search . if you know how to show aircraft current location, please tell me ! TNX Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 19, 2009 Administrators Report Share Posted December 19, 2009 As of next release, you can do: <?php $params( array('a.registration'=>'[Registration]', 'p.accepted'=>PIREP_ACCEPTED ); $pirep = PIREPData::findPIREPS($params, 1); $current_location = $pirep->arricao; To give you the current location of the aircraft with the given registration. It'll be explained in the build notes. Quote Link to comment Share on other sites More sharing options...
markusr Posted January 10, 2010 Report Share Posted January 10, 2010 Do you have a link to an example how to get the current location of an aircraft ? Taht would be nice. Thanks, Mark Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 11, 2010 Administrators Report Share Posted January 11, 2010 The code I pasted above is an example. http://docs.phpvms.net/development/searching_schedules_and_pireps Quote Link to comment Share on other sites More sharing options...
markusr Posted January 11, 2010 Report Share Posted January 11, 2010 I tried the following in my fleet code: <h2>Fleet overview </h2> <?php $allaircraft = OperationsData::GetAllAircraft(); ?> <?php if(!$allaircraft) { echo '<p id="error">No aircraft have been added</p>'; return; } ?> <table border="1"> <thead> <tr><td><b>ICAO</b></td><td><b>Type</b></td><td><b>Registration</b></td> <td><b>Range in nm </b></td> <td><b>Empty Weight in kg </b></td> <td><b>Cruise Alt</b></td><td><b>Max Pax</b></td><td><b>Current Location</b></td></tr> </thead> <tbody> <?php foreach ($allaircraft as $aircraft) { ?> <?php $params = (array('a.registration'=>'[Registration]', 'p.accepted'=>PIREP_ACCEPTED)); $pirep = PIREPData::findPIREPS($params); $current_location = $pirep->arricao; ?> <tr> <td><?php echo $aircraft->icao; ?> </td> <td><?php echo $aircraft->fullname; ?> </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><?php echo $aircraft->maxpax; ?></td> <td><?php echo $pirep->arricao; ?></td> </tr> <?php } ?> </tbody> </table> But the location won't be shown for each aircraft... Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted January 11, 2010 Administrators Report Share Posted January 11, 2010 You have to replace [Registration] with the variable with the registration: <?php $params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED)); $pirep = PIREPData::findPIREPS($params); $current_location = $pirep[0]->arricao; ?> Quote Link to comment Share on other sites More sharing options...
markusr Posted January 11, 2010 Report Share Posted January 11, 2010 thanks alot. i also have now included the arrivial name: <?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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.