@php use App\Models\Workshop; @endphp @extends('backend.layouts.master') @section('title') Validation inscription @endsection @section('css') @section('select2', true) @endsection @section('body') @endsection @section('content')
Revalider inscription « {{ $participant->user->firstname }} {{ $participant->user->name }} »
@include('backend.participants.show-user-data') {{-- {{ dd(session('data'), ['workshop'], session('data')['workshop']) }} --}} @if (isset(session('data')['workshop']))
@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(); // multi-use quantity from session data (if any) $qty = 1; if ( isset(session('data')['multi_use_qty']) && isset(session('data')['multi_use_qty'][$atelierId]) ) { $qty = max(1, (int) session('data')['multi_use_qty'][$atelierId]); } $linePrice = $atelierPrice * $qty; if ($atelierId == $event->adhesion_id) { $has_adhesion = true; } if ($atelier && $atelier->f2 === 'formation') { $formations[] = [ 'workshop' => $atelier, 'price' => $atelierPrice, 'qty' => $qty, 'line_price' => $linePrice, ]; } elseif ($atelier && $atelier->f2 === 'inscription') { $inscriptionItem = [ 'workshop' => $atelier, 'price' => $atelierPrice, 'qty' => $qty, 'line_price' => $linePrice, ]; $totalPrice += $linePrice; } else { $otherItems[] = [ 'workshop' => $atelier, 'price' => $atelierPrice, 'qty' => $qty, 'line_price' => $linePrice, ]; $totalPrice += $linePrice; } } $formationCount = count($formations); $formationTotal = $formationTiers[$formationCount] ?? $formationCount * 40; $totalPrice += $formationTotal; } @endphp @if ($event->slug === '13jmfm') @if ($inscriptionItem) @endif @if ($formationCount > 0) @endif @foreach ($otherItems as $o) @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(); $qty = 1; if ( isset(session('data')['multi_use_qty']) && isset(session('data')['multi_use_qty'][$atelierId]) ) { $qty = max( 1, (int) session('data')['multi_use_qty'][$atelierId], ); } $linePrice = $atelierPrice * $qty; $totalPrice += $linePrice; if ($atelierId == $event->adhesion_id) { $has_adhesion = true; } @endphp @endif @endforeach @endif
Désignation Prix
{{ $inscriptionItem['workshop']->titre ?? '' }} {{ $inscriptionItem['price'] }} TND
Ateliers ({{ $formationCount }})
    @foreach ($formations as $f)
  • {{ $f['workshop']->titre ?? '' }}
  • @endforeach
{{ $formationTotal }} TND
{{ $o['workshop']->titre ?? '' }} @if (isset($o['qty']) && $o['qty'] > 1) ×{{ $o['qty'] }} @endif {{ $o['line_price'] ?? $o['price'] }} TND
{{ $atelier->titre ?? '' }} @if ($qty > 1) ×{{ $qty }} @endif {{ $linePrice ?? ($atelierPrice ?? '') }} TND
Total {{ $totalPrice }} TND
Moyen de paiement {{ session('data')['paiement_mode'] }}
@endif @if (isset(session('data')['workshop'])) @endif
@csrf @include('backend.participants.categories')
@endsection @section('scripts') @endsection