75 lines
5.5 KiB
PHP
75 lines
5.5 KiB
PHP
<x-app-layout>
|
|
<x-slot name="header">
|
|
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center">
|
|
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight mb-2 sm:mb-0">
|
|
{{ __('Gestione Anagrafiche') }}
|
|
</h2>
|
|
<div class="flex space-x-2 items-center">
|
|
<form method="GET" action="{{ route('admin.anagrafiche.index') }}">
|
|
<x-text-input name="search" placeholder="Cerca anagrafica..." :value="request('search')" class="py-1"/>
|
|
<x-primary-button type="submit" class="ml-2 py-1.5">Cerca</x-primary-button>
|
|
</form>
|
|
<x-primary-button-link href="{{ route('admin.anagrafiche.create') }}">
|
|
{{ __('Nuova Anagrafica') }}
|
|
</x-primary-button-link>
|
|
</div>
|
|
</div>
|
|
</x-slot>
|
|
|
|
<div class="py-12">
|
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
|
<div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
|
|
<div class="p-6 text-gray-900 dark:text-gray-100">
|
|
@if (session('success'))
|
|
<div class="mb-4 p-4 text-sm text-green-700 bg-green-100 rounded-lg dark:bg-green-200 dark:text-green-800" role="alert">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
<thead class="bg-gray-50 dark:bg-gray-700">
|
|
<tr>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Nominativo/Rag. Sociale</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">CF/P.IVA</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Email</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Tipo</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Azioni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
|
|
@forelse ($anagrafiche as $anagrafica)
|
|
<tr>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100">
|
|
<a href="{{ route('admin.anagrafiche.show', $anagrafica) }}" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-200">
|
|
{{ $anagrafica->ragione_sociale ?: ($anagrafica->cognome . ' ' . $anagrafica->nome) }}
|
|
</a>
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">{{ $anagrafica->codice_fiscale ?: $anagrafica->partita_iva ?: '-' }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">{{ $anagrafica->email ?: '-' }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">{{ ucfirst($anagrafica->tipo) }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
|
<a href="{{ route('admin.anagrafiche.edit', $anagrafica) }}" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-200 mr-2">Modifica</a>
|
|
<form action="{{ route('admin.anagrafiche.destroy', $anagrafica) }}" method="POST" class="inline-block" onsubmit="return confirm('Sei sicuro di voler eliminare questa anagrafica?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200">Elimina</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5" class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300 text-center">Nessuna anagrafica trovata.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="mt-4">
|
|
{{ $anagrafiche->appends(request()->query())->links() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-app-layout> |