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 all 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
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
8 changes: 5 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,9 @@

Route::get("crypt", function (Request $request) {
$encrypted = Crypt::encryptString('la vie de devs est cool.');
$decrypted = Crypt::decryptString("eyJpdiI6Ik94UDRsMlR4NGRSWHVjazljTXJhQVE9PSIsInZhbHVlIjoiWlZWdGNNdXZabDFlTGQrLzRTVytwejFtV25MRGVibk1IUXB2bDZwVEF2ST0iLCJtYWMiOiJkZmVkOTNhZWM2NmY2MTEyNjhjYjYyMDZiN2FjM2I3MmMwZjY3ZGNiNTJjOTVmOGZiMjRlM2Q3ODE3NTU2ZDQ1IiwidGFnIjoiIn0=");
dd($decrypted);
})->name("crypto");
$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");

});

Loading