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

Commit

Permalink
Remove/download whazzup (#116)
Browse files Browse the repository at this point in the history
* autofiles

* Changelog add

* change version search VID

* Restor problem
  • Loading branch information
alexcaussades authored Oct 18, 2023
1 parent 9855fe5 commit e81527b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
9 changes: 5 additions & 4 deletions app/Http/Controllers/chartIvaoFRcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ public function chart_ivao($ivao){
public function structure_CCR($ccr){
$whazzup = new whazzupController();
$prepare_icao = $whazzup->get_center($ccr);
$new_icao = strtolower($prepare_icao["id"]);
$icaoUpper = strtoupper($prepare_icao["id"]);

$new_icao = strtolower($prepare_icao[0]["composePosition"]);
$icaoUpper = strtoupper($prepare_icao[0]["composePosition"]);
$info = explode("_", $icaoUpper);

$r =[
"new_icao" => $new_icao,
"ccr" => $icaoUpper,
"ccr" => $info[0],
];
return $r;
}
Expand Down
15 changes: 9 additions & 6 deletions app/Http/Controllers/myOnlineServeurController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,31 @@ public function getVerrifOnlineServeur()
$whazzupp = new whazzupController();
$chartIvaoFRcontroller = new chartIvaoFRcontroller();
$chartController = new CarteSIAController();
//dd($q);
if ($q['atc'] != null) {

if ($q['atc']['atcSession']['position'] == "CTR") {
$ivao_session = $whazzupp->track_session_id($q['atc'][0]['id']);

$ivao_session = $whazzupp->track_session_id($q['atc']['id']);

$ivao_session_decode = json_decode($ivao_session, true);
$time = Carbon::parse($ivao_session_decode["time"])->format('H:i');
$metar = new metarController();
$ident = $q['atc'][0]['callsign'];
$ident = $q['atc']['callsign'];
$ident = explode("_", $ident);
$new_ccr = $ident[0];
$ident[0] = substr($ident[0], 0, -1);
$metar = $metar->getFirAtc($ident[0]);
$chart_crr = $chartIvaoFRcontroller->chart_ccr($new_ccr);
$atis = $whazzupp->get_atis_latest_2($ivao_session_decode["callsign"]);
$atis = json_decode($atis, true);

$atc_online = [];
for ($i = 0; $i < count($metar); $i++) {
$atc_online[$i]["icao"] = $metar[$i][0]["callsign"];
$atc_online[$i]["icao"] = explode("_", $atc_online[$i]["icao"]);
$atc_online[$i]["icao"] = $atc_online[$i]["icao"][0];
$atc_online[$i]["callsign"] = $metar[$i][0]["callsign"];
$atc_online[$i]["chart_ivao"] = $chartIvaoFRcontroller->chart_ivao($atc_online[$i]["icao"]);
$atc_online[$i]["chart_ivao"] = $chart_crr;
$atc_online[$i]["atis"] = $whazzupp->get_rwy($atc_online[$i]["icao"]);
$atc_online[$i]["frequency"] = $metar[$i][0]["atcSession"]["frequency"];
$atc_online[$i]["time"] = Carbon::parse($metar[$i][0]["time"])->format('H:i');
Expand All @@ -87,7 +91,7 @@ public function getVerrifOnlineServeur()
"frequency" => $ivao_session_decode["atcSession"]['frequency'],
"rating" => $ivao_session_decode["user"]['rating']["atcRating"]["shortName"],
"time" => $time,
"revision" => $q['atc'][0]['atis']['revision'],
"revision" => 0,
];
return view("myoline.ccr", ["atc" => $atc, "atc_online" => $atc_online, "chart_crr" => $chart_crr]);
}
Expand Down Expand Up @@ -231,5 +235,4 @@ public function getVerrifOnlineServeur()
}
}


}
12 changes: 7 additions & 5 deletions app/Http/Controllers/whazzupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class whazzupController extends Controller
{
public function getwhazzup()
{
$api = $this->store_Whazzup();
$whazzup = json_decode($api[0], true);
$api = $this->donwload_whazzup();
$whazzup = $api;
return $whazzup;
}

Expand Down Expand Up @@ -281,7 +281,8 @@ public function Get_taf($icao = null)
return $metar;
}

public function Get_Position($vid = "191514")
public function Get_Position($vid)

{
$metar = $this->API_request("v2/tracker/now/atc");
$p = json_decode($metar, true);
Expand All @@ -300,7 +301,7 @@ public function Get_Position_old()
return $metar;
}

public function Get_Position_pilote($vid = "191514")
public function Get_Position_pilote($vid)
{
$metar = $this->API_request("v2/tracker/now/pilots");
$p = json_decode($metar, true);
Expand Down Expand Up @@ -622,8 +623,9 @@ public function get_center($icao)
$airport = $this->API_request("/v2/centers/" . $icao . "/subcenters");
$airport = $airport->json();
return $airport;

}


public function get_aircrafts($icao_code)
{
$aircrafts = $this->API_request("/v2/aircrafts/" . $icao_code);
Expand Down

0 comments on commit e81527b

Please sign in to comment.