netgescon-master/resources/views/admin/soggetti/index.blade.php

61 lines
4.6 KiB
PHP

<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
{{ __('Gestione Anagrafiche (Soggetti)') }}
</h2>
</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">
<div class="flex justify-between items-center mb-6">
<h3 class="text-2xl font-bold text-gray-800 dark:text-gray-200">Elenco Anagrafiche</h3>
<a href="{{ route('admin.soggetti.create') }}"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Nuova Anagrafica
</a>
</div>
<!-- Tabella Anagrafiche -->
<div class="overflow-x-auto">
<table class="min-w-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700">
<thead class="bg-gray-50 dark:bg-gray-700">
<tr>
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Nome / Ragione Sociale</th>
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Tipo</th>
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Email</th>
<th class="px-6 py-3 border-b border-gray-200 dark:border-gray-600 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($soggetti as $soggetto)
<tr class="hover:bg-gray-50 dark:hover:bg-gray-600">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-200">{{ $soggetto->id_soggetto }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-200">{{ $soggetto->ragione_sociale ?: ($soggetto->nome . ' ' . $soggetto->cognome) }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-200">{{ $soggetto->tipo }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-200">{{ $soggetto->email }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2">
<a href="{{ route('admin.soggetti.edit', $soggetto) }}" class="text-indigo-600 hover:text-indigo-900">Modifica</a>
<form method="POST" action="{{ route('admin.soggetti.destroy', $soggetto) }}" class="inline" onsubmit="return confirm('Sei sicuro di voler eliminare questa anagrafica?')">
@csrf
@method('DELETE')
<button type="submit" class="text-red-600 hover:text-red-900">Elimina</button>
</form>
</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-6 py-4 text-center text-gray-500 dark:text-gray-400">Nessuna anagrafica trovata.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>