MIF_E31230745/resources/views/admin/guru-bk/create.blade.php

66 lines
4.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('admin.layouts.app')
@section('title', 'Tambah Guru BK')
@section('content')
<div class="flex justify-between items-center mb-6">
<div>
<h2 class="text-2xl font-bold text-maroon"> Tambah Akun Guru BK</h2>
<p class="text-sm text-gray-500 mt-1">Buat akun baru untuk guru BK</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.store') }}" method="POST" class="space-y-4">
@csrf
<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') }}" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-maroon" placeholder="Nama guru BK">
@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') }}" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-maroon" placeholder="email@sekolah.id">
@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 *</label>
<div style="position: relative; display: flex; align-items: center;">
<input type="password" id="guruBKPassword" name="password" required 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('guruBKPassword', 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 *</label>
<div style="position: relative; display: flex; align-items: center;">
<input type="password" id="guruBKPasswordConfirm" name="password_confirmation" required 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" 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('guruBKPasswordConfirm', 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">
💾 Simpan
</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