103 lines
4.7 KiB
PHP
103 lines
4.7 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="id">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Dashboard Super Admin</title>
|
|
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
|
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
|
|
</head>
|
|
|
|
<body class="bg-gray-100 font-sans">
|
|
|
|
<!-- TOP BAR -->
|
|
<div class="bg-white shadow-md py-4 px-6 flex justify-between items-center">
|
|
<div>
|
|
<h1 class="text-xl font-semibold text-[#1e3a8a]">Dashboard Super Admin</h1>
|
|
<p class="text-sm text-[#1e3a8a]">
|
|
Tanggal hari ini: {{ now()->translatedFormat('l, d F Y') }}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Dropdown -->
|
|
<div x-data="{ open: false }" class="relative">
|
|
<button @click="open = !open" class="flex items-center space-x-2 text-gray-600 focus:outline-none">
|
|
<svg class="w-6 h-6 text-gray-500" fill="currentColor" viewBox="0 0 24 24">
|
|
<path
|
|
d="M12 12c2.7 0 4.5-2 4.5-4.5S14.7 3 12 3 7.5 5 7.5 7.5 9.3 12 12 12zM12 14c-3.3 0-6 2.7-6 6h12c0-3.3-2.7-6-6-6z" />
|
|
</svg>
|
|
<span class="font-medium">{{ Auth::user()->name }}</span>
|
|
</button>
|
|
|
|
<!-- Menu -->
|
|
<div x-show="open" @click.outside="open = false"
|
|
x-transition
|
|
class="absolute right-0 mt-2 w-44 bg-white border rounded-md shadow z-50">
|
|
{{-- <a href="{{ route('profile.edit') }}"
|
|
class="block px-4 py-2 hover:bg-gray-100 text-sm text-gray-700">Profil</a> --}}
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<button type="submit"
|
|
class="w-full text-left px-4 py-2 hover:bg-gray-100 text-sm text-gray-700">Logout</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- MAIN CONTENT -->
|
|
<div class="max-w-6xl mx-auto p-6 mt-6 bg-white shadow-md rounded-lg">
|
|
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h2 class="text-base font-semibold text-[#1e3a8a]">Daftar User Admin</h2>
|
|
<a href="{{ route('admin-user.create') }}"
|
|
class="bg-blue-900 text-white px-4 py-2 text-sm rounded border border-blue-900 hover:bg-white hover:text-blue-900 transition">
|
|
+ Tambah Admin
|
|
</a>
|
|
</div>
|
|
|
|
<table class="w-full table-auto border-collapse text-sm text-gray-700">
|
|
<thead>
|
|
<tr class="bg-gray-50">
|
|
<th class="border-b border-gray-200 px-4 py-2 text-left font-medium text-gray-600">#</th>
|
|
<th class="border-b border-gray-200 px-4 py-2 text-left font-medium text-gray-600">Nama</th>
|
|
<th class="border-b border-gray-200 px-4 py-2 text-left font-medium text-gray-600">Email</th>
|
|
<th class="border-b border-gray-200 px-4 py-2 text-left font-medium text-gray-600">Dibuat Pada</th>
|
|
<th class="border-b border-gray-200 px-4 py-2 text-left font-medium text-gray-600">Aksi</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse ($admins as $admin)
|
|
<tr class="hover:bg-gray-50 transition-colors duration-150">
|
|
<td class="border-b border-gray-100 px-4 py-3">{{ $loop->iteration }}</td>
|
|
<td class="border-b border-gray-100 px-4 py-3">{{ $admin->name }}</td>
|
|
<td class="border-b border-gray-100 px-4 py-3">{{ $admin->email }}</td>
|
|
<td class="border-b border-gray-100 px-4 py-3">{{ $admin->created_at->format('d-m-Y') }}</td>
|
|
<td class="border-b border-gray-100 px-4 py-3 flex gap-2">
|
|
<a href="{{ route('admin-user.edit', $admin->id) }}"
|
|
class="text-blue-600 hover:text-blue-900 text-xs font-medium">Edit</a>
|
|
|
|
<form action="{{ route('admin-user.destroy', $admin->id) }}" method="POST"
|
|
onsubmit="return confirm('Yakin ingin menghapus admin ini?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-red-600 hover:text-red-900 text-xs font-medium">
|
|
Hapus
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5" class="text-center py-6 text-gray-400 italic">Belum ada user admin.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html> |