362 lines
13 KiB
PHP
Executable File
362 lines
13 KiB
PHP
Executable File
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Scheda Individuo - <?php echo e($individuo->cognome); ?> <?php echo e($individuo->nome); ?></title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
font-size: 12px;
|
|
line-height: 1.4;
|
|
color: #333;
|
|
padding: 20px;
|
|
}
|
|
.header {
|
|
text-align: center;
|
|
margin-bottom: 20px;
|
|
padding-bottom: 15px;
|
|
border-bottom: 2px solid #2c3e50;
|
|
}
|
|
.header-content {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.header h1 {
|
|
font-size: 24px;
|
|
color: #2c3e50;
|
|
margin-bottom: 5px;
|
|
}
|
|
.header .subtitle {
|
|
font-size: 14px;
|
|
color: #7f8c8d;
|
|
}
|
|
.section {
|
|
margin-bottom: 20px;
|
|
page-break-inside: avoid;
|
|
}
|
|
.section-title {
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
color: #fff;
|
|
background: #2c3e50;
|
|
padding: 8px 12px;
|
|
margin-bottom: 10px;
|
|
border-radius: 3px;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-bottom: 10px;
|
|
}
|
|
th, td {
|
|
border: 1px solid #ddd;
|
|
padding: 8px;
|
|
text-align: left;
|
|
}
|
|
th {
|
|
background: #f8f9fa;
|
|
font-weight: bold;
|
|
width: 150px;
|
|
}
|
|
.badge {
|
|
display: inline-block;
|
|
padding: 3px 8px;
|
|
background: #6c757d;
|
|
color: #fff;
|
|
border-radius: 3px;
|
|
font-size: 11px;
|
|
}
|
|
.badge-success { background: #28a745; }
|
|
.badge-warning { background: #ffc107; color: #333; }
|
|
.badge-danger { background: #dc3545; }
|
|
.badge-info { background: #17a2b8; }
|
|
.info-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 10px;
|
|
}
|
|
.info-item {
|
|
border: 1px solid #ddd;
|
|
padding: 10px;
|
|
}
|
|
.info-item label {
|
|
display: block;
|
|
font-weight: bold;
|
|
color: #666;
|
|
font-size: 10px;
|
|
text-transform: uppercase;
|
|
margin-bottom: 3px;
|
|
}
|
|
.empty {
|
|
color: #999;
|
|
font-style: italic;
|
|
}
|
|
.footer {
|
|
margin-top: 30px;
|
|
padding-top: 15px;
|
|
border-top: 1px solid #ddd;
|
|
text-align: center;
|
|
font-size: 10px;
|
|
color: #999;
|
|
}
|
|
@media print {
|
|
body { padding: 0; }
|
|
.section { page-break-inside: avoid; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<div class="header-content">
|
|
<?php if($individuo->avatar): ?>
|
|
<img src="<?php echo e(url('/individui/' . $individuo->id . '/avatar')); ?>"
|
|
alt="Avatar"
|
|
style="width: 80px; height: 80px; object-fit: cover; border-radius: 50%; margin-right: 20px; border: 3px solid #2c3e50;">
|
|
<?php endif; ?>
|
|
<div>
|
|
<h1><?php echo e($individuo->cognome); ?> <?php echo e($individuo->nome); ?></h1>
|
|
<div class="subtitle">Scheda Individuo - Codice: <?php echo e($individuo->codice_id); ?></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Dati Anagrafici</div>
|
|
<table>
|
|
<tr>
|
|
<th>Codice</th>
|
|
<td><span class="badge"><?php echo e($individuo->codice_id); ?></span></td>
|
|
<th>Cognome</th>
|
|
<td><?php echo e($individuo->cognome); ?></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Nome</th>
|
|
<td><?php echo e($individuo->nome); ?></td>
|
|
<th>Genere</th>
|
|
<td><?php echo e($individuo->genere === 'M' ? 'Maschile' : ($individuo->genere === 'F' ? 'Femminile' : '-')); ?></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Data di nascita</th>
|
|
<td><?php echo e($individuo->data_nascita ? $individuo->data_nascita->format('d/m/Y') : '-'); ?></td>
|
|
<th>Luogo di nascita</th>
|
|
<td><?php echo e($individuo->città ?: '-'); ?></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Residenza</div>
|
|
<div class="info-grid">
|
|
<div class="info-item">
|
|
<label>Indirizzo</label>
|
|
<?php echo e($individuo->indirizzo ?: '-'); ?>
|
|
|
|
</div>
|
|
<div class="info-item">
|
|
<label>CAP</label>
|
|
<?php echo e($individuo->cap ?: '-'); ?>
|
|
|
|
</div>
|
|
<div class="info-item">
|
|
<label>Città</label>
|
|
<?php echo e($individuo->città ?: '-'); ?>
|
|
|
|
</div>
|
|
<div class="info-item">
|
|
<label>Provincia</label>
|
|
<?php echo e($individuo->sigla_provincia ?: '-'); ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Documento di Identità</div>
|
|
<?php if($individuo->tipo_documento || $individuo->numero_documento): ?>
|
|
<table>
|
|
<tr>
|
|
<th>Tipo</th>
|
|
<td>
|
|
<?php if($individuo->tipo_documento === 'carta_identita'): ?>
|
|
<span class="badge badge-info">Carta d'Identità</span>
|
|
<?php elseif($individuo->tipo_documento === 'patente'): ?>
|
|
<span class="badge badge-warning">Patente</span>
|
|
<?php else: ?>
|
|
<?php echo e($individuo->tipo_documento); ?>
|
|
|
|
<?php endif; ?>
|
|
</td>
|
|
<th>Numero</th>
|
|
<td><?php echo e($individuo->numero_documento); ?></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Scadenza</th>
|
|
<td>
|
|
<?php if($individuo->scadenza_documento): ?>
|
|
<?php if($individuo->scadenza_documento->isPast()): ?>
|
|
<span class="badge badge-danger">SCADUTO</span>
|
|
<?php else: ?>
|
|
<?php echo e($individuo->scadenza_documento->format('d/m/Y')); ?>
|
|
|
|
<?php endif; ?>
|
|
<?php else: ?>
|
|
-
|
|
<?php endif; ?>
|
|
</td>
|
|
<th></th>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
<?php else: ?>
|
|
<p class="empty">Nessun documento registrato</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Contatti (<?php echo e($individuo->contatti->count()); ?>)</div>
|
|
<?php if($individuo->contatti->count() > 0): ?>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Tipo</th>
|
|
<th>Valore</th>
|
|
<th>Etichetta</th>
|
|
<th>Primario</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $__currentLoopData = $individuo->contatti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contatto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<tr>
|
|
<td>
|
|
<?php switch($contatto->tipo):
|
|
case ('email'): ?>
|
|
<span class="badge badge-info">Email</span>
|
|
<?php break; ?>
|
|
<?php case ('telefono'): ?>
|
|
<span class="badge">Telefono</span>
|
|
<?php break; ?>
|
|
<?php case ('cellulare'): ?>
|
|
<span class="badge badge-success">Cellulare</span>
|
|
<?php break; ?>
|
|
<?php default: ?>
|
|
<?php echo e($contatto->tipo); ?>
|
|
|
|
<?php endswitch; ?>
|
|
</td>
|
|
<td><?php echo e($contatto->valore); ?></td>
|
|
<td><?php echo e($contatto->etichetta ?: '-'); ?></td>
|
|
<td><?php echo e($contatto->is_primary ? '✓' : '-'); ?></td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else: ?>
|
|
<p class="empty">Nessun contatto registrato</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Gruppi di Appartenenza (<?php echo e($individuo->gruppi->count()); ?>)</div>
|
|
<?php if($individuo->gruppi->count() > 0): ?>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Gruppo</th>
|
|
<th>Ruolo</th>
|
|
<th>Data Adesione</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $__currentLoopData = $individuo->gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<tr>
|
|
<td><?php echo e($gruppo->nome); ?></td>
|
|
<td><?php echo e($gruppo->pivot->ruolo_nel_gruppo ?: '-'); ?></td>
|
|
<td><?php echo e($gruppo->pivot->data_adesione ? \Carbon\Carbon::parse($gruppo->pivot->data_adesione)->format('d/m/Y') : '-'); ?></td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else: ?>
|
|
<p class="empty">Nessun gruppo associato</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Documenti (<?php echo e($individuo->documenti->count()); ?>)</div>
|
|
<?php if($individuo->documenti->count() > 0): ?>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Nome</th>
|
|
<th>Tipologia</th>
|
|
<th>Dimensione</th>
|
|
<th>Data Upload</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $__currentLoopData = $individuo->documenti; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $documento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<tr>
|
|
<td><?php echo e($documento->nome); ?></td>
|
|
<td><?php echo e($documento->tipologia); ?></td>
|
|
<td><?php echo e($documento->dimensione ? number_format($documento->dimensione / 1024, 1) . ' KB' : '-'); ?></td>
|
|
<td><?php echo e($documento->created_at->format('d/m/Y')); ?></td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else: ?>
|
|
<p class="empty">Nessun documento caricato</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<div class="section-title">Eventi come Responsabile (<?php echo e($individuo->eventiResponsabili->count()); ?>)</div>
|
|
<?php if($individuo->eventiResponsabili->count() > 0): ?>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Evento</th>
|
|
<th>Data</th>
|
|
<th>Tipo Ricorrenza</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $__currentLoopData = $individuo->eventiResponsabili; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $evento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<tr>
|
|
<td><?php echo e($evento->nome); ?></td>
|
|
<td><?php echo e($evento->data_specifica ? $evento->data_specifica->format('d/m/Y') : '-'); ?></td>
|
|
<td><?php echo e($evento->tipo_recorrenza ?: '-'); ?></td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else: ?>
|
|
<p class="empty">Nessun evento assegnato come responsabile</p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<?php if($individuo->note): ?>
|
|
<div class="section">
|
|
<div class="section-title">Note</div>
|
|
<p><?php echo e($individuo->note); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="footer">
|
|
<p>Report generato il <?php echo e(now()->format('d/m/Y H:i')); ?> - Glastree</p>
|
|
</div>
|
|
|
|
<script>
|
|
window.onload = function() {
|
|
window.print();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html><?php /**PATH /var/www/html/glastree/resources/views/individui/report.blade.php ENDPATH**/ ?>
|