@extends('layouts.app') @php $locale = app()->getLocale(); $isRtl = $locale === 'ar'; $name = $isRtl && $gate->name_ar ? $gate->name_ar : $gate->name; $typeLabels = [ 'entry' => $isRtl ? 'دخول' : 'Entry', 'exit' => $isRtl ? 'خروج' : 'Exit', 'both' => $isRtl ? 'دخول/خروج' : 'Both', ]; $locationLabels = [ 'main' => $isRtl ? 'رئيسية' : 'Main', 'side' => $isRtl ? 'جانبية' : 'Side', 'emergency' => $isRtl ? 'طوارئ' : 'Emergency', 'vip' => $isRtl ? 'VIP' : 'VIP', ]; $genderLabels = [ 'none' => $isRtl ? 'بدون' : 'None', 'male' => $isRtl ? 'رجال' : 'Male', 'female' => $isRtl ? 'نساء' : 'Female', ]; @endphp @section('title', ($isRtl ? 'بوابة' : 'Gate') . ' - ' . $name) @section('content')

{{ $name }}

{{ $gate->is_active ? ($isRtl ? 'نشطة' : 'Active') : ($isRtl ? 'غير نشطة' : 'Inactive') }} {{ $gate->code }}

{{ $typeLabels[$gate->type] ?? $gate->type }} {{ $locationLabels[$gate->location] ?? $gate->location }} {{ $isRtl ? 'قيود:' : 'Restriction:' }} {{ $genderLabels[$gate->gender_restriction] ?? $gate->gender_restriction }}

{{ $isRtl ? 'دخول اليوم' : 'Entries Today' }}

{{ $stats['entries_today'] ?? 0 }}

{{ $isRtl ? 'خروج اليوم' : 'Exits Today' }}

{{ $stats['exits_today'] ?? 0 }}

{{ $isRtl ? 'مرفوض اليوم' : 'Denied Today' }}

{{ $stats['denied_today'] ?? 0 }}

{{ $isRtl ? 'إجمالي السجلات' : 'Total Logs' }}

{{ $stats['total_logs'] ?? 0 }}

{{ $isRtl ? 'تفاصيل البوابة' : 'Gate Details' }}

{{ $isRtl ? 'النوع' : 'Type' }} {{ $typeLabels[$gate->type] ?? $gate->type }}
{{ $isRtl ? 'الموقع' : 'Location' }} {{ $locationLabels[$gate->location] ?? $gate->location }}
{{ $isRtl ? 'قيود الجنس' : 'Gender restriction' }} {{ $genderLabels[$gate->gender_restriction] ?? $gate->gender_restriction }}
{{ $isRtl ? 'يتطلب اشتراك' : 'Requires subscription' }} {{ $gate->requires_active_subscription ? ($isRtl ? 'نعم' : 'Yes') : ($isRtl ? 'لا' : 'No') }}
{{ $isRtl ? 'الجهاز' : 'Device ID' }} {{ $gate->device_id ?: '—' }}
@if($gate->description)

{{ $isRtl ? 'الوصف' : 'Description' }}

{{ $gate->description }}

@endif

{{ $isRtl ? 'أحدث السجلات' : 'Recent Logs' }}

{{ $isRtl ? 'آخر 25 عملية' : 'Last 25 events' }}

{{ $isRtl ? 'عرض الكل' : 'View all' }}
@forelse($recentLogs as $log) @empty @endforelse
{{ $isRtl ? 'الوقت' : 'Time' }} {{ $isRtl ? 'العضو' : 'Member' }} {{ $isRtl ? 'النوع' : 'Type' }} {{ $isRtl ? 'الحالة' : 'Status' }}
{{ $log->access_time?->format('Y-m-d H:i') }}

{{ $log->member?->full_name ?? '—' }}

{{ $log->member?->member_id ?? '' }}

{{ $log->access_type === 'entry' ? ($isRtl ? 'دخول' : 'Entry') : ($isRtl ? 'خروج' : 'Exit') }} {{ $log->status === 'granted' ? ($isRtl ? 'مسموح' : 'Granted') : ($isRtl ? 'مرفوض' : 'Denied') }}
{{ $isRtl ? 'لا توجد سجلات' : 'No logs' }}
@endsection