Projects/3BIT/winter-semester/IIS/xnecasr00/resources/views/admin/users/create.blade.php
2026-04-14 19:28:46 +02:00

257 lines
7.3 KiB
PHP

@extends('layouts.customer')
@section('title', 'Create New User - Admin')
@section('content')
<div class="admin-container">
<!-- Page Header -->
<div class="page-header">
<h1>Create New User</h1>
<p class="subtitle">Add a new user to the system</p>
</div>
<!-- User Form -->
<div class="form-container">
<form method="POST" action="{{ route('admin.users.store') }}">
@csrf
<!-- Name -->
<div class="form-group">
<label for="name">Full Name *</label>
<input
type="text"
id="name"
name="name"
value="{{ old('name') }}"
required
class="form-input @error('name') error @enderror"
placeholder="Enter full name"
>
@error('name')
<span class="error-message">{{ $message }}</span>
@enderror
</div>
<!-- Username -->
<div class="form-group">
<label for="username">Username *</label>
<input
type="text"
id="username"
name="username"
value="{{ old('username') }}"
required
class="form-input @error('username') error @enderror"
placeholder="Enter username"
>
@error('username')
<span class="error-message">{{ $message }}</span>
@enderror
</div>
<!-- Email -->
<div class="form-group">
<label for="email">Email Address *</label>
<input
type="email"
id="email"
name="email"
value="{{ old('email') }}"
required
class="form-input @error('email') error @enderror"
placeholder="Enter email address"
>
@error('email')
<span class="error-message">{{ $message }}</span>
@enderror
</div>
<!-- Password -->
<div class="form-group">
<label for="password">Password *</label>
<input
type="password"
id="password"
name="password"
required
class="form-input @error('password') error @enderror"
placeholder="Enter password (min. 8 characters)"
>
@error('password')
<span class="error-message">{{ $message }}</span>
@enderror
</div>
<!-- Password Confirmation -->
<div class="form-group">
<label for="password_confirmation">Confirm Password *</label>
<input
type="password"
id="password_confirmation"
name="password_confirmation"
required
class="form-input"
placeholder="Confirm password"
>
</div>
<!-- Role -->
<div class="form-group">
<label for="role">Role *</label>
<select id="role" name="role" required class="form-select @error('role') error @enderror">
<option value="">Select role...</option>
<option value="admin" {{ old('role') == 'admin' ? 'selected' : '' }}>Admin</option>
<option value="winemaker" {{ old('role') == 'winemaker' ? 'selected' : '' }}>Winemaker</option>
<option value="employee" {{ old('role') == 'employee' ? 'selected' : '' }}>Employee</option>
<option value="customer" {{ old('role') == 'customer' ? 'selected' : '' }}>Customer</option>
</select>
@error('role')
<span class="error-message">{{ $message }}</span>
@enderror
</div>
<!-- Form Actions -->
<div class="form-actions">
<a href="{{ route('admin.users.index') }}" class="btn-cancel">Cancel</a>
<button type="submit" class="btn-submit">
<svg style="width: 18px; height: 18px;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
</svg>
Create User
</button>
</div>
</form>
</div>
</div>
<style>
.admin-container {
max-width: 100%;
}
.page-header {
text-align: center;
margin-bottom: 3rem;
}
.page-header h1 {
font-size: 2.5rem;
color: #2d3748;
margin-bottom: 0.5rem;
font-weight: 700;
}
.subtitle {
font-size: 1.1rem;
color: #718096;
}
.form-container {
max-width: 600px;
margin: 0 auto;
background: white;
padding: 2.5rem;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.form-group {
margin-bottom: 1.5rem;
}
label {
display: block;
font-weight: 600;
color: #2d3748;
margin-bottom: 0.5rem;
font-size: 0.95rem;
}
.form-input,
.form-select {
width: 100%;
padding: 0.875rem 1rem;
border: 2px solid #e2e8f0;
border-radius: 8px;
font-size: 1rem;
transition: all 0.2s;
background: #f7fafc;
}
.form-input:focus,
.form-select:focus {
outline: none;
border-color: #89b4d9;
background: white;
}
.form-input.error,
.form-select.error {
border-color: #fc8181;
background: #fff5f5;
}
.error-message {
display: block;
color: #e53e3e;
font-size: 0.875rem;
margin-top: 0.5rem;
}
.form-actions {
display: flex;
gap: 1rem;
margin-top: 2rem;
padding-top: 2rem;
border-top: 2px solid #e2e8f0;
}
.btn-submit,
.btn-cancel {
flex: 1;
padding: 0.875rem 1.75rem;
border-radius: 8px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
border: none;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
text-decoration: none;
}
.btn-submit {
background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
color: white;
box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}
.btn-submit:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}
.btn-cancel {
background: #f7fafc;
color: #4a5568;
border: 2px solid #e2e8f0;
}
.btn-cancel:hover {
background: #edf2f7;
}
@media (max-width: 768px) {
.form-container {
padding: 1.5rem;
}
.form-actions {
flex-direction: column;
}
}
</style>
@endsection