diff --git a/app/Http/Controllers/eventController.php b/app/Http/Controllers/eventController.php index a06f1ee..6f88680 100644 --- a/app/Http/Controllers/eventController.php +++ b/app/Http/Controllers/eventController.php @@ -43,13 +43,15 @@ public function get_last_arrival($route) return $rr[$m]; } - public function aircrafts($icao_code){ + public function aircrafts($icao_code) + { $whazzup = new whazzupController(); $aircrafts = $whazzup->get_aircrafts($icao_code); return $aircrafts["wakeTurbulence"]; } - public function aircrafts_model($icao_code){ + public function aircrafts_model($icao_code) + { $whazzup = new whazzupController(); $aircrafts = $whazzup->get_aircrafts($icao_code); return $aircrafts["model"]; @@ -81,9 +83,13 @@ public function get_general() $r = $this->get_fp($q[$i]["id"]); $r = $r[0]; $sr[$i]["callsign"] = $q[$i]["callsign"]; - $sr[$i]["star"] = $this->Star($r["route"]); + $sr[$i]["userId"] = $q[$i]["userId"]; + $sr[$i]["pob"] = $r["peopleOnBoard"]; + $sr[$i]["rule"] = $r["flightRules"]; + $sr[$i]["model"] = $this->aircrafts_model($q[$i]["flightPlan"]["aircraftId"]); $sr[$i]["eta"] = $this->ETA($q[$i]["lastTrack"]["arrivalDistance"], $q[$i]["lastTrack"]["groundSpeed"]); $sr[$i]["wakeTurbulence"] = $this->aircrafts($q[$i]["flightPlan"]["aircraftId"]); + } $sr = array_values($sr); //tri par ordre eta croissant @@ -93,10 +99,10 @@ public function get_general() "data" => $sr ]; return $query; - } - public function Star($route){ + public function Star($route) + { $star_search = $this->get_last_arrival($route); switch ($star_search) { @@ -104,12 +110,12 @@ public function Star($route){ $star_search = "MEN 6T"; return $star_search; break; - + case 'BRUSC': $star_search = "BRUSC 6T"; return $star_search; break; - + case 'KELAM': $star_search = "KELAM 6T"; return $star_search; @@ -124,7 +130,7 @@ public function Star($route){ $star_search = "MARRI 6T"; return $star_search; break; - + case 'NG': $star_search = "NG 6T"; return $star_search; @@ -136,14 +142,16 @@ public function Star($route){ } } - public function Departure(){ + public function Departure() + { $q = $this->get_arrival(); $r = $q["outbound"]; $sr = []; - // filter la liste avec les parametres dans la liste [lastTrack][altitude] avec [lastTrack][onGround] + // filter la liste avec les parametres dans la liste [lastTrack][altitude] avec [lastTrack][onGround] for ($i = 0; $i < count($r); $i++) { if ($r[$i]["lastTrack"]["onGround"] == true) { $sr[$i]["callsign"] = $r[$i]["callsign"]; + $sr[$i]["userId"] = $r[$i]["userId"]; $sr[$i]["model"] = $this->aircrafts_model($r[$i]["flightPlan"]["aircraftId"]); $sr[$i]["wakeTurbulence"] = $this->aircrafts($r[$i]["flightPlan"]["aircraftId"]); $sr[$i]["arrival"] = $r[$i]["flightPlan"]["arrivalId"]; @@ -163,7 +171,8 @@ public function Departure(){ return $query; } - public function get_atc_online(){ + public function get_atc_online() + { $whazzup = new whazzupController(); $atc = $whazzup->position_search($this->icao); $sy = []; @@ -190,15 +199,18 @@ public function get_atc_online(){ array_push($online, $value); } } - return $online; + return $online; } - public function get_airport(){ - $whazzup = new whazzupController(); - $whazzup = $whazzup->get_airport($this->icao); - return $whazzup["centerId"]; + public function get_airport() + { + $whazzup = new whazzupController(); + $whazzup = $whazzup->get_airport($this->icao); + return $whazzup["centerId"]; } - public function get_atc_online_fir(){ + + public function get_atc_online_fir() + { $whazzup = new whazzupController(); $atc = $whazzup->position_search($this->get_airport()); $sy = []; @@ -225,10 +237,11 @@ public function get_atc_online_fir(){ array_push($online, $value); } } - return $online; + return $online; } - public function get_arrival_departure(){ + public function get_arrival_departure() + { $arrival = $this->get_general(); $departure = $this->Departure(); diff --git a/resources/views/plateforme/atc.blade.php b/resources/views/plateforme/atc.blade.php index fe9f5b4..49df1fc 100644 --- a/resources/views/plateforme/atc.blade.php +++ b/resources/views/plateforme/atc.blade.php @@ -30,7 +30,7 @@
-
{{ $atc["departure"]["count"] < 1 ? "Departure" : "Departures" }}
+
{{ $atc["departure"]["count"] >= 2 ? "Departures" : "Departure" }}

@@ -42,7 +42,7 @@

-
{{ $atc["arrival"]["count"] < 1 ? "Arrival" : "Arrivals" }}
+
{{ $atc["arrival"]["count"] >= 2 ? "Arrivals" : "Arrival" }}

@@ -72,7 +72,7 @@

{{$atcs["callsign"]}}

-

{{$atcs["frequency"]}} Mhz
+
Freq: {{$atcs["frequency"]}} Mhz
Online: {{$atcs["time"]}}

@@ -85,7 +85,7 @@

{{$atcs["callsign"]}}

-

{{$atcs["frequency"]}} Mhz
+
Freq: {{$atcs["frequency"]}} Mhz
Online: {{$atcs["time"]}}

@@ -112,14 +112,16 @@
- + @if ($atc["departure"]["count"] >= 1)
+
{{ $atc["departure"]["count"] >= 2 ? "Departures" : "Departure" }}
- - - - - + + + + + + @@ -127,6 +129,7 @@ @foreach ($atc["departure"]["data"] as $departures) + @@ -135,27 +138,38 @@ @endforeach -
Flight numberTime of departure :Arrivals Type AircraftRulesFlight number:VID:Time of departure:Destination:Type Aircraft:Rule:
{{$departures["callsign"]}}{{$departures["userId"]}} {{$departures["departureTime"]}} {{$departures["arrival"]}} {{$departures["model"]}}
+ + @endif
- + @if ($atc["arrival"]["count"] >= 1)
+
{{ $atc["arrival"]["count"] >= 2 ? "Arrivals" : "Arrival" }}
- - - + + + + + + + @foreach ($atc["arrival"]["data"] as $arrivals) + + + + @endforeach -
Flight numberTime of arrival :Type AircraftFlight number:VID:Time of arrival:Type Aircraft:Model:POB:Rule:
{{$arrivals["callsign"]}}{{$arrivals["userId"]}} {{$arrivals["eta"]}} {{$arrivals["wakeTurbulence"]}}{{$arrivals["model"]}}{{$arrivals["pob"]}}{{$arrivals["rule"]}}
+ + @endif
diff --git a/routes/web.php b/routes/web.php index cb30954..cbdfed4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -634,7 +634,7 @@ "id" => $request->id ]); $whazzup = new whazzupController(); - $whazzup = $whazzup->position_search($request->id); + $whazzup = $whazzup->get_airport($request->id); return $whazzup; })->name("test");