Jump to content

The rating for their flight.


bass

Recommended Posts

If you want to see the flight evaluation scale from 0 to 100.

What can I install the code in pirep_viewreport.tpl

2016-03-27_020634.jpg

2016-03-27_020739.jpg

2016-03-27_020807.jpg

<?php
$log = explode('*', $pirep->log);
$sover = $fstall = $pritir = $perfl = $normall = $bad = $vbad = $crash = 0;
foreach($log as $line)
{
if(preg_match('/Overspeed!/i', $line)) $sover = 2;
if(preg_match('/Stall!/i', $line)) $fstall = 15;
if(preg_match('/landed at/i', $line))
{
$rate = explode('at -', $line);
$rate2 = explode('fpm ', $rate[1]);
if($rate2[0] <= 49)
$pritir = 0;
elseif($rate2[0] <= 250 && $rate2[0] >= 49)
$perfl = 0;
elseif($rate2[0] <= 500 && $rate2[0] >= 250)
$normall = 0;
elseif($rate2[0] <= 700 && $rate2[0] >= 500)
$bad = 5;
elseif($rate2[0] <= 1600 && $rate2[0] >= 700)
$vbad = 20;
elseif($rate2[0] >= 1600)
$crash = 99;
}
}
$full = 100;
$report = 100 - $sover - $fstall - $pritir - $perfl - $normall - $bad - $vbad - $crash;
$report = $report <= 0 ? 0 : $report;
if($report < 100)
{
?>
					    <font color="red"> <?php echo $report ?></font>
					    <?php
}
else
{
?>
					    <?php echo $report ?>
					    <?php }
?>

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

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