diff --git a/app/Http/Controllers/whazzupController.php b/app/Http/Controllers/whazzupController.php index 198849b..bc406db 100644 --- a/app/Http/Controllers/whazzupController.php +++ b/app/Http/Controllers/whazzupController.php @@ -211,10 +211,9 @@ public function API_Delect_session($path = null, $method = 'GET', $data = null, if (session("ivao_tokens")) { $json = session("ivao_tokens"); - $json = json_decode($json); - $json = $json->access_token; + $access_token = $json["access_token"]; $headers = [ - 'Authorization' => 'Bearer ' . $json, + 'Authorization' => 'Bearer ' . $access_token, 'Accept' => 'application/json', ]; } else { @@ -258,14 +257,14 @@ public function refresh_token_api_ivao(Request $request) public function API_POST($path = null, $method = 'POST', $data = null, $headers = null) { $json = session("ivao_tokens"); - $json = json_decode($json); - $json = $json->access_token; + $access_token = $json["access_token"]; $url = 'https://api.ivao.aero/' . $path; $headers = [ - 'Authorization' => 'Bearer ' . $json, + 'Authorization' => 'Bearer ' . $access_token, 'Accept' => 'application/json', ]; $response = Http::withHeaders($headers)->post($url, $data); + dd($response); return $response; } @@ -291,7 +290,7 @@ public function Get_Position($vid) if ($pilot["userId"] == $vid) { $data = $pilot; return $data; - } + } } } @@ -310,9 +309,8 @@ public function Get_Position_pilote($vid) if ($pilot["userId"] == $vid) { $data = $pilot; return $data; - } + } } - } public function track_session_id($idsession = null) @@ -358,7 +356,7 @@ public function user_me() $pilot = $pilot1->diffInMinutes($heure) / 60; /** Rounded heure Pilot */ $pilot = round($pilot, 2); - + /** Staff */ $staff = Carbon::createFromTimestamp($users_me["hours"][2]["hours"])->format('Y-m-d H:i'); $staff1 = Carbon::parse($staff); @@ -457,7 +455,7 @@ public function get_friends_online() $whazzup = $whazzup->json(); return $whazzup; } - public function post_friends($vid) + public function post_friends($myvid, $vid) { $whazzup = $this->API_POST("v2/webeye/friends/" . $vid); $whazzup = $whazzup->json(); @@ -577,10 +575,10 @@ public function get_bookings_for_event($airport = "LFBL") { $bookings = $this->API_request("/v2/atc/bookings/daily"); $bookings = $bookings->json(); - $pattern = '/'.$airport.'(.*)/'; + $pattern = '/' . $airport . '(.*)/'; $book = []; for ($i = 0; $i < count($bookings); $i++) { - if(preg_match($pattern, $bookings[$i]["atcPosition"])){ + if (preg_match($pattern, $bookings[$i]["atcPosition"])) { $book[$i]["id"] = $bookings[$i]["id"]; $book[$i]["Start_time"] = Carbon::parse($bookings[$i]["startDate"])->format('H:i') . " Z"; $book[$i]["End_time"] = Carbon::parse($bookings[$i]["endDate"])->format('H:i') . " Z"; @@ -591,7 +589,6 @@ public function get_bookings_for_event($airport = "LFBL") "vid" => $bookings[$i]["user"]["id"], ]; } - } return $book; } @@ -607,7 +604,6 @@ public function get_fp_me() public function get_fp($id) { $fp = $this->API_request("/v2/users/me/flightPlans/" . $id); - $fp = $fp->json(); return $fp; } @@ -640,14 +636,13 @@ public function get_center($icao) $airport = $airport->json(); return $airport; } - + public function get_aircrafts($icao_code) { $aircrafts = $this->API_request("/v2/aircrafts/" . $icao_code); $aircrafts = $aircrafts->json(); return $aircrafts; - } public function event_ivao() @@ -656,5 +651,4 @@ public function event_ivao() $event = $event->json(); return $event; } - } diff --git a/database/changelog.json b/database/changelog.json index 0f04db4..2705905 100644 --- a/database/changelog.json +++ b/database/changelog.json @@ -176,7 +176,6 @@ ] }, "7": { - "id": 8, "name": "2023 / 33", "date": "2023-11-02", @@ -247,5 +246,25 @@ "description": "change welcome page" } ] + }, + "10": { + "id": 11, + "name": "2023 / 36", + "date": "2023-11-26", + "version": "26.2.7", + "option": [ + { + "id": 0, + "type": "Bug Fix", + "btn": "danger", + "description": "Change information POST and Delete for API IVAO" + }, + { + "id": 1, + "type": "Feature", + "btn": "success", + "description": "View FPL" + } + ] } } diff --git a/resources/views/friends/add.blade.php b/resources/views/friends/add.blade.php index c6cabe3..efa7704 100644 --- a/resources/views/friends/add.blade.php +++ b/resources/views/friends/add.blade.php @@ -20,6 +20,7 @@
{{$pireps[$i]["departureId"]}} / {{$pireps[$i]["arrivalId"]}} | {{$pireps[$i]["callsign"]}} | - | diff --git a/resources/views/pirep/show.blade.php b/resources/views/pirep/show.blade.php index 516fe70..abaccf5 100644 --- a/resources/views/pirep/show.blade.php +++ b/resources/views/pirep/show.blade.php @@ -1,3 +1,7 @@ + @extends("metar-base") @section("title", "Flight Plan System") @@ -13,117 +17,110 @@