125 lines
6.7 KiB
PHP
Executable File
125 lines
6.7 KiB
PHP
Executable File
@extends('admin.layouts.netgescon')
|
|
|
|
@section('title', 'Modifica Soggetto')
|
|
|
|
@section('content')
|
|
<div class="container-fluid">
|
|
{{-- Header --}}
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h1 class="h3 mb-0">
|
|
<i class="fas fa-user-edit text-primary me-2"></i>
|
|
Modifica Soggetto
|
|
</h1>
|
|
<nav aria-label="breadcrumb">
|
|
<ol class="breadcrumb mb-0">
|
|
<li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">Dashboard</a></li>
|
|
<li class="breadcrumb-item"><a href="{{ route('admin.soggetti.index') }}">Soggetti</a></li>
|
|
<li class="breadcrumb-item active">Modifica</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
<div>
|
|
<a href="{{ route('admin.soggetti.index') }}" class="btn btn-outline-secondary">
|
|
<i class="fas fa-arrow-left me-1"></i>
|
|
Torna all'Elenco
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Form --}}
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">
|
|
<i class="fas fa-edit me-2"></i>
|
|
Dati Soggetto
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="POST" action="{{ route('admin.soggetti.update', $soggetto) }}">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="mb-3">
|
|
<label for="nome" class="form-label">Nome</label>
|
|
<input type="text" name="nome" id="nome" class="form-control @error('nome') is-invalid @enderror" value="{{ old('nome', $soggetto->nome) }}">
|
|
@error('nome')
|
|
<div class="invalid-feedback">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="mb-3">
|
|
<label for="cognome" class="form-label">Cognome</label>
|
|
<input type="text" name="cognome" id="cognome" class="form-control @error('cognome') is-invalid @enderror" value="{{ old('cognome', $soggetto->cognome) }}">
|
|
@error('cognome')
|
|
<div class="invalid-feedback">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="ragione_sociale" class="form-label">Ragione Sociale</label>
|
|
<input type="text" name="ragione_sociale" id="ragione_sociale" class="form-control @error('ragione_sociale') is-invalid @enderror" value="{{ old('ragione_sociale', $soggetto->ragione_sociale) }}">
|
|
@error('ragione_sociale')
|
|
<div class="invalid-feedback">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
|
|
<!-- Altri campi -->
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
<div>
|
|
<label for="codice_fiscale" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Codice Fiscale</label>
|
|
<input type="text" name="codice_fiscale" id="codice_fiscale" value="{{ old('codice_fiscale', $soggetto->codice_fiscale) }}" class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 rounded-md shadow-sm">
|
|
</div>
|
|
<div>
|
|
<label for="partita_iva" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Partita IVA</label>
|
|
<input type="text" name="partita_iva" id="partita_iva" value="{{ old('partita_iva', $soggetto->partita_iva) }}" class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 rounded-md shadow-sm">
|
|
</div>
|
|
<div>
|
|
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Email</label>
|
|
<input type="email" name="email" id="email" value="{{ old('email', $soggetto->email) }}" class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 rounded-md shadow-sm">
|
|
</div>
|
|
<div>
|
|
<label for="telefono" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Telefono</label>
|
|
<input type="text" name="telefono" id="telefono" value="{{ old('telefono', $soggetto->telefono) }}" class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 rounded-md shadow-sm">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tipo Soggetto -->
|
|
<div>
|
|
<label for="tipo" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Tipo Soggetto</label>
|
|
<select name="tipo" id="tipo" required class="mt-1 block w-full border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 rounded-md shadow-sm">
|
|
<option value="">Seleziona Tipo</option>
|
|
@foreach($tipi_anagrafica as $tipo)
|
|
<option value="{{ $tipo }}" {{ old('tipo', $soggetto->tipo) == $tipo ? 'selected' : '' }}>{{ ucfirst($tipo) }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Pulsanti -->
|
|
<div class="flex items-center justify-end">
|
|
<a href="{{ route('admin.soggetti.index') }}" class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded mr-2">Annulla</a>
|
|
<button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Aggiorna Anagrafica</button>
|
|
</div>
|
|
</form>
|
|
|
|
@if ($errors->any())
|
|
<div class="mt-4 text-red-600">
|
|
<ul>
|
|
@foreach ($errors->all() as $error)
|
|
<li>{{ $error }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-app-layout>
|