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

Maj version Event #157

Merged
merged 4 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
38 changes: 19 additions & 19 deletions app/Http/Controllers/EventIvaoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public function __construct()
public function get_event_ivao_world(){
$eventIvaoWorld = [];
for ($i=0; $i < count($this->event) ; $i++) {
$eventIvaoWorld[$i]['startDate'] = date('Y-m-d H:i:s', strtotime($this->event[$i]['startDate']));
$eventIvaoWorld[$i]['endDate'] = date('Y-m-d H:i:s', strtotime($this->event[$i]['endDate']));
$eventIvaoWorld[$i]['title'] = $this->event[$i]['title'];
$eventIvaoWorld[$i]['imageUrl'] = $this->event[$i]['imageUrl'];
$eventIvaoWorld[$i]['description'] = $this->event[$i]['description'];
$eventIvaoWorld[$i]['infoUrl'] = $this->event[$i]['infoUrl'];
$eventIvaoWorld[$i]['divisions'] = $this->event[$i]['divisions'];
$eventIvaoWorld[$i]['airports'] = $this->event[$i]['airports'];
$eventIvaoWorld[$i]['startDate'] = date('Y-m-d H:i:s', strtotime($this->event[$i]['startDate'])) ?? NULL;
$eventIvaoWorld[$i]['endDate'] = date('Y-m-d H:i:s', strtotime($this->event[$i]['endDate'])) ?? NULL;
$eventIvaoWorld[$i]['title'] = $this->event[$i]['title'] ?? NULL;
$eventIvaoWorld[$i]['imageUrl'] = $this->event[$i]['imageUrl'] ?? NULL;
$eventIvaoWorld[$i]['description'] = $this->event[$i]['description'] ?? NULL;
$eventIvaoWorld[$i]['infoUrl'] = $this->event[$i]['infoUrl'] ?? NULL;
$eventIvaoWorld[$i]['divisions'] = $this->event[$i]['divisions'] ?? NULL;
$eventIvaoWorld[$i]['airports'] = $this->event[$i]['airports'] ?? NULL;

}

Expand All @@ -45,14 +45,14 @@ public function get_event_ivao_RFE_RFO(){
$rfe_rfo = [];
for ($i=0; $i < count($rfe) ; $i++) {
if(preg_match($regexpr, $rfe[$i]['title'])){
$rfe_rfo[$i]['startDate'] = $rfe[$i]['startDate'];
$rfe_rfo[$i]['endDate'] = $rfe[$i]['endDate'];
$rfe_rfo[$i]['title'] = $rfe[$i]['title'];
$rfe_rfo[$i]['imageUrl'] = $rfe[$i]['imageUrl'];
$rfe_rfo[$i]['description'] = $rfe[$i]['description'];
$rfe_rfo[$i]['infoUrl'] = $rfe[$i]['infoUrl'];
$rfe_rfo[$i]['divisions'] = $rfe[$i]['divisions'];
$rfe_rfo[$i]['airports'] = $rfe[$i]['airports'];
$rfe_rfo[$i]['startDate'] = $rfe[$i]['startDate'] ?? NULL;
$rfe_rfo[$i]['endDate'] = $rfe[$i]['endDate'] ?? NULL;
$rfe_rfo[$i]['title'] = $rfe[$i]['title'] ?? NULL;
$rfe_rfo[$i]['imageUrl'] = $rfe[$i]['imageUrl'] ?? NULL;
$rfe_rfo[$i]['description'] = $rfe[$i]['description'] ?? NULL;
$rfe_rfo[$i]['infoUrl'] = $rfe[$i]['infoUrl'] ?? NULL;
$rfe_rfo[$i]['divisions'] = $rfe[$i]['divisions'] ?? NULL;
$rfe_rfo[$i]['airports'] = $rfe[$i]['airports'] ?? NULL;
}
}
$newrfe_rfo = array_values($rfe_rfo);
Expand Down Expand Up @@ -80,7 +80,7 @@ public function get_event_ivao_FR_days(){
array_push($event_day, $envent_day);
}
} catch (\Throwable $th) {
$event_day = [];
$event_day = NULL;
}
return $event_day;
}
Expand Down Expand Up @@ -116,8 +116,8 @@ public function get_event_ivao_FR_tomorrow(){
public function get_event_ivao_FR(){
$eventIvaoFR = [];
$eventIvaoFR = [
'today' => $this->get_event_ivao_FR_days(),
'tomorrow' => $this->get_event_ivao_FR_tomorrow(),
'today' => $this->get_event_ivao_FR_days() ?? NULL,
'tomorrow' => $this->get_event_ivao_FR_tomorrow() ?? NULL,
];
return $eventIvaoFR;
}
Expand Down
5 changes: 3 additions & 2 deletions app/Http/Controllers/PilotIvaoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ public function getApideparturePilot($icao)
$api = $this->whazzup();
$count = $api["connections"]["pilot"];
$pilot = $api["clients"]["pilots"];
//dd($pilot[0]["flightPlan"]["departureId"]);
$pilotDeparture = [];
for ($i = 0; $i <= $count; $i++) {
foreach ($pilot as $key => $value) {
foreach ($pilot as $i => $value) {
if ($value["flightPlan"]["departureId"] == $icao) {
array_push($pilotDeparture, $value);
}
Expand All @@ -39,7 +40,7 @@ public function getApiArrivalPilot($icao)
$pilot = $api["clients"]["pilots"];
$PilotArrival = [];
for ($i = 0; $i <= $count; $i++) {
foreach ($pilot as $key => $value) {
foreach ($pilot as $i => $value) {
if ($value["flightPlan"]["arrivalId"] == $icao) {
array_push($PilotArrival, $value);
}
Expand Down
33 changes: 33 additions & 0 deletions resources/views/event_fr.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<h5 class="fw-bold">IVAO Event FR</h5>

<div class="row">
@foreach($event_fr as $events)
@if (isset($events[0]["type"]) == "training" || isset($events[0]["type"]) == "exam")
<div class="col-6 mt-2">
<div class="card text-white bg-dark">
<div class="card-body">
@if ($events[0]["type"] == "training")
@if (ENV('APP_ENV') == 'local')
<img class="card-img-top" src="{{ asset("asset/img/training/training.png") }}" alt="">
@else
<img class="card-img-top" src="{{ asset("public/asset/img/training/training.png") }}" alt="">
@endif
@endif
@if ($events[0]["type"] == "exam")
@if (ENV('APP_ENV') == 'local')
<img class="card-img-top" src="{{ asset("asset/img/exam/exam.png") }}" alt="">
@else
<img class="card-img-top" src="{{ asset("public/asset/img/exam/exam.png") }}" alt="">
@endif
@endif
<p class="card-text text-center text-info mt-2">{{$events[0]["name"]}}</p>
<p class="card-text text-center ">{{$events[0]["description"]}}</p>
<p class="card-text text-center "><button class="btn btn-outline-success">{{Carbon::parse($events[0]["started_at"])->format('d-m H:i') }}Z</button> </p>
</div>
</div>
</div>
@endif
@endforeach
</div>
</div>
<hr>
21 changes: 21 additions & 0 deletions resources/views/event_world.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="container mt-2">
<h5 class="fw-bold">IVAO Event World</h5>
<div class="row">
@foreach($event_worl as $eventss)
<div class="col-6 mt-2">
<div class="card text-white bg-dark">
<div class="card-body">
<img src="{{$eventss['imageUrl']}}" style="width: 100%; height: 80%;" alt="" srcset="">
<h5 class="card-text text-center text-info mt-2">{{$eventss["title"]}} / {{$eventss["airports"][0]}} </h5>
<div class=" d-flex justify-content-center">
@for ($i = 0 ; $i < count($eventss["divisions"]) ; $i++ )
<span class="badge bg-secondary fs-6 ms-2"> {{$eventss["divisions"][$i]}}</span>
@endfor
</div>
<p class="card-text text-center ">{{$eventss["description"]}}</p>
<a href="{{$eventss["infoUrl"]}}" class="float-end"><button class="btn btn-outline-primary">More Information</button></a>
</div>
</div>
</div>
@endforeach
</div>
61 changes: 7 additions & 54 deletions resources/views/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,60 +162,13 @@

<hr>
<div class="container mt-2">
<h5 class="fw-bold">IVAO Event FR</h5>

<div class="row">
@foreach($event_fr as $events)
@if (isset($events[0]["type"]) == "training" || isset($events[0]["type"]) == "exam")
<div class="col-6 mt-2">
<div class="card text-white bg-dark">
<div class="card-body">
@if ($events[0]["type"] == "training")
@if (ENV('APP_ENV') == 'local')
<img class="card-img-top" src="{{ asset("asset/img/training/training.png") }}" alt="">
@else
<img class="card-img-top" src="{{ asset("public/asset/img/training/training.png") }}" alt="">
@endif
@endif
@if ($events[0]["type"] == "exam")
@if (ENV('APP_ENV') == 'local')
<img class="card-img-top" src="{{ asset("asset/img/exam/exam.png") }}" alt="">
@else
<img class="card-img-top" src="{{ asset("public/asset/img/exam/exam.png") }}" alt="">
@endif
@endif
<p class="card-text text-center text-info mt-2">{{$events[0]["name"]}}</p>
<p class="card-text text-center ">{{$events[0]["description"]}}</p>
<p class="card-text text-center "><button class="btn btn-outline-success">{{Carbon::parse($events[0]["started_at"])->format('d-m H:i') }}Z</button> </p>
</div>
</div>
</div>
@endif
@endforeach
</div>
</div>
@if (isset($event_fr) == null )
@include('event_fr')
@endif

@if (isset($event_en) == null )
@include('event_world')
@endif

<hr>
<div class="container mt-2">
<h5 class="fw-bold">IVAO Event World</h5>
<div class="row">
@foreach($event_worl as $events)
<div class="col-6 mt-2">
<div class="card text-white bg-dark">
<div class="card-body">
<img src="{{$events['imageUrl']}}" style="width: 100%; height: 80%;" alt="" srcset="">
<h5 class="card-text text-center text-info mt-2">{{$events["title"]}} / {{$events["airports"][0]}} </h5>
<div class=" d-flex justify-content-center">
@for ($i = 0 ; $i < count($events["divisions"]) ; $i++ )
<span class="badge bg-secondary fs-6 ms-2"> {{$events["divisions"][$i]}}</span>
@endfor
</div>
<p class="card-text text-center ">{{$events["description"]}}</p>
<a href="{{$events["infoUrl"]}}" class="float-end"><button class="btn btn-outline-primary">More Information</button></a>
</div>
</div>
</div>
@endforeach
</div>

@endsection
23 changes: 17 additions & 6 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Mail;
use Monolog\Formatter\JsonFormatter;
use Illuminate\Support\Facades\Crypt;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mise à jour des crytpages

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AtcController;
use Illuminate\Support\Facades\Session;
Expand Down Expand Up @@ -602,13 +603,14 @@

Route::post("create", function (Request $request) {
$github = new GithubController();
// dd($request);
// $request->merge([
// "user_id" => Auth::user()->id ?? null,
// "body" => $request->body,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validation ok

// "link" => $github,
// "label" => $request->label
// ]);
$github = $github->send_issue($request);
$request->merge([
"user_id" => Auth::user()->id ?? null,
"body" => $request->body,
"link" => $github,
"label" => $request->label
]);
$discord = new DiscordContoller();
$discord->send_feedback($request);
return to_route("feedback.index")->with("success", "Votre feedback à été envoyé !");
Expand Down Expand Up @@ -670,4 +672,13 @@
return $event_world;

})->name("event.index");

Route::get("crypt", function (Request $request) {
$encrypted = Crypt::encryptString('la vie de devs est cool.');
$decrypted = Crypt::decryptString($encrypted);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test de cryptage ok

dd($encrypted, $decrypted);
})->name("crypto");


});