@extends('layouts.admin') @section('title', 'Kelola Pesanan') @section('page-title', 'Kelola Pesanan') @section('admin_content')
@forelse($orders as $order) @empty @endforelse
No. Pesanan Pelanggan Total Status Pembayaran Tanggal Aksi
{{ $order->order_number }} {{ $order->customer_name }} Rp {{ number_format($order->total, 0, ',', '.') }} @php $statusClass = match($order->status) { 'pending' => 'admin-badge-pending', 'processing' => 'admin-badge-processing', 'completed' => 'admin-badge-completed', 'cancelled' => 'admin-badge-cancelled', default => 'admin-badge-pending' }; @endphp {{ ucfirst($order->status) }} {{ $order->payment_status === 'paid' ? 'Dibayar' : 'Pending' }} {{ $order->created_at->format('d M Y H:i') }}
@csrf @method('DELETE')
Belum ada pesanan.
{{ $orders->links() }}
@endsection @section('scripts') function confirmDelete(form) { event.preventDefault(); Swal.fire({ title: 'Hapus Pesanan?', text: 'Item pesanan akan dihapus terlebih dahulu.', icon: 'warning', showCancelButton: true, confirmButtonColor: '#dc2626', cancelButtonColor: '#6b7280', confirmButtonText: 'Ya, Hapus', cancelButtonText: 'Batal' }).then((result) => { if (result.isConfirmed) form.submit(); }); return false; } @endsection