Jump to content

Recommended Posts

Posted

Dear Members i would like to ask for the help to please advise me as how to get the output text such as greased landing, Hard Landing etc

for example

Pilot submitted the PIREP with -850 ft/min landing rate i would like to get an small text showing weather it is hard landing or greased landing like this -850 ft/min (HARD LANDING) same goes for greased landing i tried the below code but doesn't seems to be working for me as i am not getting an idea how to put < less than or > greater than values between the code please help.

<?php if($pirep->landingrate == '> -750') {echo 'Hard Landing';} else {echo "{$pirep->landingrate} ft/min"; }?>

how i can put different landing status?

Thanks

  • Members
Posted

where do you want to display it in the pirep view ?

This is the code to display it in pirep_viewreport.tpl

What i have done is convert the negative numbers into positives and then put it against the if

  <?php
	 if(abs($pirep->landingrate) <= 450)
	    echo 'Greased Landing';
    elseif( abs($pirep->landingrate) >=451  && abs($pirep->landingrate) <= 600)
	    echo 'Good Landing';
 elseif( abs($pirep->landingrate) >=601  && abs($pirep->landingrate) <= 800)
	    echo 'Not so good Landing';
   elseif( abs($pirep->landingrate) >=801  && abs($pirep->landingrate) <= 5000)
	    echo 'Well done you just crashed the airplane';
    ?>

  • Like 2
Posted

GREAT piece of code. Here's my take on it...

<li><strong>Landing Report: </strong><?php if(abs($pirep->landingrate) <= 100)
				    echo 'Have we landed yet? Greased Landing!';
		    elseif( abs($pirep->landingrate) >=101  && abs($pirep->landingrate) <= 150)
				    echo 'Smooth Landing, well done!';
  elseif( abs($pirep->landingrate) >=151  && abs($pirep->landingrate) <= 199)
				    echo 'SCREECH! Average Landing.';
  elseif( abs($pirep->landingrate) >=200  && abs($pirep->landingrate) <= 299)
				    echo 'BUMP! Not to bad.';
  elseif( abs($pirep->landingrate) >=300  && abs($pirep->landingrate) <= 399)
				    echo 'BOUNCE! BUMP! THUMP! Poor landing.';
  elseif( abs($pirep->landingrate) >=400  && abs($pirep->landingrate) <= 499)
				    echo 'Ouch! Passengers thought they had crashed!';
 elseif( abs($pirep->landingrate) >=500  && abs($pirep->landingrate) <= 599)
				    echo 'Hard Landing! You burst a tyre.';
  elseif( abs($pirep->landingrate) >=600  && abs($pirep->landingrate) <= 650)
				    echo 'The tyres have burst & the undercarriage is badly damaged!';
	    elseif( abs($pirep->landingrate) >=651  && abs($pirep->landingrate) <= 5000)
				    echo 'Undercarrage has collasped! This PIREP has been rejected!';?></li>

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