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

Commit

Permalink
mod des pages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcaussades committed Jul 24, 2024
1 parent 350473e commit 73ffb94
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 36 deletions.
51 changes: 32 additions & 19 deletions app/Http/Controllers/eventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down Expand Up @@ -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
Expand All @@ -93,23 +99,23 @@ 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) {
case 'MEN':
$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;
Expand All @@ -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;
Expand All @@ -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"];
Expand All @@ -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 = [];
Expand All @@ -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 = [];
Expand All @@ -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();
Expand Down
46 changes: 30 additions & 16 deletions resources/views/plateforme/atc.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<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>
<h5 class="card-title text-primary text-center">{{ $atc["departure"]["count"] >= 2 ? "Departures" : "Departure" }}</h5>
</div>
<div class="card-body">
<p class="card-text">
Expand All @@ -42,7 +42,7 @@
<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>
<h5 class="card-title text-primary text-center">{{ $atc["arrival"]["count"] >= 2 ? "Arrivals" : "Arrival" }}</h5>
</div>
<div class="card-body">
<p class="card-text">
Expand Down Expand Up @@ -72,7 +72,7 @@
<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>
<div class="fs-6 text-center">Freq: {{$atcs["frequency"]}} Mhz</div>
<div class="fs-6 text-center">Online: {{$atcs["time"]}}</div>
</p>
</div>
Expand All @@ -85,7 +85,7 @@
<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>
<div class="fs-6 text-center">Freq: {{$atcs["frequency"]}} Mhz</div>
<div class="fs-6 text-center">Online: {{$atcs["time"]}}</div>
</p>
</div>
Expand All @@ -112,21 +112,24 @@
<div class="card-body">
<div class="row">
<div class="col-md-12">
<table class="table">
@if ($atc["departure"]["count"] >= 1) <table class="table">
<h6 class="text-center">{{ $atc["departure"]["count"] >= 2 ? "Departures" : "Departure" }}</h6>
<thead>
<tr>
<th>Flight number</th>
<th>Time of departure :</th>
<th>Arrivals </th>
<th>Type Aircraft</th>
<th>Rules</th>
<th>Flight number:</th>
<th>VID:</th>
<th>Time of departure:</th>
<th>Destination:</th>
<th>Type Aircraft:</th>
<th>Rule:</th>
</tr>
</thead>
<tbody>

@foreach ($atc["departure"]["data"] as $departures)
<tr>
<td>{{$departures["callsign"]}}</td>
<td>{{$departures["userId"]}}</td>
<td>{{$departures["departureTime"]}}</td>
<td>{{$departures["arrival"]}}</td>
<td>{{$departures["model"]}}</td>
Expand All @@ -135,27 +138,38 @@
@endforeach

</tbody>
</table>
</table>
@endif
</div>
<div class="col-md-12">
<table class="table">
@if ($atc["arrival"]["count"] >= 1) <table class="table">
<h6 class="text-center">{{ $atc["arrival"]["count"] >= 2 ? "Arrivals" : "Arrival" }}</h6>
<thead>
<tr>
<th>Flight number</th>
<th>Time of arrival :</th>
<th>Type Aircraft</th>
<th>Flight number:</th>
<th>VID:</th>
<th>Time of arrival:</th>
<th>Type Aircraft:</th>
<th>Model:</th>
<th>POB:</th>
<th>Rule:</th>
</tr>
</thead>
<tbody>
@foreach ($atc["arrival"]["data"] as $arrivals)
<tr>
<td>{{$arrivals["callsign"]}}</td>
<td>{{$arrivals["userId"]}}</td>
<td>{{$arrivals["eta"]}}</td>
<td>{{$arrivals["wakeTurbulence"]}}</td>
<td>{{$arrivals["model"]}}</td>
<td>{{$arrivals["pob"]}}</td>
<td>{{$arrivals["rule"]}}</td>
</tr>
@endforeach
</tbody>
</table>
</table>
@endif
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 73ffb94

Please sign in to comment.