123 lines
4.8 KiB
PHP
123 lines
4.8 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Register</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
|
|
<style>
|
|
body {
|
|
background: #f8f9fa;
|
|
}
|
|
.register-container {
|
|
max-width: 500px;
|
|
background: white;
|
|
padding: 2rem;
|
|
border-radius: 10px;
|
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="d-flex justify-content-center align-items-center vh-100">
|
|
|
|
<div class="card shadow-lg p-4" style="width: 400px;">
|
|
<h3 class="text-center mb-4">Register Account</h3>
|
|
|
|
<form method="POST" action="/register">
|
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
|
|
|
<!-- Role Selection -->
|
|
<div class="mb-3">
|
|
<label for="role" class="form-label">Select Role</label>
|
|
<select name="role" id="role" class="form-control" required>
|
|
<option value="kurir">Kurir</option>
|
|
<option value="owner">Owner</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Name -->
|
|
<div class="mb-3">
|
|
<label for="name" class="form-label">Full Name</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text"><i class="bi bi-person"></i></span>
|
|
<input id="name" type="text" class="form-control" name="name" required autofocus>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Email -->
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label">Email Address</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text"><i class="bi bi-envelope"></i></span>
|
|
<input id="email" type="email" class="form-control" name="email" required>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Password -->
|
|
<div class="mb-3">
|
|
<label for="password" class="form-label">Password</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text"><i class="bi bi-lock"></i></span>
|
|
<input id="password" type="password" class="form-control" name="password" required>
|
|
<button type="button" class="btn btn-outline-secondary" id="togglePassword">
|
|
<i class="bi bi-eye"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Confirm Password -->
|
|
<div class="mb-3">
|
|
<label for="password-confirm" class="form-label">Confirm Password</label>
|
|
<div class="input-group">
|
|
<span class="input-group-text"><i class="bi bi-lock"></i></span>
|
|
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
|
|
<button type="button" class="btn btn-outline-secondary" id="toggleConfirmPassword">
|
|
<i class="bi bi-eye"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Submit Button -->
|
|
<div class="d-grid">
|
|
<button type="submit" class="btn btn-primary">Register</button>
|
|
</div>
|
|
|
|
<!-- Already have an account? -->
|
|
<div class="text-center mt-3">
|
|
<p class="small">Already have an account? <a href="/">Login here</a></p>
|
|
</div>
|
|
|
|
@if(session('success'))
|
|
<script>
|
|
alert("{{ session('success') }}");
|
|
window.location.href = "{{ route('login') }}"; // Redirect ke halaman login
|
|
</script>
|
|
@endif
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.getElementById('togglePassword').addEventListener('click', function () {
|
|
let passwordField = document.getElementById('password');
|
|
let icon = this.querySelector('i');
|
|
passwordField.type = passwordField.type === 'password' ? 'text' : 'password';
|
|
icon.classList.toggle('bi-eye');
|
|
icon.classList.toggle('bi-eye-slash');
|
|
});
|
|
|
|
document.getElementById('toggleConfirmPassword').addEventListener('click', function () {
|
|
let confirmPasswordField = document.getElementById('password-confirm');
|
|
let icon = this.querySelector('i');
|
|
confirmPasswordField.type = confirmPasswordField.type === 'password' ? 'text' : 'password';
|
|
icon.classList.toggle('bi-eye');
|
|
icon.classList.toggle('bi-eye-slash');
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|