@push('styles')
@endpush
@php
$trainers = $user->trainers ?? collect();
$totalBookings = $courtBookings->count();
$paidBookings = $courtBookings->where('payment_status', 'PAID')->count();
$pendingBookings = $courtBookings->where('payment_status', 'PENDING')->count()
+ $courtBookings->where('payment_status', 'UNPAID')->count();
$cancelledBookings = $courtBookings->filter(function ($booking) {
return (int) $booking->is_canceled === 1 || $booking->status === 'CANCELLED';
})->count();
$totalLessons = collect($lessonSchedule)->count();
$nextLesson = collect($lessonSchedule)->first();
$availability = collect(old('weekly_availability', $user->weekly_availability ?? []))->values();
$savedAvailability = collect($user->weekly_availability ?? [])->values();
$age = $user->birth_date ? \Carbon\Carbon::parse($user->birth_date)->age : null;
$dominantHandLabel = $user->dominant_hand === 'left' ? 'Esquerda' : ($user->dominant_hand === 'right' ? 'Direita' : '—');
$genderLabel = $user->gender === 'female' ? 'Feminino' : ($user->gender === 'male' ? 'Masculino' : '—');
@endphp
{{-- Header --}}
Saldo wallet
{{ number_format((float)($walletBalanceReal ?? 0), 2, ',', ' ') }}€
Saldo real por movimentos
Pontos
{{ $user->points ?? 0 }}
Acumulados no perfil
Marcações campo
{{ $totalBookings }}
Histórico sincronizado
Aulas
{{ $totalLessons }}
Agendadas no histórico
@if(session('status'))
{{ session('status') }}
@endif
@if($errors->any())
Revê os campos:
@foreach($errors->all() as $error)
{{ $error }}
@endforeach
@endif
{{-- Tabs --}}
Resumo
Perfil jogador
Wallet
Vouchers
Encomenda
Aulas
Histórico
{{-- ======================================================
* TAB: OVERVIEW
* ====================================================== --}}
{{-- ======================================================
* TAB: PLAYER PROFILE
* ====================================================== --}}
{{-- ======================================================
* TAB: WALLET
* ====================================================== --}}
{{-- ======================================================
* TAB: VOUCHERS
* ====================================================== --}}
{{-- ======================================================
* TAB: ORDERS (Backoffice)
* ====================================================== --}}
{{-- ======================================================
* TAB: LESSONS
* ====================================================== --}}
Histórico / agenda de aulas
Esta secção passou para a tab Aulas , para ficar toda a operação de aulas no mesmo sítio.
Total
{{ $totalLessons }}
Próxima
@if($nextLesson)
{{ \Carbon\Carbon::parse($nextLesson->date)->format('d/m') }}
@else
—
@endif
@forelse($lessonSchedule as $lesson)
@php
$lessonDate = \Carbon\Carbon::parse($lesson->date);
@endphp
{{ $lessonDate->format('d') }}
{{ $lessonDate->translatedFormat('M') }}
{{ ucfirst($lessonDate->translatedFormat('D')) }}
{{ $lesson->coach ?? 'Treinador' }}
{{ $lesson->type ?? 'Aula' }}
Agendada
@empty
Sem aulas registadas
Ainda não existem aulas agendadas para este utilizador.
@endforelse
{{-- ======================================================
* TAB: HISTORY
* ====================================================== --}}
{{-- MODAL: Confirm lesson --}}
Confirmar marcação de aula
Revê os dados antes de confirmar. O valor será debitado da wallet.
Fechar
Saldo insuficiente para esta marcação.
Cancelar
Confirmar marcação
@endsection
@push('scripts')
{{-- Tabs logic --}}
{{-- Slots fetch --}}
{{-- Slots fetch --}}
{{-- Order lines + vouchers filter + product search --}}
@php
$AZP_COACH_RATES = $coaches->map(function ($c) {
return [
'id' => $c->id,
'name' => $c->name,
'rates' => $c->rates ? [
'off_60' => (float) $c->rates->off_60,
'off_90' => (float) $c->rates->off_90,
'peak_60' => (float) $c->rates->peak_60,
'peak_90' => (float) $c->rates->peak_90,
] : null,
];
})->values()->toArray();
@endphp
@endpush