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

Commit

Permalink
Fixed Tracker (#122)
Browse files Browse the repository at this point in the history
* Feacture

* testing

* Fixed Tracker

* changelog
  • Loading branch information
alexcaussades authored Nov 11, 2023
1 parent f5a1a83 commit ca39c29
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 34 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthIVAOController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function sso(Request $request, $url = "home")

$base_url = $openid_data["authorization_endpoint"];
$reponse_type = "code";
$scopes = "profile friends:read friends:write flight_plans:read flight_plans:write";
$scopes = "profile friends:read friends:write flight_plans:read flight_plans:write tracker";
$state = rand(100000, 999999); // Random string to prevent CSRF attacks

$query = [
Expand Down
42 changes: 33 additions & 9 deletions app/Http/Controllers/whazzupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,34 @@ public function user_me()
$users_me = $users_me->json();
$users_me = collect($users_me);
$users_me = $users_me->toArray();


/** convertir timestant uniquement en heure en addition des jours */
$heure = Carbon::createFromTimestamp(0)->format('Y-m-d H:i:s');
$atc = Carbon::createFromTimestamp($users_me["hours"][0]["hours"])->format('Y-m-d H:i:s');
$atc = Carbon::createFromTimestamp($users_me["hours"][0]["hours"])->format('Y-m-d H:i');
/** diff entre heure et minutes $atc */
$atc1 = Carbon::parse($atc);
$heure = Carbon::parse($heure);
$atc = $atc1->diffInHours($heure);
$atc = $atc1->diffInMinutes($heure) / 60;
$heure = Carbon::createFromTimestamp($users_me["hours"][1]["hours"])->format('Y-m-d H:i:s');
$heure = Carbon::parse($heure);
$heure = $heure->diffInHours($heure);

/** Rounded heure ATC */
$atc = round($atc, 2);

/** Pilot */
$pilot = Carbon::createFromTimestamp($users_me["hours"][1]["hours"])->format('Y-m-d H:i');
$pilot1 = Carbon::parse($pilot);
$pilot = $pilot1->diffInHours($heure);
$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);
$staff = $staff1->diffInHours($heure);
$staff = $staff1->diffInMinutes($heure) / 60;
/** Rounded heure Staff */
$staff = round($staff, 2);



Expand All @@ -361,10 +377,10 @@ public function user_me()
"Hours" => [
/** conversion value timestamp en heure */

"AtcHours" => Carbon::createFromTimestamp($users_me["hours"][0]["hours"]),
"PilotHours" => $users_me["hours"][1]["hours"],
"StaffHours" => $users_me["hours"][2]["hours"],
"TotalHours" => null,
"AtcHours" => $atc,
"PilotHours" => $pilot,
"StaffHours" => $staff,
"TotalHours" => $atc + $pilot,


],
Expand Down Expand Up @@ -633,4 +649,12 @@ public function get_aircrafts($icao_code)
return $aircrafts;

}

public function event_ivao()
{
$event = $this->API_request("/v1/events");
$event = $event->json();
return $event;
}

}
71 changes: 47 additions & 24 deletions database/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"option": [
{
"id": 0,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Connect SSO with the application on IVAO"
},
Expand All @@ -33,7 +33,7 @@
},
{
"id": 1,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Add Booking System (hors add on IVAO)"
},
Expand Down Expand Up @@ -65,13 +65,13 @@
},
{
"id": 1,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": " Add Changelog page"
}
]
},
"3":{
"3": {
"id": 4,
"name": "2023 / 29",
"date": "2023-10-02",
Expand All @@ -85,7 +85,7 @@
},
{
"id": 1,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": " Add Changelog page for menu"
},
Expand All @@ -97,46 +97,45 @@
}
]
},
"4":{
"4": {
"id": 5,
"name": "2023 / 30",
"date": "2023-10-04",
"version": "event/ximea-0.1.0",
"option": [
{
"id": 0,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Add Page Event Ximea"
},
{
"id": 1,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Create Controller event Ximea"
},
{
"id": 2,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Create Model event Ximea"
},
{
"id": 3,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Create View event Ximea"
},
{
"id": 4,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Create CSS event Ximea"
}

]
},
"5":{
"5": {
"id": 6,
"name": "2023 / 31",
"date": "2023-10-18",
Expand All @@ -160,31 +159,29 @@
"btn": "warning",
"description": "Change Version VID search"
}

]
},
"6":
{
},
"6": {
"id": 7,
"name": "2023 / 32",
"date": "2023-10-23",
"version": "26.2.3",
"option":[
"option": [
{
"id": 0,
"type": "Change",
"btn": "warning",
"description": "Modification API IVAO"
}
]
},
"7":
{
},
"7": {

"id": 8,
"name": "2023 / 33",
"date": "2023-11-02",
"version": "26.2.4",
"option":[
"option": [
{
"id": 0,
"type": "Change",
Expand All @@ -199,10 +196,36 @@
},
{
"id": 2,
"type": "Feacture",
"type": "Feature",
"btn": "success",
"description": "Add Page users offline"
}
]
}
},
"8": {
"id": 9,
"name": "2023 / 34",
"date": "2023-11-11",
"version": "26.2.5",
"option": [
{
"id": 0,
"type": "Bug Fix",
"btn": "danger",
"description": "Fixed tracker infos pages welcome"
},
{
"id": 1,
"type": "Bug Fix",
"btn": "danger",
"description": "Correct parase data on the page welcome"
},
{
"id": 2,
"type": "Feature",
"btn": "success",
"description": "Prepare the favorites metar (not finished) | (V.0.0.2 in progress)"
}
]
}
}
20 changes: 20 additions & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@
Route::get("/whazzup", function(Request $request){

$whazzup = new whazzupController();
$whazzup->get_session();
$r = $whazzup->whazzup_api_traker();
return $r;
});


Route::get("info_plateforme/{icao}", function(Request $request){
$whazzup = new whazzupController();
$ATC = $whazzup->ckeck_online_atc($request->icao);
$PILOT = $whazzup->get_traffics_count($request->icao);
$METAR = $whazzup->Get_metar($request->icao);
$METAR = json_decode($METAR, true);
$METAR = $METAR["metar"];
$info = [
"ATC" => $ATC,
"PILOT" => $PILOT,
"METAR" => $METAR
];
$k = serialize($info);
$k = base64_encode($k);

return $k;
});

0 comments on commit ca39c29

Please sign in to comment.