{{-- Messaggio di successo --}} @if (session()->has('success'))
Prenotazione confermata
{{ session('success') }}
@auth @if(auth()->user()?->role === \App\Models\User::ROLE_PATIENT) @endif @endauth
@endif @if (session()->has('error'))
{{ session('error') }}
@endif {{-- CARD MEDICO + INFO PAZIENTE LOGGATO --}} @include('partials.patient-header') @php $nextAvailableSlot = null; foreach ($weekDays as $bookingDay) { if (!empty($bookingDay['slots'])) { $nextAvailableSlot = $bookingDay['slots'][0]; break; } } @endphp
Prenotazione online

Prenota una visita con {{ $doctor->name }}

Seleziona il giorno e l’orario disponibile che preferisci per continuare con la prenotazione.

@php $nextSlots = []; foreach ($weekDays as $bookingDay) { foreach ($bookingDay['slots'] as $slot) { $nextSlots[] = $slot; if(count($nextSlots) >= 3) break; } if(count($nextSlots) >= 3) break; } @endphp @if(!empty($nextSlots))
Prossime disponibilità
@foreach($nextSlots as $slot) @endforeach
Oppure scorri sotto per vedere tutte le disponibilità della settimana ↓
@endif
{{-- HEADER SETTIMANA --}} @php $start = \Carbon\Carbon::parse($weekStartDate); $end = $start->copy()->addDays(6); @endphp
Settimana
{{ $start->format('d/m/Y') }}
{{ $end->format('d/m/Y') }}
{{-- GRIGLIA SETTIMANA --}}
@foreach($weekDays as $day) @if(!empty($day['slots'])) @php $date = \Carbon\Carbon::parse($day['date']); $isToday = $date->isToday(); @endphp
{{-- Giorno --}}
{{ $day['label'] }}
{{-- Slot --}}
@foreach($day['slots'] as $slot) @endforeach
@endif @endforeach
{{-- ------------------------------------------------------------- --}} {{-- MODAL: Accesso/Registrazione obbligatori per utenti non loggati --}} {{-- ------------------------------------------------------------- --}} @if($showAuthNotice)
{{-- Overlay --}}
{{-- Modal --}}

Per prenotare devi accedere

Per completare la prenotazione devi prima accedere o registrarti al portale.

@php $redirectUrl = url()->current() . '?slot=' . urlencode($pendingSlot); @endphp
@endif {{-- ------------------------------------------------------------- --}} {{-- MODAL PRENOTAZIONE (solo utenti loggati) --}} {{-- ------------------------------------------------------------- --}} @if($showModal && $selectedSlot)
@php $user = auth()->user(); $lockFields = $user && !in_array($user->role, ['doctor', 'secretary']); @endphp

Conferma appuntamento

Appuntamento con {{ $doctor->name }}
per il {{ \Carbon\Carbon::parse($selectedSlot)->format('d/m/Y') }} alle {{ \Carbon\Carbon::parse($selectedSlot)->format('H:i') }}

{{-- HONEYPOT ANTI BOT --}} {{-- Prestazioni --}} @if(!empty($services))
@error('service_id')
{{ $message }}
@enderror
@endif {{-- DATI PAZIENTE --}}
@error('patient_name')
{{ $message }}
@enderror
@error('patient_phone')
{{ $message }}
@enderror
@error('patient_email')
{{ $message }}
@enderror
{{-- Pulsanti --}}
@endif {{-- ------------------------------------------------------------- --}} {{-- MODAL CONFERMA PRENOTAZIONE --}} {{-- ------------------------------------------------------------- --}} @if($showSuccessModal && $successAppointmentData)
Prenotazione confermata
Il tuo appuntamento è stato registrato correttamente.
Hai prenotato {{ $successAppointmentData['service_name'] }}
con {{ $successAppointmentData['doctor_name'] }}
il {{ $successAppointmentData['date_label'] }} alle {{ $successAppointmentData['time_label'] }}
@auth @if(auth()->user()?->role === \App\Models\User::ROLE_PATIENT) I tuoi appuntamenti @endif @endauth
@endif