Reservasi-Cafe/resources/views/transaksi/index.blade.php

89 lines
4.2 KiB
PHP

@extends('layouts.user.app')
{{-- @include('layouts.user.header') --}}
@section('content')
<div class="container mx-auto px-4 py-8">
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold text-[#8B0000]">Daftar Transaksi</h1>
</div>
@if(session('success'))
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-6" role="alert">
<span class="block sm:inline">{{ session('success') }}</span>
</div>
@endif
@if(session('error'))
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-6" role="alert">
<span class="block sm:inline">{{ session('error') }}</span>
</div>
@endif
<div class="bg-white rounded-lg shadow-md overflow-hidden">
@if($transaksi->isEmpty())
<div class="p-6 text-center text-gray-500">
<p>Belum ada transaksi</p>
</div>
@else
<div class="overflow-x-auto">
<table class="w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Kode Transaksi
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Tanggal
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Total
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Status
</th>
<th class="px-6 py-3 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($transaksi as $t)
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm font-medium text-gray-900">
{{ $t->transaction_code }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">
{{ $t->created_at->format('d M Y H:i') }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">
Rp {{ number_format($t->final_amount, 0, ',', '.') }}
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full
{{ $t->status === 'paid' ? 'bg-green-100 text-green-800' :
($t->status === 'pending' ? 'bg-yellow-100 text-yellow-800' :
'bg-red-100 text-red-800') }}">
{{ ucfirst($t->status) }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="/transaksi/{{ $t->id }}/detail"
class="text-[#8B0000] hover:text-[#660000]">
Detail
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</div>
@endsection