ukmil Posted January 25, 2013 Report Posted January 25, 2013 Where are the flight phases created? Are they in a file, or part of Acars? I ask, because I want to change the standard names. My VA is Military based, and my aircraft do not do 'boarding' and 'taxi to gate', so I want to change the names rgds Quote
Administrators simpilot Posted January 25, 2013 Administrators Report Posted January 25, 2013 The flight phases in all the acars programs are created within the client except for a little difference in FSAcars. In fsacars.php you will find the following code that you can adjust to your needs. FSAcars provides just a phase number that corosponds to the formats below. $phase_short = array('null', 'Boarding', 'Departing', 'Cruise', 'Arrived'); $phase_detail = array('FSACARS Closed', 'Boarding', 'Taxiing', 'Takeoff', 'Climbing', 'Cruise', 'Landing Shortly', 'Landed', 'Taxiing to gate', 'Arrived'); For the other ACARS clients you are going to either have the client changed or change what is shown on your site using some if statements. Example <?php if($phase == 'taxi to gate'){$phase = 'Flight Complete';} echo $phase; ?> 1 Quote
Curshad Posted February 1, 2021 Report Posted February 1, 2021 On 1/25/2013 at 4:51 PM, simpilot said: The flight phases in all the acars programs are created within the client except for a little difference in FSAcars. In fsacars.php you will find the following code that you can adjust to your needs. FSAcars provides just a phase number that corosponds to the formats below. $phase_short = array('null', 'Boarding', 'Departing', 'Cruise', 'Arrived'); $phase_detail = array('FSACARS Closed', 'Boarding', 'Taxiing', 'Takeoff', 'Climbing', 'Cruise', 'Landing Shortly', 'Landed', 'Taxiing to gate', 'Arrived'); For the other ACARS clients you are going to either have the client changed or change what is shown on your site using some if statements. Example <?php if($phase == 'taxi to gate'){$phase = 'Flight Complete';} echo $phase; ?> Would you mind piecing together for me a working code? I'm trying to display this on my front page map to no success, don't know what the else if isnt working or how to even get it to recognise these. I did see this you posted but that doesn't seem to work when i take out the images and used words. I'd be most greatful ! Above instructions along with this is my reference but i'm stuck lol Quote
Curshad Posted February 1, 2021 Report Posted February 1, 2021 UPDATE: I Believe I've figured it out. For anyone looking for guidance like me this is what i've come up with <?php if ($flight->phasedetail == "Preflight") { echo '<span class="label label-success">Boarding</span>'; } elseif ($flight->phasedetail == "Pushing Back") { echo '<span class="label label-warning">Pushing Back</span>'; } elseif($flight->phasedetail == "Taxiing to Runway"){ echo '<span class="label label-warning">Taxiing to Runway</span>'; } elseif($flight->phasedetail == "Taking Off"){ echo '<span class="label label-warning">Taking Off</span>'; } elseif($flight->phasedetail == "Climbing"){ echo '<span class="label label-warning">Climbing</span>'; }elseif ($flight->phasedetail == "Cruising") { echo '<span class="label label-warning">Cruising</span>'; } elseif ($flight->phasedetail == "Descending") { echo '<span class="label label-warning">Descending</span>'; } elseif ($flight->phasedetail == "Approaching") { echo '<span class="label label-danger">On Approach</span>'; } elseif ($flight->phasedetail == "Final Approach") { echo '<span class="label label-warning">On Final</span>'; } elseif($flight->phasedetail == "Landing"){ echo '<span class="label label-warning">Landing</span>'; } elseif ($flight->phasedetail == "Taxiing to Gate") { echo '<span class="label label-danger">Cleared into Gate</span>'; } elseif ($flight->phasedetail == "Arrived") { echo '<span class="label label-danger">Parked at Gate</span>'; } ?> </td> 1 Quote
Curshad Posted February 3, 2021 Report Posted February 3, 2021 (edited) a few days later ive realized i didn't quite crack it. If anyone has got a clue please let me know. In acarsmap.php the flight phase detail shown for each flight coding is <%=flight.phasedetail%> I tried using code <td> <?php if ('<%=flight.phasedetail%>' == Preflight) { echo '<span class="label label-success">Boarding</span>'; } elseif ('<%=flight.phasedetail%>' == Cruising) { echo '<span class="label label-warning">Cruising</span>'; } ?> </td> But that doesnt seem to show anything, so i thought i fixed it with this: <td><?php if ($flight->phasedetail == 'Preflight') {echo '<span class="label label-success"><img src="https://myvadomain.com/towers2.png" width="15" height="15"></img>Boarding</span>';} elseif ($flight->phasedetail == 'Boarding') ?></td> This does work but i have to add <table> <?php $results = ACARSData::GetACARSData($flight->phasedetail); if (count($results) > 0) { foreach($results as $flight) { if($flight->client == 'FSACARS') {$plane = OperationsData::getAircraftInfo($flight->aircraft);} else {$plane = OperationsData::getAircraftByReg($flight->aircraft);} ?> <?php } } else { ?> <tr><td border="0" width="20%" align="center" colspan="6" style="padding: 5px; font-size: 13px; text-align:center; font-weight: bold; color: #A02626;">No Flights in Progress...</td></tr> <?php } ?> </table> for it to show the phase detail(lets call that code my fix). The problem with that is it is using one flight phase detail and showing it up on others, for example 2 or more pilots would be flying each with a different flight phase but "my fix" would show one flight phase for those 2 or more pilots who would be cruising, landing, etc. I have no idea how to get the if statement to follow this <%=flight.phasedetail%> and not anymore this $flight->phasedetail . I finally tried this <td><?php $flights = ACARSData::GetACARSData(); if ($flights) foreach ($flights as $flight) if ($flight->phasedetail == 'Preflight') {echo '<span class="label label-success"><img src="https://domainname.com/image.png" width="15" height="15"></img>Boarding</span>';}</td> And thats the hottest trail i've come to getting the results im looking for. im going to give up and discontinue this cause I have no clue wat the heck im doing or need to do. I feel like some people know, but the want/need to share knowledge & help just isn't with today's earthling society. If anyone else can point me in the right way i'd be greatful. if not good luck continuing where i've stopped. I have "my fix" along with the above code in the same acarsmap.php file to get the phasedetail to display, so you might want to keep those there. Edited February 3, 2021 by Curshad Quote
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.