97 lines
5.0 KiB
PHP
97 lines
5.0 KiB
PHP
@extends('layouts.admin')
|
|
|
|
@section('title', 'Pesanan Dibatalkan - INUFA')
|
|
|
|
@section('header', 'Pesanan Dibatalkan')
|
|
|
|
@section('content')
|
|
<div class="bg-white rounded-lg shadow-md p-6">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-xl font-semibold text-gray-800">Daftar Pesanan Dibatalkan</h2>
|
|
<a href="{{ route('admin.dashboard') }}" class="bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded-md text-sm">
|
|
Kembali ke Dashboard
|
|
</a>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<div class="bg-green-100 border-l-4 border-green-500 text-green-700 p-4 mb-4 rounded">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
@if(session('error'))
|
|
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4 rounded">
|
|
{{ session('error') }}
|
|
</div>
|
|
@endif
|
|
|
|
@if($cancelledOrders->count() > 0)
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full bg-white">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="py-3 px-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID Pesanan</th>
|
|
<th class="py-3 px-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customer</th>
|
|
<th class="py-3 px-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Paket</th>
|
|
<th class="py-3 px-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Harga</th>
|
|
<th class="py-3 px-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tanggal Dibatalkan</th>
|
|
<th class="py-3 px-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Alasan</th>
|
|
<th class="py-3 px-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
|
@foreach($cancelledOrders as $order)
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="py-4 px-4 whitespace-nowrap text-sm font-medium text-gray-900">
|
|
#{{ $order->id }}
|
|
</td>
|
|
<td class="py-4 px-4 whitespace-nowrap text-sm text-gray-900">
|
|
{{ $order->user->name ?? 'N/A' }}
|
|
<br>
|
|
<span class="text-xs text-gray-500">{{ $order->user->email ?? 'N/A' }}</span>
|
|
</td>
|
|
<td class="py-4 px-4 whitespace-nowrap text-sm text-gray-900">
|
|
{{ $order->paket->nama ?? 'N/A' }}
|
|
</td>
|
|
<td class="py-4 px-4 whitespace-nowrap text-sm text-gray-900">
|
|
Rp {{ number_format($order->total_harga, 0, ',', '.') }}
|
|
</td>
|
|
<td class="py-4 px-4 whitespace-nowrap text-sm text-gray-900">
|
|
{{ $order->updated_at->format('d/m/Y H:i') }}
|
|
<br>
|
|
<span class="text-xs text-gray-500">{{ $order->updated_at->diffForHumans() }}</span>
|
|
</td>
|
|
<td class="py-4 px-4 text-sm text-gray-900">
|
|
@if($order->detail_status)
|
|
<span class="text-red-600 font-medium">Ada alasan</span>
|
|
@else
|
|
<span class="text-gray-500">Tidak ada alasan</span>
|
|
@endif
|
|
</td>
|
|
<td class="py-4 px-4 whitespace-nowrap text-sm font-medium">
|
|
<a href="{{ route('admin.cancelled-orders.show', $order->id) }}"
|
|
class="text-blue-600 hover:text-blue-900 bg-blue-100 hover:bg-blue-200 px-3 py-1 rounded-md text-xs">
|
|
Lihat Detail
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<div class="mt-6">
|
|
{{ $cancelledOrders->links() }}
|
|
</div>
|
|
@else
|
|
<div class="text-center py-12">
|
|
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
</svg>
|
|
<h3 class="mt-2 text-sm font-medium text-gray-900">Tidak ada pesanan yang dibatalkan</h3>
|
|
<p class="mt-1 text-sm text-gray-500">Belum ada customer yang membatalkan pesanan mereka.</p>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|