@extends('admin.layouts.app') @php $tz = \App\Support\Time\BookingsTimezone::business(); $A = \App\Models\EventInvestorAttendance::class; @endphp @section('title', __('admin.events.attendance.title') . ' — ' . $event->title) @section('page_title', __('admin.events.attendance.title')) @push('styles') @endpush @section('content') {{ __('admin.events.show') }} {{ __('admin.actions.back_to_list') }} @include('admin.partials.flash') @error('admin_status')
{{ $message }}
@enderror {{-- Counts double as filters: clicking a card filters the table to exactly the rows it counted. Both come from the same query definition, so the number on the card always equals the rows below. --}} @php $cards = [ ['key' => 'all', 'n' => $counts['eligible'], 'label' => __('admin.events.attendance.eligible'), 'mod' => ''], ['key' => 'never_opened', 'n' => $counts['never_opened'], 'label' => __('admin.events.attendance.never_opened'), 'mod' => ''], ['key' => 'viewed', 'n' => $counts['awaiting'], 'label' => __('admin.events.attendance.awaiting'), 'mod' => 'att-stat--warn'], ['key' => 'confirmed', 'n' => $counts['confirmed'], 'label' => __('admin.events.attendance.confirmed'), 'mod' => 'att-stat--good'], ['key' => 'attended', 'n' => $counts['attended'], 'label' => __('admin.events.attendance.attended'), 'mod' => 'att-stat--good'], ['key' => 'no_show', 'n' => $counts['did_not_attend'], 'label' => __('admin.events.attendance.did_not_attend'), 'mod' => ''], ['key' => 'pending_review', 'n' => $counts['not_reviewed'], 'label' => __('admin.events.attendance.not_reviewed'), 'mod' => 'att-stat--warn'], ]; @endphp
@foreach ($cards as $card) {{ $card['n'] }} {{ $card['label'] }} @endforeach
@unless ($canReview)
{{ __('admin.events.attendance.review_after_end') }}
@endunless @if ($counts['retained'] > 0)
{{ trans_choice('admin.events.attendance.retained_note', $counts['retained'], ['count' => $counts['retained']]) }}
@endif
@if (filled($search)) {{ __('admin.events.attendance.clear_search') }} @endif
@if ($rows->isEmpty()) @else
@if ($canUpdate) @endif @foreach ($rows as $row) @php $viewedAt = $row->viewed_at ? \Illuminate\Support\Carbon::parse($row->viewed_at)->setTimezone($tz) : null; $confirmedAt = $row->confirmed_at ? \Illuminate\Support\Carbon::parse($row->confirmed_at)->setTimezone($tz) : null; $reviewedAt = $row->admin_status_at ? \Illuminate\Support\Carbon::parse($row->admin_status_at)->setTimezone($tz) : null; $verdict = $row->admin_status ?: $A::ADMIN_PENDING; $eligible = (bool) $row->is_eligible; @endphp @if ($canUpdate) @endif @endforeach
{{ __('admin.events.attendance.investor') }} {{ __('admin.events.fields.groups') }} {{ __('admin.events.attendance.participation') }} {{ __('admin.events.attendance.verdict') }}{{ __('admin.fields.actions') }}
{{ $row->full_name_en ?: ($row->full_name_ar ?: ($row->first_name ?: '#' . $row->id)) }} {{-- Contact data appears only on this permission-gated page, never on the event show page. --}} @if ($row->phone_number) {{ $row->phone_number }} @endif @if ($row->email) {{ $row->email }} @endif @if ($row->group_name) {{ $row->group_name }} @else — @endif {{-- Interacted, then left the audience. Retained on purpose: a confirmation is a historical fact and must not vanish because someone changed group. --}} @unless ($eligible) {{ __('admin.events.attendance.retained') }} @endunless @if ($confirmedAt) {{ $confirmedAt->format('Y-m-d H:i') }} @elseif ($viewedAt) {{ $viewedAt->format('Y-m-d H:i') }} @else @endif @if ($verdict === $A::ADMIN_ATTENDED) @elseif ($verdict === $A::ADMIN_DID_NOT_ATTEND) @else @endif @if ($reviewedAt && $verdict !== $A::ADMIN_PENDING) {{ $reviewedAt->format('Y-m-d H:i') }} @endif {{-- Rendered only after the event has ended. The recorder enforces the same rule server-side, so hiding these is convenience, not the control. --}} @if ($canReview)
@csrf @if ($verdict !== $A::ADMIN_PENDING) @endif
@else {{ __('admin.events.attendance.locked') }} @endif
{{ $rows->links() }}
@endif
@endsection