113 lines
6.1 KiB
PHP
113 lines
6.1 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Halaman Dasbor')
|
|
|
|
@section('content')
|
|
<div class="container mx-auto py-4">
|
|
<!-- Header -->
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h3 class="text-xl font-bold">Halaman Dasbor</h3>
|
|
<div class="flex items-center gap-3">
|
|
<div class="bg-blue-100 text-blue-600 px-3 py-2 rounded-lg flex items-center gap-2 text-sm">
|
|
<i class="bi bi-clock-history"></i>
|
|
{{ \Carbon\Carbon::now()->translatedFormat('d M Y') }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Cards -->
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
|
|
<div
|
|
class="bg-white rounded-lg shadow-md p-4 flex justify-between items-center hover:shadow-lg transition-transform duration-300 transform hover:-translate-y-2">
|
|
<div>
|
|
<h5 class="text-gray-500 text-sm">Kategori</h5>
|
|
<h3 class="font-bold text-xl">{{ $totalKategori }}</h3>
|
|
</div>
|
|
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-lg flex items-center justify-center text-xl">
|
|
<i class="bi bi-diagram-3"></i>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
class="bg-white rounded-lg shadow-md p-4 flex justify-between items-center hover:shadow-lg transition-transform duration-300 transform hover:-translate-y-2">
|
|
<div>
|
|
<h5 class="text-gray-500 text-sm">Template</h5>
|
|
<h3 class="font-bold text-xl">{{ $totalTemplate }}</h3>
|
|
</div>
|
|
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-lg flex items-center justify-center text-xl">
|
|
<i class="bi bi-card-list"></i>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
class="bg-white rounded-lg shadow-md p-4 flex justify-between items-center hover:shadow-lg transition-transform duration-300 transform hover:-translate-y-2">
|
|
<div>
|
|
<h5 class="text-gray-500 text-sm">Pelanggan</h5>
|
|
<h3 class="font-bold text-xl">{{ $totalPelanggan }}</h3>
|
|
</div>
|
|
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-lg flex items-center justify-center text-xl">
|
|
<i class="bi bi-person"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Recent Pelanggan -->
|
|
<div class="bg-white rounded-lg shadow mt-6 overflow-x-auto">
|
|
<div class="p-4">
|
|
<h4 class="text-lg font-bold mb-3">Pelanggan Terbaru</h4>
|
|
<table class="w-full border border-gray-200 text-left border-collapse">
|
|
<thead class="bg-gray-100">
|
|
<tr>
|
|
<th class="px-3 py-2 border border-gray-200 w-[50px] text-center">No.</th>
|
|
<th class="px-3 py-2 border border-gray-200 text-center">Nama</th>
|
|
<th class="px-3 py-2 border border-gray-200 text-center">Template</th>
|
|
<th class="px-3 py-2 border border-gray-200 text-center">Kategori</th>
|
|
<th class="px-3 py-2 border border-gray-200 text-center">Email</th>
|
|
<th class="px-3 py-2 border border-gray-200 text-center">No. Telepon</th>
|
|
<th class="px-3 py-2 border border-gray-200 text-center">Harga</th>
|
|
<th class="px-3 py-2 border border-gray-200 text-center">Tanggal Pemesanan</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse ($pelangganTerbaru as $index => $p)
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-3 py-2 border border-gray-200 text-center">{{ $index + 1 }}</td>
|
|
<td class="px-3 py-2 border border-gray-200 text-center">{{ $p->nama_pemesan }}</td>
|
|
<td class="px-3 py-2 border border-gray-200 text-center">
|
|
{{ $p->template->nama_template ?? '-' }}
|
|
</td>
|
|
<td class="px-3 py-2 border border-gray-200 text-center">
|
|
{{ $p->template->kategori->nama ?? '-' }}
|
|
</td>
|
|
<td class="px-3 py-2 border border-gray-200 text-center">{{ $p->email }}</td>
|
|
<td class="px-3 py-2 border border-gray-200 text-center">{{ $p->no_tlpn }}</td>
|
|
<td class="px-3 py-2 border border-gray-200 text-center">
|
|
Rp {{ number_format($p->harga, 0, ',', '.') }}
|
|
</td>
|
|
<td class="px-3 py-2 border border-gray-200 text-center">
|
|
{{ $p->created_at->translatedFormat('d M Y') }}
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="8" class="px-3 py-4 text-center text-gray-500 border border-gray-200">
|
|
Belum ada data pelanggan.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
|
|
<!-- Pagination Placeholder -->
|
|
<div class="p-4 flex justify-center">
|
|
<div class="flex space-x-1">
|
|
<span class="px-3 py-1 rounded-lg bg-gray-200 text-gray-500 cursor-not-allowed">Prev</span>
|
|
<span class="px-3 py-1 rounded-lg bg-blue-600 text-white font-semibold">1</span>
|
|
<span class="px-3 py-1 rounded-lg bg-gray-200 text-gray-500 cursor-not-allowed">Next</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|