public function ReadHeader($extBruType, $extFilePath) { $bruType = $extBruType; $file = $extFilePath; $Bru = new Bru(); $bruInfo = $Bru->GetBruInfo($bruType); $frameLength = $bruInfo['frameLength']; $stepLength = $bruInfo['stepLength']; $wordLength = $bruInfo['wordLength']; $headerLength = $bruInfo['headerLength']; $headerScr = $bruInfo['headerScr']; $frameSyncroCode = $bruInfo['frameSyncroCode']; unset($Bru); $flightInfo['bruType'] = $bruType; if ($headerScr != '' || $headerScr != null) { eval($headerScr); unset($Fl); if (isset($flightInfo['startCopyTime'])) { $startCopyTime = $flightInfo['startCopyTime']; $flightInfo['startCopyTime'] = date('H:i:s Y-m-d', $startCopyTime); $flightInfo['copyCreationTime'] = date('H:i:s', $startCopyTime); $flightInfo['copyCreationDate'] = date('Y-m-d', $startCopyTime); } $airport = new Airport(); if (isset($flightInfo['takeOffLat']) && isset($flightInfo['takeOffLong'])) { $lat = $flightInfo['takeOffLat']; $long = $flightInfo['takeOffLong']; $landingAirport = $airport->getAirportByLatAndLong($lat, $long); if (!empty($landingAirport)) { $flightInfo['departureAirport'] = $landingAirport['ICAO']; $flightInfo['departureAirportName'] = $landingAirport['name']; } } if (isset($flightInfo['landingLat']) && isset($flightInfo['landingLong'])) { $lat = $flightInfo['landingLat']; $long = $flightInfo['landingLong']; $landingAirport = $airport->getAirportByLatAndLong($lat, $long); if (!empty($landingAirport)) { $flightInfo['arrivalAirport'] = $landingAirport['ICAO']; $flightInfo['arrivalAirportName'] = $landingAirport['name']; } } unset($airport); } return $flightInfo; }