@extends('student.layouts.app') @section('title', app()->getLocale() === 'ar' ? 'مسح رمز QR للحضور' : 'Scan QR Attendance') @section('content') @php $isAr = app()->getLocale() === 'ar'; @endphp
@if(!request()->has('token')) {{-- No token: show scanner instructions --}}

{{ $isAr ? 'مسح رمز QR للحضور' : 'Scan Attendance QR Code' }}

{{ $isAr ? 'امسح رمز QR الذي يعرضه المعلم لتسجيل حضورك تلقائياً.' : 'Scan the QR code shown by your teacher to automatically record your attendance.' }}

{{ $isAr ? 'استخدم كاميرا هاتفك لمسح رمز QR أو اطلب من المعلم مشاركة الرابط معك.' : 'Use your phone camera to scan the QR code, or ask your teacher to share the link.' }}
@elseif($error) {{-- Error state --}}

{{ $isAr ? 'تعذّر تسجيل الحضور' : 'Attendance Failed' }}

{{ $error }}

{{ $isAr ? 'العودة للرئيسية' : 'Back to Home' }} @elseif($success) {{-- Success state --}}

{{ $isAr ? 'تم تسجيل حضورك بنجاح!' : 'Attendance Recorded!' }}

@if($attendance)
{{ $isAr ? 'المادة' : 'Course' }} {{ $attendance->course->name ?? '-' }}
{{ $isAr ? 'التاريخ' : 'Date' }} {{ $attendance->date->format('d M, Y') }}
{{ $isAr ? 'النوع' : 'Type' }} {{ $attendance->type === 'school' ? ($isAr ? 'حصة مدرسية' : 'School') : ($isAr ? 'حصة افتراضية' : 'Virtual') }}
@endif {{ $isAr ? 'العودة للرئيسية' : 'Back to Home' }} @endif
@endsection