public function ProcessFlight($extId)
 {
     if (is_int($extId)) {
         $flightId = $extId;
         $avaliableFlights = $this->_user->GetAvaliableFlights($this->_user->username);
         if (in_array($flightId, $avaliableFlights)) {
             $Fl = new Flight();
             $flightInfo = $Fl->GetFlightInfo($flightId);
             $apTableName = $flightInfo["apTableName"];
             $bpTableName = $flightInfo["bpTableName"];
             $excEventsTableName = $flightInfo["exTableName"];
             $startCopyTime = $flightInfo["startCopyTime"];
             $tableGuid = substr($apTableName, 0, 14);
             unset($Fl);
             $Bru = new Bru();
             $bruInfo = $Bru->GetBruInfo($flightInfo["bruType"]);
             $excListTableName = $bruInfo["excListTableName"];
             $apGradiTableName = $bruInfo["gradiApTableName"];
             $bpGradiTableName = $bruInfo["gradiBpTableName"];
             $stepLength = $bruInfo["stepLength"];
             if ($excListTableName != "") {
                 $bruInfo = $Bru->GetBruInfo($flightInfo["bruType"]);
                 $excListTableName = $bruInfo["excListTableName"];
                 $apGradiTableName = $bruInfo["gradiApTableName"];
                 $bpGradiTableName = $bruInfo["gradiBpTableName"];
                 $FEx = new FlightException();
                 $FEx->DropFlightExceptionTable($excEventsTableName);
                 $flightExTableName = $FEx->CreateFlightExceptionTable($flightId, $tableGuid);
                 //Get exc refParam list
                 $excRefParamsList = $FEx->GetFlightExceptionRefParams($excListTableName);
                 $exList = $FEx->GetFlightExceptionTable($excListTableName);
                 //file can be accesed by ajax what can cause warning
                 error_reporting(E_ALL ^ E_WARNING);
                 //perform proc be cached table
                 for ($i = 0; $i < count($exList); $i++) {
                     //                   $fp = fopen($tempFilePath, "w");
                     //                   fwrite($fp, json_encode($exList[$i]["code"]));
                     //                         fclose($fp);
                     $curExList = $exList[$i];
                     $FEx->PerformProcessingByExceptions($curExList, $flightInfo, $flightExTableName, $apTableName, $bpTableName, $startCopyTime, $stepLength);
                 }
                 error_reporting(E_ALL);
                 //                unlink($tempFilePath);
             } else {
                 //                unlink($tempFilePath);
             }
             unset($Bru);
             $result = true;
             return $result;
         } else {
             error_log("Not avaliable for current user. ProcessFlight id - " . $id . ". " . "Username - " . $this->_user->username . ". Page FlightsController.php");
             $result['status'] = false;
             return $result['status'];
         }
     } else {
         error_log("Incorrect input data. DeleteFlight id - " . json_encode($extId) . ". Page FlightsController.php");
         $result['status'] = false;
         return $result['status'];
     }
 }