if ($count > 0) { $landingrate = $matches[2]; } else { $landingrate = 0; } # Get our aircraft $reg = trim($_GET['reg']); $ac = OperationsData::GetAircraftByReg($reg); # Do some cleanup $_GET['origin'] = DB::escape($_GET['origin']); $_GET['dest'] = DB::escape($_GET['dest']); # Get schedule info, using minimal information # Check if they forgot the flight code if ($code == '') { # Find a flight using just the flight code $sched = SchedulesData::FindFlight($flightnum); # Can't do it. They completely f****d this up if (!$sched) { return; } $code = $sched->code; $flightnum = $sched->flightnum; if ($_GET['origin'] != $sched->depicao || $_GET['dest'] != $sched->arricao) { $comment = 'phpVMS Message: Arrival or Departure does not match schedule'; } } # Make sure airports exist: # If not, add them. if (!OperationsData::GetAirportInfo($_GET['origin'])) { OperationsData::RetrieveAirportInfo($_GET['origin']); }