@extends('layouts.admin-modern') @section('page-title', 'Gestion des Commandes') @section('content')

Gestion des Commandes

Gérez toutes les commandes et transactions de votre plateforme

Total Commandes
{{ $pagination['total'] ?? 0 }}
+8% ce mois
Confirmées
{{ $stats['confirmed_orders'] ?? 0 }}
+12% ce mois
En Attente
{{ $stats['pending_orders'] ?? 0 }}
Stable
Chiffre d'Affaires
***
+15% ce mois
Évolution du Chiffre d'Affaires
Liste des Commandes
@forelse($orders ?? [] as $order) @empty @endforelse
Commande Client Prestataire Service Montant Statut Date Actions
#{{ $order['type'] === 'service' ? 'SRV' : 'EQP' }}-{{ str_pad($order['id'], 6, '0', STR_PAD_LEFT) }}
{{ $order['type'] === 'service' ? 'Réservation de service' : 'Location d\'équipement' }}
{{ strtoupper(substr($order['client_name'] ?? 'U', 0, 1)) }}
{{ $order['client_name'] ?? 'Client inconnu' }}
Client
{{ strtoupper(substr($order['prestataire_name'] ?? 'P', 0, 1)) }}
{{ $order['prestataire_name'] ?? 'Prestataire inconnu' }}
Prestataire
{{ $order['service_name'] ?? 'N/A' }}
{{ $order['type'] === 'service' ? 'Service' : 'Équipement' }}
{{ number_format($order['amount'] ?? 0, 2, ',', ' ') }}€
@php $statusConfig = [ 'pending' => ['color' => 'var(--warning)', 'bg' => 'rgba(245, 158, 11, 0.1)', 'icon' => 'fas fa-clock', 'text' => 'En attente'], 'confirmed' => ['color' => 'var(--info)', 'bg' => 'rgba(59, 130, 246, 0.1)', 'icon' => 'fas fa-check', 'text' => 'Confirmée'], 'in_progress' => ['color' => 'var(--primary)', 'bg' => 'rgba(99, 102, 241, 0.1)', 'icon' => 'fas fa-play', 'text' => 'En cours'], 'completed' => ['color' => 'var(--success)', 'bg' => 'rgba(16, 185, 129, 0.1)', 'icon' => 'fas fa-check-circle', 'text' => 'Terminée'], 'cancelled' => ['color' => 'var(--danger)', 'bg' => 'rgba(239, 68, 68, 0.1)', 'icon' => 'fas fa-times-circle', 'text' => 'Annulée'], 'accepted' => ['color' => 'var(--info)', 'bg' => 'rgba(59, 130, 246, 0.1)', 'icon' => 'fas fa-check', 'text' => 'Acceptée'], 'active' => ['color' => 'var(--primary)', 'bg' => 'rgba(99, 102, 241, 0.1)', 'icon' => 'fas fa-play', 'text' => 'Active'] ]; $status = $statusConfig[$order['status'] ?? 'pending'] ?? $statusConfig['pending']; @endphp {{ $status['text'] }}
{{ \Carbon\Carbon::parse($order['created_at'])->format('d/m/Y') }}
{{ \Carbon\Carbon::parse($order['created_at'])->format('H:i') }}
@if($order['status'] === 'pending') @endif @if(in_array($order['status'], ['pending', 'confirmed'])) @endif
Aucune commande trouvée
Les commandes apparaîtront ici une fois créées
@if($orders && $orders->hasPages())
Affichage de {{ $orders->firstItem() }} à {{ $orders->lastItem() }} sur {{ $orders->total() }} résultats
{{ $orders->links() }}
@endif
@endsection @push('scripts') @endpush