67 lines
4.1 KiB
PHP
67 lines
4.1 KiB
PHP
@extends('admin.layouts.app')
|
|
|
|
@section('title', 'Edit Guru BK')
|
|
|
|
@section('content')
|
|
<div class="flex justify-between items-center mb-6">
|
|
<div>
|
|
<h2 class="text-2xl font-bold text-maroon">✏️ Edit Akun Guru BK</h2>
|
|
<p class="text-sm text-gray-500 mt-1">{{ $guruBK->name }}</p>
|
|
</div>
|
|
<a href="{{ route('admin.guru-bk') }}" class="bg-gray-400 text-white font-bold py-2 px-4 rounded-lg hover:bg-gray-500 transition text-sm">
|
|
← Kembali
|
|
</a>
|
|
</div>
|
|
|
|
<div class="bg-white rounded-lg shadow p-6 max-w-2xl">
|
|
<form action="{{ route('admin.guru-bk.update', $guruBK->id) }}" method="POST" class="space-y-4">
|
|
@csrf
|
|
@method('PUT')
|
|
<div>
|
|
<label class="block text-sm font-semibold text-gray-700 mb-2">Nama Lengkap *</label>
|
|
<input type="text" name="name" required value="{{ old('name', $guruBK->name) }}" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-maroon">
|
|
@error('name') <span class="text-red-500 text-xs">{{ $message }}</span> @enderror
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-semibold text-gray-700 mb-2">Email *</label>
|
|
<input type="email" name="email" required value="{{ old('email', $guruBK->email) }}" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-maroon">
|
|
@error('email') <span class="text-red-500 text-xs">{{ $message }}</span> @enderror
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-semibold text-gray-700 mb-2">Password Baru <span class="text-gray-400 font-normal">(kosongkan jika tidak diubah)</span></label>
|
|
<div style="position: relative; display: flex; align-items: center;">
|
|
<input type="password" id="editGuruPassword" name="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-400" placeholder="Minimal 8 karakter" style="padding-right: 45px;">
|
|
<button type="button" style="position: absolute; right: 12px; background: none; border: none; cursor: pointer; color: #5B7B89; font-size: 18px;" onclick="togglePasswordVisibility('editGuruPassword', this)">👁️</button>
|
|
</div>
|
|
@error('password') <span class="text-red-500 text-xs">{{ $message }}</span> @enderror
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-semibold text-gray-700 mb-2">Konfirmasi Password Baru</label>
|
|
<div style="position: relative; display: flex; align-items: center;">
|
|
<input type="password" id="editGuruPasswordConfirm" name="password_confirmation" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-400" placeholder="Ulangi password baru" style="padding-right: 45px;">
|
|
<button type="button" style="position: absolute; right: 12px; background: none; border: none; cursor: pointer; color: #5B7B89; font-size: 18px;" onclick="togglePasswordVisibility('editGuruPasswordConfirm', this)">👁️</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex gap-4 pt-4">
|
|
<button type="submit" class="flex-1 gradient-maroon text-white font-bold py-3 px-4 rounded-lg hover:opacity-90 transition">
|
|
💾 Update
|
|
</button>
|
|
<a href="{{ route('admin.guru-bk') }}" class="flex-1 bg-gray-400 text-white font-bold py-3 px-4 rounded-lg hover:bg-gray-500 transition text-center">
|
|
Batal
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
@section('scripts')
|
|
<script>
|
|
function togglePasswordVisibility(inputId, buttonElement) {
|
|
const input = document.getElementById(inputId);
|
|
const isPassword = input.type === 'password';
|
|
input.type = isPassword ? 'text' : 'password';
|
|
}
|
|
</script>
|
|
@endsection
|
|
@endsection
|