Hello,
I'm trying to create a code that alter the condition of the aircraft when a pirep is been submitted.
it looks to the landing rate, so when the landing rate is below 200 than 0.5% off the condition.
when a landing rate is higher than 200 than 2% of condition. when a landing rate is higher than 500 than 50% off condition.
so far i have:
$pos = find_in_fsacars_log('TouchDown:Rate', $log);
$landingrate = str_replace('TouchDown:Rate', '', $log[$pos]);
$count = preg_match('/([0-9]*:[0-9]*).*([-+]\d*).*/i', $landingrate, $matches);
if($count > 0)
{
PIREPData::editPIREPFields($report->pirepid, array('landingrate' => $matches[2]));
}
PIREPData::AppendToLog($report->pirepid, $_GET['log']);
if ($count < -200)
{
aircraftdata::editaircraftfields($report->pirepid, array('cond' => $matches[100-0,5]))
}
if ($count > -200)
{
aircraftdata::editaircraftfields($report->pirepid, array('cond' => $matches[100-2]))
}
if ($count > -500)
{
aircraftdata::editaircraftfields($report->pirepid, array('cond' => $matches[100-50]))
}
the most is from the fsacars config file
could anyone help me with this?
thanx!
grtz, Jacques