@extends('layouts.main_dashboard.app') @section('title', app()->getLocale() === 'ar' ? 'إدارة المكافآت' : 'Rewards Management') @section('page_heading', app()->getLocale() === 'ar' ? 'إدارة المكافآت' : 'Rewards Management') @section('skip_page_hero', true) @php $isArabic = app()->getLocale() === 'ar'; $statusLabels = [ 'pending' => $isArabic ? 'قيد المراجعة' : 'Pending', 'approved' => $isArabic ? 'معتمد' : 'Approved', 'rejected' => $isArabic ? 'مرفوض' : 'Rejected', 'fulfilled' => $isArabic ? 'تم التسليم' : 'Fulfilled', ]; @endphp @section('content')

{{ $isArabic ? 'إدارة المكافآت وطلبات الاستبدال' : 'Manage Rewards and Redemptions' }}

{{ $isArabic ? 'صفحة عرض مستقلة للمكافآت مع إضافة المكافأة من popup ومتابعة الطلبات في جدول مستقل.' : 'A dedicated rewards listing page with popup creation and a separate redemption management section.' }}

{{ $isArabic ? 'إجمالي المكافآت' : 'Total Rewards' }}

{{ $rewards->count() }}

{{ $isArabic ? 'قائمة المكافآت' : 'Rewards List' }}

@if($rewards->isEmpty())
{{ $isArabic ? 'لا توجد مكافآت مضافة حتى الآن.' : 'No rewards have been created yet.' }}
@else
@foreach($rewards as $reward) @endforeach
{{ $isArabic ? 'اسم المكافأة' : 'Reward Name' }} {{ $isArabic ? 'تكلفة النقاط' : 'Points Cost' }} {{ $isArabic ? 'الكمية' : 'Quantity' }} {{ $isArabic ? 'الحالة' : 'Status' }} {{ __('dashboard.Actions') }}

{{ $reward->name }}

{{ $reward->description ?: ($isArabic ? 'بدون وصف إضافي.' : 'No extra description.') }}

{{ $reward->points_cost }} {{ $reward->quantity ?? ($isArabic ? 'غير محدود' : 'Unlimited') }} {{ $reward->is_active ? ($isArabic ? 'نشط' : 'Active') : ($isArabic ? 'غير نشط' : 'Inactive') }}
@csrf @method('DELETE')
@csrf @method('PUT')

{{ $isArabic ? 'تعديل المكافأة' : 'Edit Reward' }}

{{ $reward->name }}

@endif

{{ $isArabic ? 'طلبات الاستبدال' : 'Redemption Requests' }}

@forelse($redemptions as $redemption)
@csrf @method('PUT')

{{ $redemption->user?->name }}

{{ $redemption->reward?->name }} · {{ $redemption->points_cost }} {{ $isArabic ? 'نقطة' : 'pts' }}

{{ $statusLabels[$redemption->status] ?? $redemption->status }}
@empty
{{ $isArabic ? 'لا توجد طلبات استبدال حديثة.' : 'No recent redemption requests.' }}
@endforelse
@csrf

{{ $isArabic ? 'إضافة مكافأة جديدة' : 'Add New Reward' }}

{{ $isArabic ? 'أدخل بيانات المكافأة ثم احفظها لتظهر في قائمة العرض.' : 'Enter the reward details and save it to appear in the listing.' }}

@endsection