MIF_E31222629/resources/views/super-admin/form.blade.php

84 lines
3.9 KiB
PHP

<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ isset($admin) ? 'Edit Admin' : 'Tambah Admin' }}</title>
<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">
<div class="max-w-4xl mx-auto p-6 mt-10 bg-white shadow rounded">
<h1 class="text-lg font-semibold mb-4 text-[#1e3a8a]">
{{ isset($admin) ? 'Edit' : 'Tambah' }} Admin
</h1>
<form action="{{ isset($admin) ? route('admin-user.update', $admin->id) : route('admin-user.store') }}" method="POST" class="space-y-4">
@csrf
@if(isset($admin))
@method('PUT')
@endif
<!-- Nama -->
<div>
<label for="name" class="block mb-1 text-sm text-gray-600">Nama</label>
<input type="text" name="name" id="name" required
value="{{ old('name', $admin->name ?? '') }}"
class="w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
@error('name')
<p class="text-red-600 text-xs mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Email -->
<div>
<label for="email" class="block mb-1 text-sm text-gray-600">Email</label>
<input type="email" name="email" id="email" required
value="{{ old('email', $admin->email ?? '') }}"
class="w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
@error('email')
<p class="text-red-600 text-xs mt-1">{{ $message }}</p>
@enderror
</div>
<!-- Password -->
<div>
<label for="password" class="block mb-1 text-sm text-gray-600">Password</label>
<input type="password" name="password" id="password"
class="w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
</div>
<!-- Konfirmasi Password -->
<div>
<label for="password_confirmation" class="block mb-1 text-sm text-gray-600">Konfirmasi Password</label>
<input type="password" name="password_confirmation" id="password_confirmation"
class="w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500">
</div>
<!-- Tombol -->
<div class="flex justify-end gap-4 mt-4">
<a href="{{ route('admin-user.index') }}" class="text-gray-500 hover:text-blue-500 text-sm flex items-center gap-1">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
Batal
</a>
<button type="submit" class="flex items-center gap-2 text-[#1e3a8a] hover:text-blue-800 transition font-medium">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round"
d="{{ isset($admin) ? 'M11 5H6a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2v-5m-10-7l8 8m-3 0h3v3' : 'M12 4v16m8-8H4' }}" />
</svg>
<span>{{ isset($admin) ? 'Update' : 'Simpan' }}</span>
</button>
</div>
</form>
</div>
</body>
</html>