IrfanKhan Posted April 5, 2015 Report Share Posted April 5, 2015 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 Quote Link to comment Share on other sites More sharing options...
Members Vangelis Posted April 5, 2015 Members Report Share Posted April 5, 2015 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'; ?> 2 Quote Link to comment Share on other sites More sharing options...
IrfanKhan Posted April 6, 2015 Author Report Share Posted April 6, 2015 Thank you soooo much vangelis you made my day i do appreciate your help and support cheers! SOLVED Quote Link to comment Share on other sites More sharing options...
OA01 Posted April 6, 2015 Report Share Posted April 6, 2015 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> 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.