Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
valid correctif page index
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcaussades committed Jul 31, 2024
1 parent 5b91df9 commit a599bf5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/metarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ public function metar($icao)
$whazzup = new whazzupController();
$metar = $whazzup->Get_metar($icao);
$metar = json_decode($metar);

$info = $metar->statusCode ?? 200;
if($info == 200 ){
$temp = $this->temp_qnh($metar->metar) ?? "None";
Expand Down
7 changes: 5 additions & 2 deletions resources/views/event_fr.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h5 class="fw-bold">IVAO Event FR</h5>

@if ($event_fr != null)
<h5 class="fw-bold">IVAO Event FR</h5>

<div class="row">
@foreach($event_fr as $events)
Expand Down Expand Up @@ -30,4 +32,5 @@
@endforeach
</div>
</div>
<hr>
<hr>
@endif
5 changes: 4 additions & 1 deletion resources/views/event_world.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="container mt-2">
@if ($event_worl != null)
<div class="container mt-2">
<h5 class="fw-bold">IVAO Event World</h5>
<div class="row">
@foreach($event_worl as $eventss)
Expand All @@ -19,3 +20,5 @@
</div>
@endforeach
</div>
@endif

20 changes: 17 additions & 3 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\eventController;
use App\Http\Controllers\metarController;
use App\Http\Controllers\logginController;
use App\Http\Controllers\whazzupController;
Expand Down Expand Up @@ -84,8 +85,21 @@
"PILOT" => $PILOT,
"METAR" => $METAR
];
$k = serialize($info);
$k = base64_encode($k);


return $k;
return $info;
});

Route::get("atc/{icao}", function(Request $request){
$atconline = new eventController($request->icao);
$atc = $atconline->get_arrival_departure();
$metar = new metarController();
$metar = $metar->metar($request->icao);
$info_atc = null;
$r = [
"atc" => $atc,
"metar" => $metar,
"info_atc" => $info_atc
];
return $r;
});
22 changes: 18 additions & 4 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,19 @@
$whazzup = $whazzup->connexion();
$w = new changelogController();
$u = $w->info_update();
$event_world = new EventIvaoController();
$event_world = $event_world->get_event_ivao_RFE_RFO();
$event_fr = new EventIvaoController();
$event_fr = $event_fr->get_event_ivao_FR();
try {
$event_world = new EventIvaoController();
$event_world = $event_world->get_event_ivao_RFE_RFO();
} catch (Exception $e) {
$event_world = null;
}

try {
$event_fr = new EventIvaoController();
$event_fr = $event_fr->get_event_ivao_FR();
} catch (Exception $e) {
$event_world = null;
}
if (Session::get("ivao_tokens") != null) {
$date = new DateTime();
$date->setTimezone(new DateTimeZone('UTC'));
Expand Down Expand Up @@ -639,3 +648,8 @@

})->name("test");
});


Route::get("test", function (Request $request) {
return view("test");
});

0 comments on commit a599bf5

Please sign in to comment.