@extends('layouts.admin') @section('title', 'Gestion des Articles') @push('styles') @endpush @section('content')

Gestion des Articles

Tous En attente {{ \App\Models\Annonce::where('statut', 'en_attente')->count() }} Publiées Rejetées
@if($search || $status) Effacer @endif
@forelse($annonces as $annonce) @empty @endforelse
Article Vendeur Prix Statut Actions
@if($annonce->photoPrincipale()) @else @endif
{{ $annonce->titre }}
Réf: #{{ $annonce->id }}
{{ $annonce->vendeur->user->prenom }} {{ $annonce->vendeur->user->nom }}
{{ ucfirst($annonce->vendeur->type) }}
{{ number_format($annonce->prix, 0, ',', ' ') }} FCFA
@php $statusLabel = 'Inconnu'; $statusColor = '#555'; $statusBg = 'transparent'; switch($annonce->statut) { case 'publiee': $statusLabel = 'Publiée'; $statusColor = '#569b00'; $statusBg = '#f7fff0'; break; case 'en_attente': $statusLabel = 'En attente'; $statusColor = '#f68b1e'; $statusBg = '#fff8f3'; break; case 'rejetee': $statusLabel = 'Rejetée'; $statusColor = '#c40000'; $statusBg = '#fff5f5'; break; default: $statusLabel = ucfirst($annonce->statut); $statusBg = '#f6f6f6'; } @endphp {{ $statusLabel }}
@if($annonce->statut === 'en_attente')
@csrf
| @elseif($annonce->statut === 'publiee') Voir | @endif @if($annonce->statut !== 'rejetee')
@csrf
@endif

Aucun article trouvé pour les critères sélectionnés.

@if($annonces->total() > 0)
Affichage de {{ $annonces->firstItem() ?? 0 }} à {{ $annonces->lastItem() ?? 0 }} sur {{ $annonces->total() }} résultats
@if ($annonces->onFirstPage()) Précédent @else Précédent @endif @php $startPage = max(1, $annonces->currentPage() - 2); $endPage = min($annonces->lastPage(), $startPage + 4); @endphp @for ($i = $startPage; $i <= $endPage; $i++) @if ($i == $annonces->currentPage()) {{ $i }} @else {{ $i }} @endif @endfor @if ($annonces->hasMorePages()) Suivant @else Suivant @endif
@endif
@push('scripts') @endpush @endsection