netgescon-day0/resources/views/superadmin/users/create.blade.php

78 lines
3.3 KiB
PHP
Executable File

@extends('admin.layouts.netgescon')
@section('title', 'Nuovo Utente')
@section('breadcrumb')
<a href="{{ route('superadmin.dashboard') }}">SuperAdmin</a>
<i class="fas fa-chevron-right text-xs"></i>
<a href="{{ route('superadmin.users.index') }}">Utenti</a>
<i class="fas fa-chevron-right text-xs"></i>
<span>Crea</span>
@endsection
@section('content')
<form method="POST" action="{{ route('superadmin.users.store') }}" class="space-y-4">
@csrf
<div class="netgescon-card p-4 grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm text-gray-600">Nome</label>
<input type="text" name="name" class="netgescon-input w-full" required>
</div>
<div>
<label class="block text-sm text-gray-600">Email</label>
<input type="email" name="email" class="netgescon-input w-full" required>
</div>
<div>
<label class="block text-sm text-gray-600">Password</label>
<input type="password" name="password" class="netgescon-input w-full" required>
</div>
<div>
<label class="block text-sm text-gray-600">Conferma Password</label>
<input type="password" name="password_confirmation" class="netgescon-input w-full" required>
</div>
<div>
<label class="block text-sm text-gray-600">Ruolo</label>
<select name="role" class="netgescon-input w-full" required>
@foreach($roles as $r)
<option value="{{ $r->name }}">{{ $r->name }}</option>
@endforeach
</select>
</div>
<div>
<label class="block text-sm text-gray-600">Scadenza Accesso (opzionale)</label>
<input type="date" name="expires_at" class="netgescon-input w-full">
</div>
<div>
<label class="block text-sm text-gray-600">Piano Sottoscrizione</label>
<select name="subscription_plan_id" class="netgescon-input w-full">
<option value="">Nessuno</option>
@foreach($plans as $plan)
<option value="{{ $plan->id }}">{{ $plan->name }}</option>
@endforeach
</select>
</div>
</div>
<div class="netgescon-card p-4">
<h3 class="font-semibold mb-2">Permessi Modulo GESCON Import</h3>
<div class="flex flex-wrap gap-4">
<label class="inline-flex items-center gap-2 text-sm">
<input type="checkbox" name="permissions[]" value="gescon-import.view">
<span>Visualizza</span>
</label>
<label class="inline-flex items-center gap-2 text-sm">
<input type="checkbox" name="permissions[]" value="gescon-import.execute">
<span>Esecuzione Import</span>
</label>
<label class="inline-flex items-center gap-2 text-sm">
<input type="checkbox" name="permissions[]" value="contabilita-gescon.view">
<span>Contabilità Gescon</span>
</label>
</div>
<p class="text-xs text-gray-500 mt-2">Nota: i permessi vengono applicati oltre al ruolo selezionato.</p>
</div>
<div class="flex justify-end">
<button class="netgescon-btn netgescon-btn-primary">Crea Utente</button>
</div>
</form>
@endsection