Skip to content

Commit

Permalink
Fix PIREP Filing Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
velocity23 committed Aug 15, 2021
1 parent d044449 commit 9fccffd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
16 changes: 0 additions & 16 deletions classes/controllers/PirepsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,6 @@ public function post_new()
$this->get_new();
}

$response = VANet::sendPirep(array(
'aircraftLiveryId' => Aircraft::idToLiveryId(Input::get('aircraft')),
'arrivalIcao' => strtoupper(Input::get('arr')),
'date' => Input::get('date'),
'departureIcao' => strtoupper(Input::get('dep')),
'flightTime' => Time::strToSecs(Input::get('ftime')),
'fuelUsed' => Input::get('fuel'),
'pilotId' => $user->data()->ifuserid
));

if (!$response) {
Session::flash('error', 'There was an Error Connecting to VANet.');
$this->get_new();
die();
}

if (!Pirep::file(array(
'flightnum' => Input::get('fnum'),
'departure' => strtoupper(Input::get('dep')),
Expand Down
6 changes: 1 addition & 5 deletions classes/data/VANet.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,8 @@ public static function sendPirep($ev)

$response = Json::decode(@HttpRequest::hacky(self::baseUrl() . "/airline/v1/flights", "POST", $data, ["X-Api-Key: {$key}", "Content-Type: application/json"]));
if (!$response || $response['status'] != 0) {
return false;
die('Error Connecting to VANet');
}

if (!$response || $response['status'] != 0) return false;

return true;
}

/**
Expand Down

0 comments on commit 9fccffd

Please sign in to comment.