@include('admin.partials.header') @include('admin.partials.sidebar') @include('admin.partials.topbar') @php $typeMeta = [ 'job' => ['label' => 'Jobs', 'icon' => 'work'], 'rent' => ['label' => 'Rentals', 'icon' => 'apartment'], 'hostel' => ['label' => 'Hostels', 'icon' => 'bed'], 'service' => ['label' => 'Services', 'icon' => 'construction'], ]; $activeTypes = $activeTypes ?? []; $tab = $tab ?? 'pending'; $rejectedCounts = $rejectedCounts ?? []; $rejectedListings = $rejectedListings ?? collect(); $totalPending = array_sum($counts ?? []); $totalRejected = array_sum($rejectedCounts); $filterCounts = $tab === 'rejected' ? $rejectedCounts : ($counts ?? []); $filterTotal = $tab === 'rejected' ? $totalRejected : $totalPending; $activeListings = $tab === 'rejected' ? $rejectedListings : $listings; $activeStatusClass = $tab === 'rejected' ? 'status-rejected-badge' : 'status-pending-badge'; $activeStatusLabel = $tab === 'rejected' ? 'REJECTED' : 'PENDING'; $activeTitle = $tab === 'rejected' ? 'Rejected Listings' : 'Pending Approval'; $activeDescription = $tab === 'rejected' ? 'Showing '.$activeListings->total().' rejected '.Str::plural('submission', $activeListings->total()).'.' : 'Reviewing '.$activeListings->total().' pending '.Str::plural('submission', $activeListings->total()).'.'; $sort = $sort ?? 'newest'; @endphp

{{ $activeTitle }}

{{ $activeDescription }}

@if ($search !== '') @endif

Categories

@if (! empty($activeTypes)) Clear @endif
@foreach ($typeMeta as $type => $meta) @endforeach
@foreach ($activeTypes as $type) @endforeach
search
@if ($search !== '') Reset @endif
@if ($search !== '') @endif @foreach ($activeTypes as $type) @endforeach sort
@if ($tab === 'pending')
@csrf
@endif
@if ($activeListings->isEmpty())
{{ $tab === 'rejected' ? 'block' : 'task_alt' }}

No {{ $tab }} listings

Everything in this filter is clear.

@else
@foreach ($activeListings as $listing) @php $meta = $typeMeta[$listing->listing_type] ?? ['label' => ucfirst($listing->listing_type), 'icon' => 'inventory_2']; $providerName = $listing->provider_business_name ?: ($listing->provider_name ?: ($listing->provider_mobile ?: 'Unknown provider')); $location = collect([$listing->location, $listing->city, $listing->state])->filter()->implode(', '); @endphp
@if ($tab === 'pending') @endif @if ($listing->image_url) {{ $listing->title }} @else
{{ $meta['icon'] }}
@endif
{{ $meta['icon'] }} {{ strtoupper($meta['label']) }}
{{ \Illuminate\Support\Carbon::parse($listing->created_at)->diffForHumans() }}

{{ $listing->title }}

{{ $activeStatusLabel }}
storefront{{ $providerName }}
@if ($location)
location_on{{ Str::limit($location, 72) }}
@endif
@if ($tab === 'pending')
@csrf
@csrf
@else
@csrf
@endif visibility
@endforeach
{{ $activeListings->links('pagination::bootstrap-5') }}
@endif
@include('admin.partials.footer')