@extends('admin.layouts.app') @php use Illuminate\Support\Facades\Storage; @endphp @section('title', 'إدارة العروض') @section('content')
@if($offers->count() > 0)
@foreach($offers as $offer) @endforeach
# الصورة العنوان نوع العرض الخصم تاريخ البداية تاريخ النهاية الحالة الإجراءات
{{ $offer->id }} @if($offer->image) {{ $offer->title }} @else
@endif
{{ $offer->title_ar ?? $offer->title }} @if($offer->offer_type == 'food') طعام @elseif($offer->offer_type == 'gas') غاز @elseif($offer->offer_type == 'taxi') تاكسي @else عام @endif @if($offer->discount_percentage) {{ $offer->discount_percentage }}% @elseif($offer->discount_amount) {{ number_format($offer->discount_amount, 0) }} دينار @else لا يوجد @endif {{ $offer->start_date->format('Y-m-d') }} {{ $offer->end_date->format('Y-m-d') }} @php $isActive = $offer->is_active; $startDateOnly = $offer->start_date->format('Y-m-d'); $endDateOnly = $offer->end_date->format('Y-m-d'); $nowDateOnly = now()->format('Y-m-d'); $startDateOk = $startDateOnly <= $nowDateOnly; $endDateOk = $endDateOnly >= $nowDateOnly; $isCurrentlyActive = $isActive && $startDateOk && $endDateOk; @endphp @if($isCurrentlyActive) نشط @elseif(!$isActive) معطل @elseif($startDateOnly > $nowDateOnly) قادم @else منتهي @endif
@csrf @method('DELETE')
{{ $offers->links() }}
@else

لا توجد عروض حالياً

إضافة عرض جديد
@endif
@endsection