154 lines
7.7 KiB
PHP
154 lines
7.7 KiB
PHP
<x-filament-panels::page>
|
|
<div class="grid grid-cols-1 gap-4 lg:grid-cols-3">
|
|
<x-filament::section class="lg:col-span-2">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div>
|
|
<div class="text-sm text-gray-500">Nominativo</div>
|
|
<div class="text-lg font-semibold">{{ $this->persona->nome_completo }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Tipologia</div>
|
|
<div class="text-lg font-semibold">{{ $this->persona->tipologia ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Codice fiscale</div>
|
|
<div class="font-mono">{{ $this->persona->codice_fiscale ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Partita IVA</div>
|
|
<div class="font-mono">{{ $this->persona->partita_iva ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Telefono</div>
|
|
<div>{{ $this->persona->telefono_principale ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div>
|
|
<div class="text-sm text-gray-500">Email principale</div>
|
|
<div>{{ $this->persona->email_principale ?? '—' }}</div>
|
|
@if(!empty($emailMultiple))
|
|
<div class="mt-2 flex flex-wrap gap-2">
|
|
@foreach($emailMultiple as $e)
|
|
<span class="inline-flex items-center rounded-full border border-gray-200 bg-gray-50 px-2.5 py-1 text-xs font-semibold text-gray-800">
|
|
{{ $e['email'] }}
|
|
</span>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<div class="text-sm text-gray-500">Note</div>
|
|
<div class="whitespace-pre-wrap">{{ $this->persona->note ?? '—' }}</div>
|
|
</div>
|
|
|
|
<div class="md:col-span-2">
|
|
<div class="text-sm text-gray-500">Ruoli</div>
|
|
@php
|
|
$ruoli = $this->persona->ruoli ?? [];
|
|
$labels = \App\Models\Persona::getRuoliDisponibili();
|
|
@endphp
|
|
|
|
@if(empty($ruoli))
|
|
<div class="text-sm text-gray-700">—</div>
|
|
@else
|
|
<div class="flex flex-wrap gap-2">
|
|
@foreach($ruoli as $r)
|
|
<span class="inline-flex items-center rounded-full border border-gray-200 bg-gray-50 px-2.5 py-1 text-xs font-semibold text-gray-800">
|
|
{{ $labels[$r] ?? $r }}
|
|
</span>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Azioni</x-slot>
|
|
<div class="space-y-2">
|
|
<a href="{{ $this->getUrlComunicazioni() }}" class="fi-btn fi-btn-color-primary fi-btn-size-md w-full justify-center">
|
|
Comunicazioni
|
|
</a>
|
|
<a href="{{ $this->getUrlTicketNuovo() }}" class="fi-btn fi-btn-color-gray fi-btn-size-md w-full justify-center">
|
|
Nuovo ticket
|
|
</a>
|
|
<a href="{{ $this->getUrlTicketAvvisi() }}" class="fi-btn fi-btn-color-gray fi-btn-size-md w-full justify-center">
|
|
Avvisi
|
|
</a>
|
|
<a href="{{ $this->getUrlTicketUrgenze() }}" class="fi-btn fi-btn-color-gray fi-btn-size-md w-full justify-center">
|
|
Urgenze
|
|
</a>
|
|
</div>
|
|
</x-filament::section>
|
|
</div>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Cronistoria occupanti / relazioni</x-slot>
|
|
<x-slot name="description">Storico collegamenti persona ↔ unità (con periodi).</x-slot>
|
|
|
|
@if(empty($cronistoriaUnita))
|
|
<div class="text-sm text-gray-500">Nessuna relazione registrata.</div>
|
|
@else
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b text-left text-gray-500">
|
|
<th class="py-2">Stabile</th>
|
|
<th class="py-2">Unità</th>
|
|
<th class="py-2">Relazione</th>
|
|
<th class="py-2">Periodo</th>
|
|
<th class="py-2 text-right">Quota</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y">
|
|
@foreach($cronistoriaUnita as $r)
|
|
@php
|
|
$unitaUrl = $this->getUrlUnita($r['unita_id'] ?? null);
|
|
$periodo = trim(($r['data_inizio'] ?? '—') . ' → ' . (($r['data_fine'] ?? null) ?: 'in corso'));
|
|
@endphp
|
|
<tr>
|
|
<td class="py-2 text-gray-900">
|
|
{{ $r['stabile_codice'] ?? '—' }}
|
|
@if(!empty($r['stabile_nome']))
|
|
<div class="text-xs text-gray-500">{{ $r['stabile_nome'] }}</div>
|
|
@endif
|
|
</td>
|
|
<td class="py-2">
|
|
@if($unitaUrl)
|
|
<a href="{{ $unitaUrl }}" class="inline-flex items-center rounded-full border border-primary-200 bg-primary-50 px-2 py-0.5 text-xs font-semibold text-primary-700 hover:bg-primary-100">
|
|
{{ $r['unita_codice'] ?? 'Unità' }}
|
|
</a>
|
|
@else
|
|
<span class="text-gray-900">{{ $r['unita_codice'] ?? '—' }}</span>
|
|
@endif
|
|
@if(!empty($r['unita_nome']))
|
|
<div class="text-xs text-gray-500">{{ $r['unita_nome'] }}</div>
|
|
@endif
|
|
</td>
|
|
<td class="py-2 text-gray-900">
|
|
{{ $r['tipo_relazione'] ?? '—' }}
|
|
@if(!empty($r['ruolo_rate']))
|
|
<div class="text-xs text-gray-500">ruolo rate: ({{ $r['ruolo_rate'] }})</div>
|
|
@endif
|
|
@if(!empty($r['attivo']))
|
|
<div class="text-xs text-gray-500">attiva</div>
|
|
@else
|
|
<div class="text-xs text-gray-500">chiusa</div>
|
|
@endif
|
|
</td>
|
|
<td class="py-2 text-gray-900">{{ $periodo }}</td>
|
|
<td class="py-2 text-right text-gray-900">{{ is_null($r['quota_relazione']) ? '—' : number_format((float) $r['quota_relazione'], 2, ',', '.') . '%' }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@endif
|
|
</x-filament::section>
|
|
</x-filament-panels::page>
|