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

Feature/sid star #159

Merged
merged 8 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 76 additions & 1 deletion app/Http/Controllers/eventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ public function get_last_arrival($route)
public function aircrafts($icao_code){
$whazzup = new whazzupController();
$aircrafts = $whazzup->get_aircrafts($icao_code);
//dd($aircrafts);
return $aircrafts["wakeTurbulence"];
}

public function aircrafts_model($icao_code){
$whazzup = new whazzupController();
$aircrafts = $whazzup->get_aircrafts($icao_code);
return $aircrafts["model"];
}

public function ETA($distance_arrival, $speed)
{
$distance_arrival = explode(".", $distance_arrival);
Expand Down Expand Up @@ -130,4 +135,74 @@ public function Star($route){
break;
}
}

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]
for ($i = 0; $i < count($r); $i++) {
if ($r[$i]["lastTrack"]["onGround"] == true) {
$sr[$i]["callsign"] = $r[$i]["callsign"];
$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"];
$sr[$i]["fp"] = $this->get_fp($r[$i]["id"]);
$sr[$i]["departureTime"] = $this->get_fp($r[$i]["id"])[0]["departureTime"];
$sr[$i]["departureTime"] = Carbon::parse($sr[$i]["departureTime"])->format('H:i');
$sr[$i]["peopleOnBoard"] = $this->get_fp($r[$i]["id"])[0]["peopleOnBoard"];
$sr[$i]["rule"] = $this->get_fp($r[$i]["id"])[0]["flightRules"];
$sr[$i]["fp"] = null;
}
}
$sr = array_values($sr);
$query = [
"count" => count($sr),
"data" => $sr
];
return $query;
}

public function get_atc_online(){
$whazzup = new whazzupController();
$atc = $whazzup->position_search($this->icao);
$sy = [];
for ($i = 0; $i < count($atc); $i++) {
$sy[$i] = $atc[$i];
}
$sy = collect($sy)->toArray();
$r = new whazzupController();
$r = $r->atc_tracking();
$sr = [];
for ($i = 0; $i < count($r); $i++) {
if ($r[$i]["callsign"]) {
$sr[$i]["callsign"] = $r[$i]["callsign"];
$sr[$i]["time"] = Carbon::parse($r[$i]["time"])->format('H:i');
$sr[$i]["frequency"] = $r[$i]["atcSession"]["frequency"];
$sr[$i]["id"] = $r[$i]["id"];
}
}
$sr = collect($sr)->toArray();
// rechercher dans la liste sr les callsigns qui sont dans la liste sy et les mettre dans une liste
$online = [];
foreach ($sr as $key => $value) {
if (in_array($value["callsign"], $sy)) {
array_push($online, $value);
}
}
return $online;
}

public function get_arrival_departure(){

$arrival = $this->get_general();
$departure = $this->Departure();
$atc = $this->get_atc_online();
$query = [
"arrival" => $arrival,
"departure" => $departure,
"atc" => $atc
];
return $query;
}
}
10 changes: 5 additions & 5 deletions app/Http/Controllers/myOnlineServeurController.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ public function getVerrifOnlineServeur()
$metar_arr = $whazzupp->Get_metar($fp_session["arrivalId"]);
$taf_dep = $whazzupp->Get_taf($fp_session["departureId"]);
$taf_arr = $whazzupp->Get_taf($fp_session["arrivalId"]);
$airac_ARR = $airac->get_approach($fp_session["arrivalId"]);
$airac_DEP = $airac->get_departure($fp_session["departureId"]);
//$airac_ARR = $airac->get_approach($fp_session["arrivalId"]);
//$airac_DEP = $airac->get_departure($fp_session["departureId"]);
$airac_ils = $airac->get_ils_information($fp_session["arrivalId"]);
if ($speed <= 0) {
$speed = 1;
Expand Down Expand Up @@ -222,15 +222,15 @@ public function getVerrifOnlineServeur()
"IFR" => $chartController->chartIFR($p["flightPlan"]["departureId"]),
"VFR" => $chartController->chartVFR($p["flightPlan"]["departureId"]),
"airac" => [
"departure" => $airac_DEP,
"departure" => $airac_DEP ?? null,
],
],
"arrival" => [
"IFR" => $chartController->chartIFR($p["flightPlan"]["arrivalId"]),
"VFR" => $chartController->chartVFR($p["flightPlan"]["arrivalId"]),
"airac" => [
"arrival" => $airac_ARR,
"ils" => $airac_ils
"arrival" => $airac_ARR ?? null,
"ils" => $airac_ils ?? null,
],
]
];
Expand Down
15 changes: 15 additions & 0 deletions app/Http/Controllers/whazzupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,4 +654,19 @@ public function event_ivao()
$event = $event->json();
return $event;
}

public function atc_tracking()
{
$atc = $this->API_request("v2/tracker/now/atc");
$atc = $atc->json();
return $atc;
}

public function session_atc($id_session)
{
$atc = $this->API_request("v2/tracker/sessions/" . $id_session . "/atc");
$atc = $atc->json();
return $atc;
}

}
38 changes: 0 additions & 38 deletions resources/views/myoline/atc.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,44 +70,6 @@
@endif
@endforeach
<hr>
<div class="row">
<div class="col-6">
<table class="table table-striped table-inverse table-responsive text-info">
<thead class="thead-inverse">
<tr>
<th class="text-center">SID</th>
</tr>
</thead>
<tbody>

@foreach ($atc["airac_airport"]["departure"] as $airrac_departure)
<tr>
<td class="text-white">{{ $airrac_departure }}</td>
</tr>
@endforeach

</tbody>
</table>
</div>
<div class="col-6">
<table class="table table-striped table-inverse table-responsive text-info">
<thead class="thead-inverse">
<tr>
<th class="text-center">STAR</th>
</tr>
</thead>
<tbody>

@foreach ($atc["airac_airport"]["approch"] as $approch)
<tr>
<td class="text-white">{{ $approch }}</td>
</tr>
@endforeach

</tbody>
</table>
</div>
</div>
@endif
</div>
</div>
Expand Down
33 changes: 1 addition & 32 deletions resources/views/myoline/pilot.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,45 +83,14 @@
<span class="text-info">Departure :</span><br>
<div class="row">
<div class="col-6">
<table class="table table-striped table-inverse table-responsive text-info">
<thead class="thead-inverse">
<tr>
<th class="text-center">SID</th>
</tr>
</thead>
<tbody>

@foreach ($chart["departure"]["airac"]["departure"] as $airrac_departure)
<tr>
<td class="text-white">{{ $airrac_departure }}</td>
</tr>
@endforeach

</tbody>
</table>

</div>
</div>
</div>
<div class="col">
<span class="text-info">Arrival :</span><br>
<div class="row">
<div class="col-6">
<table class="table table-striped table-inverse table-responsive text-info">
<thead class="thead-inverse">
<tr>
<th class="text-center">SID</th>
</tr>
</thead>
<tbody>

@foreach ($chart["arrival"]["airac"]["arrival"] as $airrac_departure)
<tr>
<td class="text-white">{{ $airrac_departure }}</td>
</tr>
@endforeach

</tbody>
</table>
</div>
</div>
</div>
Expand Down
150 changes: 150 additions & 0 deletions resources/views/plateforme/atc.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
@extends("metar-base")

@section("title", "Information Air Traffic Control Ivao")

@include("navbar-metar")

@section('content')

<div class="container">
<p class="text-center">
<div class="fw-bolder fs-3 text-primary text-center text-uppercase mt-5">{{$icao}} Information</div>
</p>
</div>


<div class="container">
<div class="row">
<div class="col-md-6">
<div class="card mt-5">
<div class="card-header">
<h5 class="card-title text-primary text-center">Metar</h5>
</div>
<div class="card-body">
<p class="card-text">
<div class="text-uppercase">{{$metar["metar"]}}</div>
</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card mt-5">
<div class="card-header">
<h5 class="card-title text-primary text-center">{{ $atc["departure"]["count"] < 1 ? "Departure" : "Departures" }}</h5>
</div>
<div class="card-body">
<p class="card-text">
<div class="fw-bolder fs-5 text-center text-uppercase">{{$atc["departure"]["count"]}}</div>
</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card mt-5">
<div class="card-header">
<h5 class="card-title text-primary text-center">{{ $atc["arrival"]["count"] < 1 ? "Arrival" : "Arrivals" }}</h5>
</div>
<div class="card-body">
<p class="card-text">
<div class="fw-bolder fs-5 text-center text-uppercase">{{ $atc["arrival"]["count"]}}</div>
</p>
</div>
</div>
</div>
</div>
</div>

<div class="container mt-2">
<hr>
</div>

<div class="container mt-2">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-title">ATC online</h5>
</div>
<div class="card-body d-flex justify-content-center">
@foreach ( $atc["atc"] as $atcs )
<div class="row ms-2 ps-2">
<div class="card text-white bg-success ">
<div class="card-body">
<h4 class="card-title fs-6 ">{{$atcs["callsign"]}}</h4>
<p class="card-text">
<div class="fs-6 text-center">{{$atcs["frequency"]}} Mhz</div>
</p>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>

<div class="container mt-2">
<hr>
</div>

<div class="container mt-2">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h5 class="card-title">Plane</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
<table class="table">
<thead>
<tr>
<th>Flight number</th>
<th>Time of departure :</th>
<th>Arrivals </th>
<th>Type Aircraft</th>
<th>Rules</th>
</tr>
</thead>
<tbody>

@foreach ($atc["departure"]["data"] as $departures)
<tr>
<td>{{$departures["callsign"]}}</td>
<td>{{$departures["departureTime"]}}</td>
<td>{{$departures["arrival"]}}</td>
<td>{{$departures["model"]}}</td>
<td>{{$departures["rule"]}}</td>
</tr>
@endforeach

</tbody>
</table>
</div>
<div class="col-md-12">
<table class="table">
<thead>
<tr>
<th>Flight number</th>
<th>Time of arrival :</th>
<th>Type Aircraft</th>
</tr>
</thead>
<tbody>
@foreach ($atc["arrival"]["data"] as $arrivals)
<tr>
<td>{{$arrivals["callsign"]}}</td>
<td>{{$arrivals["eta"]}}</td>
<td>{{$arrivals["wakeTurbulence"]}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
Loading
Loading