@include('backend.participants.show-user-data')
{{-- {{ dd(session('data'), ['workshop'], session('data')['workshop']) }} --}}
@if (isset(session('data')['workshop']))
|
Désignation
|
Prix
|
@php
$totalPrice = 0;
$has_adhesion = false;
if ($event->slug === '13jmfm') {
$formationTiers = [1 => 40, 2 => 80, 3 => 100, 4 => 130, 5 => 150];
$inscriptionItem = null;
$formations = [];
$otherItems = [];
foreach (session('data')['workshop'] as $atelierInfo) {
if (!$atelierInfo) {
continue;
}
$values = explode('|', $atelierInfo);
$atelierId = $values[0];
$atelierPrice = $values[1];
$atelier = Workshop::where('id', $atelierId)->first();
if ($atelierId == $event->adhesion_id) {
$has_adhesion = true;
}
if ($atelier && $atelier->f2 === 'formation') {
$formations[] = [
'workshop' => $atelier,
'price' => $atelierPrice,
];
} elseif ($atelier && $atelier->f2 === 'inscription') {
$inscriptionItem = [
'workshop' => $atelier,
'price' => $atelierPrice,
];
$totalPrice += $atelierPrice;
} else {
$otherItems[] = [
'workshop' => $atelier,
'price' => $atelierPrice,
];
$totalPrice += $atelierPrice;
}
}
$formationCount = count($formations);
$formationTotal =
$formationTiers[$formationCount] ?? $formationCount * 40;
$totalPrice += $formationTotal;
}
@endphp
@if ($event->slug === '13jmfm')
@if ($inscriptionItem)
| {{ $inscriptionItem['workshop']->titre ?? '' }} |
{{ $inscriptionItem['price'] }} TND
|
@endif
@if ($formationCount > 0)
Ateliers ({{ $formationCount }})
@foreach ($formations as $f)
- {{ $f['workshop']->titre ?? '' }}
@endforeach
|
{{ $formationTotal }} TND |
@endif
@foreach ($otherItems as $o)
| {{ $o['workshop']->titre ?? '' }} |
{{ $o['price'] }} TND |
@endforeach
@else
@foreach (session('data')['workshop'] as $atelierKey => $atelierInfo)
@if ($atelierInfo)
@php
$values = explode('|', $atelierInfo);
$atelierId = $values[0];
$atelierPrice = $values[1];
$atelier = Workshop::where('id', $atelierId)->first();
$totalPrice = $totalPrice + $atelierPrice;
if ($atelierId == $event->adhesion_id) {
$has_adhesion = true;
}
@endphp
|
{{ $atelier->titre ?? '' }}
|
{{ $atelierPrice ?? '' }} TND
|
@endif
@endforeach
@endif
|
Total
|
{{ $totalPrice }}
TND
|
|
Moyen de paiement
|
{{ session('data')['paiement_mode'] }}
|
@endif
@if (isset(session('data')['workshop']))
@endif
Les montants saisis ne correspondent pas au total de l'inscription !