68 lines
3.6 KiB
PHP
68 lines
3.6 KiB
PHP
<x-app-layout>
|
|
@section('title', 'Satuan Obat')
|
|
|
|
<div class="space-y-6">
|
|
<!-- Header -->
|
|
<div class="flex items-center justify-between">
|
|
<h1 class="text-2xl font-bold text-[#2F347A]">Satuan Obat</h1>
|
|
<x-btn type="primary" href="{{ route('satuan.create') }}">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
|
|
</svg>
|
|
Tambah Satuan
|
|
</x-btn>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<div class="bg-[#C9F7E3] border border-[#1F9254] text-[#1F9254] px-4 py-3 rounded-lg">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
<x-card class="overflow-hidden">
|
|
<div class="px-6 py-4 table-header-custom">
|
|
<h2 class="text-lg font-semibold">Daftar Satuan</h2>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full">
|
|
<thead class="bg-[#F4F6FF] border-b border-[#E5E7F2]">
|
|
<tr>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-[#7A7FAE] uppercase tracking-wider">No</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-[#7A7FAE] uppercase tracking-wider">Nama Satuan</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-[#7A7FAE] uppercase tracking-wider">Keterangan</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-[#7A7FAE] uppercase tracking-wider">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-[#E5E7F2]">
|
|
@forelse($satuans as $index => $satuan)
|
|
<tr class="hover:bg-[#F4F6FF]">
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-[#7A7FAE]">{{ $satuans->firstItem() + $index }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap font-medium text-[#2F347A]">{{ $satuan->nama }}</td>
|
|
<td class="px-6 py-4 text-sm text-[#7A7FAE]">{{ $satuan->keterangan ?? '-' }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
|
<div class="flex gap-2">
|
|
<a href="{{ route('satuan.edit', $satuan) }}" class="text-[#4A538F] hover:text-[#2F347A]">Edit</a>
|
|
<form method="POST" action="{{ route('satuan.destroy', $satuan) }}"
|
|
onsubmit="return confirm('Yakin ingin menghapus?')">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-[#C0392B] hover:text-[#a93226]">Hapus</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="4" class="px-6 py-12 text-center text-[#7A7FAE]">Belum ada data satuan</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="px-6 py-4 border-t border-[#E5E7F2]">
|
|
{{ $satuans->links() }}
|
|
</div>
|
|
</x-card>
|
|
</div>
|
|
</x-app-layout>
|