@include('partials.header') @foreach ($ongoingAuctions as $index => $auction) @endforeach @foreach ($ongoingAuctions as $index => $auction) @php $coverWebP = "https://athman.qiam.sa/auction_cover/{$auction->id}.png"; $coverPath = "https://athman.qiam.sa/auction_cover/{$auction->id}.png"; $defaultCover = 'https://athman.qiam.sa/auction_cover/404.png'; $endDate = \Carbon\Carbon::parse($auction->end_date); @endphp {{ $auction->name }} ينتهي في: {{ $endDate->format('Y-m-d') }} المتبقي: {{ $endDate->diffForHumans() }} @endforeach السابق التالي أضف عقارك العقارات المنقولات الحيوية حيواني ونباتي قائمة المزادات عرض الخريطة بحث @if (request('region_id')) @endif @if (request('property_type_id')) @endif @if (request('excution_company')) @endif @forelse ($propertyes as $property) @php // Group properties by auction_id to avoid duplicates $uniqueAuctions = $propertyes->groupBy('auction_id'); @endphp @forelse ($uniqueAuctions as $auctionId => $properties) @php $firstProperty = $properties->first(); $auction = $firstProperty->auction ?? null; $auctionTypeName = $auction->auction_type_id->name ?? 'غير محدد'; $regionName = $firstProperty->region->name ?? 'غير محدد'; $companyName = $auction->excution_company->name ?? 'جهة غير معروفة'; $propertyCount = $properties->count(); $startDate = $auction->start_date ?? null; $endDate = $auction->end_date ?? null; // Determine auction status $currentDate = now()->format('Y-m-d'); $status = 'مزاد'; // Default $ribbonClass = 'ribbon-default'; // Default if ($endDate && $currentDate > $endDate) { $status = 'مزاد منتهي'; $ribbonClass = 'ribbon-danger'; } elseif ($startDate && $currentDate >= $startDate) { $status = 'مزاد جاري'; $ribbonClass = 'green'; } elseif ($startDate && $currentDate < $startDate) { $status='مزاد قادم' ; $ribbonClass='blue1' ; } // Format dates if they exist $formattedStartDate=$startDate ? \Carbon\Carbon::parse($startDate)->format('Y-m-d') : 'غير معروف'; $formattedEndDate = $endDate ? \Carbon\Carbon::parse($endDate)->format('Y-m-d') : 'غير معروف'; @endphp {{ $status }} {{ $auction->name ?? 'ضياع مكة' }} منتجات {{ $propertyCount }} المدينة: {{ $regionName }} بداية المزاد: {{ $formattedStartDate }} نهاية المزاد: {{ $formattedEndDate }} @empty لا توجد بيانات @endforelse @empty لا توجد نتائج مطابقة للبحث @endforelse {{ $propertyes->links('pagination::bootstrap-4') }} @section('scripts') @endsection @include('partials.footer')
حيواني ونباتي