9Merge branch 'dev'

fix piccoli
This commit is contained in:
2026-06-07 23:06:37 +02:00
2447 changed files with 227 additions and 325426 deletions
@@ -1,418 +0,0 @@
<?php $__env->startSection('title', 'Report'); ?>
<?php $__env->startSection('page_title', 'Report e Statistiche'); ?>
<?php $__env->startSection('styles'); ?>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/select2-bootstrap4-theme@1.0.0/dist/select2-bootstrap4.min.css" rel="stylesheet" />
<style>
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
font-size: 0.8rem;
}
.card-indigo {
border-top: 3px solid #6610f2;
}
.card-indigo .card-title {
color: #6610f2;
}
.accordion .card-header .btn-link {
text-decoration: none;
font-weight: 600;
color: #495057;
}
.accordion .card-header .btn-link:hover {
color: #007bff;
}
.accordion .card-header .btn-link i {
transition: transform 0.2s ease;
width: 20px;
}
.accordion .card-header .btn-link[aria-expanded="true"] i.fa-chevron-right {
transform: rotate(90deg);
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('success')); ?>
</div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('error')); ?>
</div>
<?php endif; ?>
<div class="accordion" id="reportAccordion">
<div class="card">
<div class="card-header" id="headingOne">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<i class="fas fa-chevron-down mr-2 text-primary"></i>
<i class="fas fa-chart-bar mr-2 text-primary"></i> Panoramica Database
</button>
</h2>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#reportAccordion">
<div class="card-body">
<div class="row">
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-info"><i class="fas fa-users"></i></span>
<div class="info-box-content">
<span class="info-box-text">Individui</span>
<span class="info-box-number"><?php echo e(number_format($stats['individui'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-warning"><i class="fas fa-folder"></i></span>
<div class="info-box-content">
<span class="info-box-text">Gruppi</span>
<span class="info-box-number"><?php echo e(number_format($stats['gruppi'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-danger"><i class="fas fa-calendar"></i></span>
<div class="info-box-content">
<span class="info-box-text">Eventi</span>
<span class="info-box-number"><?php echo e(number_format($stats['eventi'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-secondary"><i class="fas fa-file"></i></span>
<div class="info-box-content">
<span class="info-box-text">Documenti</span>
<span class="info-box-number"><?php echo e(number_format($stats['documenti'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-purple"><i class="fas fa-list"></i></span>
<div class="info-box-content">
<span class="info-box-text">Mailing List</span>
<span class="info-box-number"><?php echo e(number_format($stats['mailing_liste'])); ?></span>
</div>
</div>
</div>
<div class="col-md-2 col-4 text-center">
<div class="info-box">
<span class="info-box-icon bg-teal"><i class="fas fa-address-book"></i></span>
<div class="info-box-content">
<span class="info-box-text">Contatti</span>
<span class="info-box-number"><?php echo e(number_format($stats['contatti'])); ?></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingTwo">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
<i class="fas fa-chevron-right mr-2 text-warning"></i>
<i class="fas fa-chart-pie mr-2 text-warning"></i> Report Predefiniti
<span class="badge badge-warning badge-pill ml-2"><?php echo e(count($prebuiltReports)); ?></span>
</button>
</h2>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#reportAccordion">
<div class="card-body">
<div class="row">
<?php $__currentLoopData = $prebuiltReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $report): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="col-md-4 col-lg-3 mb-3">
<?php
$cardColor = $report['colore'] === 'indigo' ? 'card-indigo' : 'card-' . $report['colore'];
$btnColor = $report['colore'] === 'indigo' ? 'primary' : $report['colore'];
?>
<div class="card <?php echo e($cardColor); ?> card-outline h-100">
<div class="card-body text-center d-flex flex-column">
<i class="fas <?php echo e($report['icona']); ?> fa-3x text-<?php echo e($btnColor); ?> mb-3"></i>
<h5><?php echo e($report['nome']); ?></h5>
<p class="text-muted small mb-3 flex-grow-1"><?php echo e($report['descrizione']); ?></p>
<?php if($report['has_tipologia_filter'] ?? false): ?>
<form action="<?php echo e(route('report.run')); ?>" method="GET" class="mb-2">
<div class="form-group mb-2">
<select name="tipologia_documento" class="form-control form-control-sm select2-tipologia" style="width: 100%;">
<option value="">Tutte le tipologie</option>
<?php $__currentLoopData = $tipologieDocumento; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tipologia): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($tipologia); ?>"><?php echo e(ucfirst($tipologia)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<input type="hidden" name="report" value="<?php echo e($report['id']); ?>">
<div class="btn-group btn-group-sm w-100">
<button type="submit" class="btn btn-sm btn-<?php echo e($btnColor); ?>">
<i class="fas fa-play mr-1"></i> Genera
</button>
<a href="<?php echo e(route('report.export', ['report' => $report['id']])); ?>" class="btn btn-sm btn-outline-<?php echo e($btnColor); ?>">
<i class="fas fa-download mr-1"></i> CSV
</a>
</div>
</form>
<?php else: ?>
<div class="btn-group btn-group-sm w-100">
<a href="<?php echo e(route('report.run', ['report' => $report['id']])); ?>" class="btn btn-sm btn-<?php echo e($btnColor); ?>">
<i class="fas fa-play mr-1"></i> Genera
</a>
<a href="<?php echo e(route('report.export', ['report' => $report['id']])); ?>" class="btn btn-sm btn-outline-<?php echo e($btnColor); ?>">
<i class="fas fa-download mr-1"></i> CSV
</a>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingThree">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
<i class="fas fa-chevron-right mr-2 text-info"></i>
<i class="fas fa-bookmark mr-2 text-info"></i> Report Personalizzati
<span class="badge badge-info badge-pill ml-2"><?php echo e($customReports->count()); ?></span>
</button>
</h2>
</div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#reportAccordion">
<div class="card-body">
<div class="row">
<div class="col-md-8">
<?php if($customReports->count() > 0): ?>
<table class="table table-striped mb-0">
<thead>
<tr>
<th>Nome</th>
<th>Tipo</th>
<th>Creato il</th>
<th style="width: 140px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $customReports; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $report): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<i class="fas fa-chart-line text-primary mr-1"></i>
<?php echo e($report->nome); ?>
</td>
<td><span class="badge badge-info"><?php echo e(ucfirst($report->tipo_report)); ?></span></td>
<td><?php echo e($report->created_at->format('d/m/Y H:i')); ?></td>
<td>
<a href="<?php echo e(route('report.run', ['custom_id' => $report->id])); ?>" class="btn btn-xs btn-success" title="Esegui">
<i class="fas fa-play"></i>
</a>
<a href="<?php echo e(route('report.export', ['custom_id' => $report->id])); ?>" class="btn btn-xs btn-info" title="Esporta CSV">
<i class="fas fa-file-csv"></i>
</a>
<form action="<?php echo e(route('report.destroy-custom', $report->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo report?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-4">
<i class="fas fa-chart-line fa-3x mb-3"></i>
<p>Nessun report personalizzato creato.</p>
</div>
<?php endif; ?>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header bg-primary">
<h3 class="card-title text-white"><i class="fas fa-plus mr-2"></i>Crea Report Personalizzato</h3>
</div>
<div class="card-body">
<form action="<?php echo e(route('report.store-custom')); ?>" method="POST">
<?php echo csrf_field(); ?>
<div class="form-group">
<label>Nome Report *</label>
<input type="text" name="nome" class="form-control" required placeholder="Es: Individui attivi">
</div>
<div class="form-group">
<label>Descrizione</label>
<textarea name="descrizione" class="form-control" rows="2" placeholder="Descrizione opzionale..."></textarea>
</div>
<div class="form-group">
<label>Tipo Dato *</label>
<select name="tipo_report" id="tipo_report" class="form-control" required>
<option value="">Seleziona...</option>
<?php $__currentLoopData = $columnOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type => $columns): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($type); ?>"><?php echo e(ucfirst($type)); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="form-group">
<label>Colonne *</label>
<select name="columns[]" id="columns_select" class="form-control select2-multi" multiple style="width: 100%;">
</select>
<small class="text-muted">Seleziona le colonne da includere nel report</small>
</div>
<div class="form-group">
<label>Ordina per</label>
<select name="sort_by" id="sort_by" class="form-control">
<option value="">Nessun ordinamento</option>
</select>
</div>
<div class="form-group">
<label>Direzione ordinamento</label>
<select name="sort_direction" class="form-control">
<option value="asc">Ascendente (A-Z)</option>
<option value="desc" selected>Discendente (Z-A)</option>
</select>
</div>
<div class="form-group">
<label>Limite risultati</label>
<input type="number" name="limit" class="form-control" placeholder="Es: 100" min="1">
</div>
<button type="submit" class="btn btn-primary btn-block">
<i class="fas fa-save mr-1"></i> Salva Report
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const columnOptions = <?php echo json_encode($columnOptions, 15, 512) ?>;
let columnsSelectInitialized = false;
function initTipologiaSelect2(container) {
$(container).find('.select2-tipologia').select2({
theme: 'bootstrap4',
placeholder: 'Filtra per tipologia...',
allowClear: true,
width: '100%',
});
}
function destroyTipologiaSelect2(container) {
$(container).find('.select2-tipologia').select2('destroy');
}
function initColumnsSelect2() {
if (columnsSelectInitialized) return;
$('#columns_select').select2({
theme: 'bootstrap4',
placeholder: 'Seleziona le colonne...',
allowClear: true,
width: '100%',
});
columnsSelectInitialized = true;
}
function destroyColumnsSelect2() {
if (!columnsSelectInitialized) return;
$('#columns_select').select2('destroy');
columnsSelectInitialized = false;
}
function getSortOptions(tipoReport) {
const cols = columnOptions[tipoReport] || {};
const options = [];
for (const [key, col] of Object.entries(cols)) {
if (col.type !== 'relation') {
options.push({ value: key, label: col.label });
}
}
return options;
}
$('#collapseTwo').on('shown.bs.collapse', function () {
initTipologiaSelect2(this);
}).on('hidden.bs.collapse', function () {
destroyTipologiaSelect2(this);
});
$('#collapseThree').on('shown.bs.collapse', function () {
initColumnsSelect2();
}).on('hidden.bs.collapse', function () {
destroyColumnsSelect2();
});
if ($('#collapseTwo').hasClass('show')) {
initTipologiaSelect2(document);
}
if ($('#collapseThree').hasClass('show')) {
initColumnsSelect2();
}
$('#tipo_report').on('change', function() {
const tipo = this.value;
const $select = $('#columns_select');
if (columnsSelectInitialized) {
$select.empty().trigger('change');
}
$select.empty();
if (tipo && columnOptions[tipo]) {
const cols = columnOptions[tipo];
const fragment = document.createDocumentFragment();
for (const [key, col] of Object.entries(cols)) {
fragment.appendChild(new Option(col.label, key, false, false));
}
$select.append(fragment);
}
if (columnsSelectInitialized) {
$select.trigger('change');
}
const $sortBy = $('#sort_by');
$sortBy.empty();
$sortBy.append(new Option('Nessun ordinamento', '', false, false));
const sortOptions = getSortOptions(tipo);
sortOptions.forEach(function(opt) {
$sortBy.append(new Option(opt.label, opt.value, false, false));
});
});
if ($('#tipo_report').val()) {
$('#tipo_report').trigger('change');
}
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/report/index.blade.php ENDPATH**/ ?>
@@ -1,65 +0,0 @@
<?php $__env->startSection('title', 'Importa Gruppi'); ?>
<?php $__env->startSection('page_title', 'Importa Gruppi da CSV'); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-upload mr-2"></i>Carica file CSV</h3>
</div>
<div class="card-body">
<form action="<?php echo e(route('gruppi.import.store')); ?>" method="POST" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<div class="form-group">
<label for="file">Seleziona file CSV *</label>
<input type="file" name="file" id="file" class="form-control" accept=".csv,.txt" required>
<small class="form-text text-muted">
Il file deve essere in formato CSV con separatore virgola.
</small>
</div>
<button type="submit" class="btn btn-primary">
<i class="fas fa-upload mr-1"></i> Importa
</button>
<a href="<?php echo e(route('gruppi.index')); ?>" class="btn btn-secondary ml-2">
Annulla
</a>
</form>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card">
<div class="card-header bg-info">
<h3 class="card-title text-white"><i class="fas fa-download mr-2"></i>Template</h3>
</div>
<div class="card-body">
<p>Scarica il template CSV per l'importazione:</p>
<a href="<?php echo e(route('gruppi.template')); ?>" class="btn btn-success btn-block">
<i class="fas fa-file-csv mr-1"></i> Scarica Template
</a>
</div>
</div>
<div class="card mt-3">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-info-circle mr-2"></i>Formato CSV</h3>
</div>
<div class="card-body">
<h6>Campi:</h6>
<ul>
<li><code>nome</code> (obbligatorio)</li>
<li><code>descrizione</code></li>
<li><code>parent_id</code> (ID del gruppo padre)</li>
<li><code>diocesi_id</code> (ID della diocesi)</li>
<li><code>indirizzo_incontro</code></li>
<li><code>cap_incontro</code></li>
<li><code>città_incontro</code></li>
<li><code>sigla_provincia_incontro</code> (2 lettere)</li>
</ul>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/gruppi/import.blade.php ENDPATH**/ ?>
@@ -1,371 +0,0 @@
<?php $__env->startSection('title', 'Email - ' . ucfirst($folder)); ?>
<?php $__env->startSection('page_title', 'Email'); ?>
<?php
$currentFolder = $folders->firstWhere('type', $folder);
?>
<?php $__env->startSection('content'); ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-envelope mr-2"></i>Email</h3>
<div class="card-tools">
<div class="btn-group mr-2">
<?php $__currentLoopData = $folders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<a href="<?php echo e(route('email.index', $f->type)); ?>"
class="btn btn-xs <?php echo e($folder === $f->type ? 'btn-primary' : 'btn-default'); ?>">
<i class="fas <?php echo e($f->icon); ?>"></i>
<?php echo e($f->name); ?>
<?php if($f->type === 'inbox' && $messages->where('is_read', false)->count() > 0): ?>
<span class="badge badge-light"><?php echo e($messages->where('is_read', false)->count()); ?></span>
<?php endif; ?>
</a>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<a href="<?php echo e(route('email.compose')); ?>" class="btn btn-success btn-xs">
<i class="fas fa-plus"></i> Nuova Email
</a>
<button class="btn btn-primary btn-xs" onclick="syncEmails()" id="syncBtn">
<i class="fas fa-sync"></i> Ricevi/Invia
</button>
</div>
</div>
<div class="card-body p-0">
<div class="card-header pb-0">
<div class="row align-items-center">
<div class="col-md-6">
<div class="form-inline">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="selectAll" onchange="toggleAll(this)">
<label class="custom-control-label" for="selectAll">Seleziona tutto</label>
</div>
<span class="ml-3 text-muted" id="selectedCount">0 selezionati</span>
</div>
</div>
<div class="col-md-6">
<div class="input-group input-group-sm float-right" style="width: 220px;">
<select class="form-control" id="bulkAction">
<option value="">Azioni di massa...</option>
<?php if($folder !== 'trash'): ?>
<option value="mark_read">Marca come letto</option>
<option value="mark_unread">Marca come non letto</option>
<option value="star">Aggiungi a preferiti</option>
<option value="unstar">Rimuovi da preferiti</option>
<option value="move_trash">Sposta nel cestino</option>
<?php else: ?>
<option value="empty_trash">Svuota cestino</option>
<?php endif; ?>
</select>
<div class="input-group-append">
<button class="btn btn-secondary" type="button" onclick="executeBulkAction()">Applica</button>
</div>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-striped">
<thead>
<tr>
<th style="width: 30px;"></th>
<th style="width: 30px;"></th>
<th style="width: 150px;">
<?php $sort = request('sort'); $dir = request('direction'); ?>
<?php if($folder === 'sent' || $folder === 'inviate'): ?>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'to_email', 'direction' => $sort === 'to_email' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Destinatario <?php echo $sort === 'to_email' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
<?php else: ?>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'from_email', 'direction' => $sort === 'from_email' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Mittente <?php echo $sort === 'from_email' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
<?php endif; ?>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'subject', 'direction' => $sort === 'subject' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Oggetto <?php echo $sort === 'subject' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
</th>
<th style="width: 120px;">
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'received_at', 'direction' => $sort === 'received_at' && $dir === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark text-decoration-none">
Data <?php echo $sort === 'received_at' ? ($dir === 'asc' ? '▲' : '▼') : ''; ?>
</a>
</th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr class="<?php echo e($message->is_read ? '' : 'font-weight-bold'); ?>">
<td style="width: 30px;" onclick="event.stopPropagation()">
<input type="checkbox" class="email-checkbox" value="<?php echo e($message->id); ?>" onchange="updateCount()">
</td>
<td style="width: 30px;" onclick="event.stopPropagation(); window.location='<?php echo e(route('email.show', [$folder, $message->id])); ?>'">
<?php if($message->is_starred): ?>
<i class="fas fa-star text-warning"></i>
<?php endif; ?>
</td>
<td onclick="window.location='<?php echo e(route('email.show', [$folder, $message->id])); ?>'">
<?php echo e($message->is_sent ? 'A: ' . $message->to_email : ($message->from_name ?: $message->from_email)); ?>
</td>
<td onclick="window.location='<?php echo e(route('email.show', [$folder, $message->id])); ?>'">
<?php echo e($message->subject ?? '(senza oggetto)'); ?>
</td>
<td>
<?php if($message->received_at): ?>
<?php echo e($message->received_at->format('d/m/Y')); ?>
<?php elseif($message->sent_at): ?>
<?php echo e($message->sent_at->format('d/m/Y')); ?>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td colspan="5" class="text-center text-muted py-4">
<i class="fas fa-inbox fa-2x mb-2"></i>
<p>Nessuna email</p>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<div class="card-footer d-flex justify-content-between align-items-center">
<div>
<form method="GET" class="form-inline" id="perPageForm">
<label class="mr-2 small">Righe per pagina:</label>
<select name="perPage" class="form-control form-control-sm" onchange="this.form.submit()" style="width: auto;">
<?php $__currentLoopData = [10, 20, 25, 50, 100]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($p); ?>" <?php echo e((int) request('perPage', 20) === $p ? 'selected' : ''); ?>><?php echo e($p); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<?php $__currentLoopData = request()->except(['perPage', 'page']); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_array($value)): ?>
<?php $__currentLoopData = $value; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<input type="hidden" name="<?php echo e($key); ?>[]" value="<?php echo e($v); ?>">
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<input type="hidden" name="<?php echo e($key); ?>" value="<?php echo e($value); ?>">
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</form>
</div>
<div>
<?php echo e($messages->links('vendor.pagination.simple-bootstrap-4')); ?>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('styles'); ?>
<style>
/* Bootstrap 4 Pagination override */
.pagination {
display: flex !important;
padding-left: 0;
list-style: none;
border-radius: 0.25rem;
margin: 0;
justify-content: center;
}
.page-item {
display: inline-block;
}
.page-link {
position: relative;
display: block;
padding: 0.5rem 0.75rem;
margin-left: -1px;
line-height: 1.25;
color: #007bff;
background-color: #fff;
border: 1px solid #dee2e6;
text-decoration: none;
font-size: 0.875rem;
}
.page-item.active .page-link {
z-index: 3;
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.page-item.disabled .page-link {
color: #6c757d;
pointer-events: none;
background-color: #fff;
border-color: #dee2e6;
}
.page-link:hover {
color: #0056b3;
background-color: #e9ecef;
border-color: #dee2e6;
}
/* Icons as text characters */
.pagination .page-link::before,
.pagination .page-link::after {
display: none;
}
</style>
<?php $__env->stopPush(); ?>
<?php if($syncInterval > 0 && $folder === 'inbox'): ?>
<?php $__env->startPush('scripts'); ?>
<script>
let syncInterval = <?php echo e($syncInterval * 60 * 1000); ?>;
let syncTimeout;
function autoSync() {
fetch('<?php echo e(url('email/sync/quick')); ?>', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Content-Type': 'application/json'
}
}).then(() => {
console.log('Auto sync completed');
}).catch(() => {
console.log('Auto sync failed');
});
}
function startAutoSync() {
if (syncInterval > 0) {
syncTimeout = setInterval(autoSync, syncInterval);
}
}
function stopAutoSync() {
if (syncTimeout) {
clearInterval(syncTimeout);
}
}
document.addEventListener('DOMContentLoaded', function() {
startAutoSync();
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
stopAutoSync();
} else {
startAutoSync();
}
});
});
</script>
<?php $__env->stopPush(); ?>
<?php endif; ?>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleAll(checkbox) {
const checkboxes = document.querySelectorAll('.email-checkbox');
checkboxes.forEach(function(cb) {
cb.checked = checkbox.checked;
});
updateCount();
}
function updateCount() {
const checkboxes = document.querySelectorAll('.email-checkbox:checked');
document.getElementById('selectedCount').textContent = checkboxes.length + ' selezionati';
}
function executeBulkAction() {
const select = document.getElementById('bulkAction');
const action = select.value;
if (!action) {
alert('Seleziona un\'azione');
return;
}
if (action === 'empty_trash') {
if (!confirm('Sei sicuro di voler svuotare il cestino? Questa azione non è reversibile.')) {
return;
}
}
const checkboxes = document.querySelectorAll('.email-checkbox:checked');
if (action !== 'empty_trash' && checkboxes.length === 0) {
alert('Seleziona almeno una email');
return;
}
let ids = [];
if (action !== 'empty_trash') {
ids = Array.from(checkboxes).map(function(cb) {
return cb.value;
});
}
fetch('<?php echo e(route('email.bulk')); ?>', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ ids: ids, action: action })
}).then(function(response) {
return response.json();
}).then(function(data) {
if (data.success) {
// Reset checkboxes before reload to avoid ghost selection
document.querySelectorAll('.email-checkbox').forEach(function(cb) {
cb.checked = false;
});
document.getElementById('selectAll').checked = false;
updateCount();
window.location.href = window.location.href;
} else {
alert(data.message || 'Errore');
}
}).catch(function() {
alert('Errore');
});
}
function syncEmails() {
const btn = document.getElementById('syncBtn');
btn.disabled = true;
btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Sincronizzazione...';
fetch('<?php echo e(url('email/sync/quick')); ?>', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>',
'Content-Type': 'application/json'
}
}).then(function(response) {
return response.json();
}).then(function(data) {
if (data.success) {
location.reload();
} else {
alert(data.message || 'Errore durante la sincronizzazione');
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-sync"></i> Ricevi/Invia';
}
}).catch(function(error) {
alert('Errore di connessione');
btn.disabled = false;
btn.innerHTML = '<i class="fas fa-sync"></i> Ricevi/Invia';
});
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/email/index.blade.php ENDPATH**/ ?>
@@ -1,441 +0,0 @@
<?php $__env->startSection('title', 'Gruppi'); ?>
<?php $__env->startSection('page_title', 'Elenco Gruppi'); ?>
<?php
$canWriteGruppi = Auth::user()->canManage('gruppi');
$canDeleteGruppi = Auth::user()->canDelete('gruppi');
$columnLabels = [
'nome' => 'Nome',
'descrizione' => 'Descrizione',
'diocesi' => 'Diocesi',
'livello' => 'Livello',
'padre' => 'Gruppo Padre',
'membri' => 'Membri',
'responsabili' => 'Responsabili',
'indirizzo' => 'Indirizzo',
'citta' => 'Città',
'telefono' => 'Telefono',
'email' => 'Email',
];
$vistaDefaultJson = $vista ? $vista->toJson() : 'null';
$allColumnsJson = json_encode($allColumns);
$visibleColumnsJson = json_encode($visibleColumns);
?>
<?php $__env->startSection('content'); ?>
<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('success')); ?>
</div>
<?php endif; ?>
<?php if(session('error')): ?>
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('error')); ?>
</div>
<?php endif; ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-sitemap mr-2"></i>Elenco Gruppi</h3>
<div class="card-tools">
<div class="btn-group mr-2">
<button type="button" class="btn btn-sm btn-outline-primary <?php echo e($viewMode === 'table' ? 'active' : ''); ?>" onclick="switchView('table')" id="btn-table-view">
<i class="fas fa-table mr-1"></i> Tabella
</button>
<button type="button" class="btn btn-sm btn-outline-primary <?php echo e($viewMode === 'tree' ? 'active' : ''); ?>" onclick="switchView('tree')" id="btn-tree-view">
<i class="fas fa-sitemap mr-1"></i> Albero
</button>
</div>
<button type="button" class="btn btn-primary btn-sm mr-1" onclick="showSaveVistaModal()">
<i class="fas fa-save mr-1"></i> Salva Vista
</button>
<?php if($canWriteGruppi): ?>
<a href="<?php echo e(route('gruppi.import')); ?>" class="btn btn-warning btn-sm mr-1">
<i class="fas fa-file-import mr-1"></i> Importa
</a>
<a href="<?php echo e(route('gruppi.create')); ?>" class="btn btn-success btn-sm">
<i class="fas fa-plus"></i> Nuovo Gruppo
</a>
<?php endif; ?>
</div>
</div>
<?php if($viewMode === 'table'): ?>
<div class="card-body p-0">
<table class="table table-bordered table-hover table-striped mb-0" id="gruppi-table">
<thead class="thead-light">
<tr>
<?php if(in_array('nome', $visibleColumns)): ?>
<th data-sortable="true" onclick="sortTable('nome')" style="cursor:pointer;">Nome <i class="fas fa-sort float-right text-muted"></i></th>
<?php endif; ?>
<?php if(in_array('descrizione', $visibleColumns)): ?>
<th data-sortable="true" onclick="sortTable('descrizione')" style="cursor:pointer;">Descrizione <i class="fas fa-sort float-right text-muted"></i></th>
<?php endif; ?>
<?php if(in_array('diocesi', $visibleColumns)): ?>
<th>Diocesi</th>
<?php endif; ?>
<?php if(in_array('livello', $visibleColumns)): ?>
<th style="width: 80px;">Livello</th>
<?php endif; ?>
<?php if(in_array('padre', $visibleColumns)): ?>
<th>Gruppo Padre</th>
<?php endif; ?>
<?php if(in_array('membri', $visibleColumns)): ?>
<th style="width: 100px;">Membri</th>
<?php endif; ?>
<?php if(in_array('responsabili', $visibleColumns)): ?>
<th>Responsabili</th>
<?php endif; ?>
<?php if(in_array('indirizzo', $visibleColumns)): ?>
<th>Indirizzo</th>
<?php endif; ?>
<?php if(in_array('citta', $visibleColumns)): ?>
<th>Città</th>
<?php endif; ?>
<?php if(in_array('telefono', $visibleColumns)): ?>
<th>Telefono</th>
<?php endif; ?>
<?php if(in_array('email', $visibleColumns)): ?>
<th>Email</th>
<?php endif; ?>
<th style="width: 120px;">Azioni</th>
</tr>
</thead>
<tbody id="table-body">
<?php $__currentLoopData = $gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr data-id="<?php echo e($gruppo->id); ?>">
<?php if(in_array('nome', $visibleColumns)): ?>
<td>
<span style="padding-left: <?php echo e(($gruppo->depth ?? 0) * 20); ?>px;">
<i class="fas fa-<?php echo e($gruppo->children->count() > 0 ? 'folder' : 'folder-open'); ?> text-<?php echo e(($gruppo->depth ?? 0) == 0 ? 'warning' : 'secondary'); ?> mr-1"></i>
<a href="<?php echo e(route('gruppi.show', $gruppo->id)); ?>"><?php echo e($gruppo->nome); ?></a>
</span>
</td>
<?php endif; ?>
<?php if(in_array('descrizione', $visibleColumns)): ?>
<td><?php echo e(Str::limit($gruppo->descrizione, 50) ?: '-'); ?></td>
<?php endif; ?>
<?php if(in_array('diocesi', $visibleColumns)): ?>
<td><?php echo e($gruppo->diocesi?->nome ?? '-'); ?></td>
<?php endif; ?>
<?php if(in_array('livello', $visibleColumns)): ?>
<td><span class="badge badge-<?php echo e(($gruppo->depth ?? 0) == 0 ? 'primary' : 'secondary'); ?>"><?php echo e($gruppo->depth ?? 0); ?></span></td>
<?php endif; ?>
<?php if(in_array('padre', $visibleColumns)): ?>
<td><?php echo e($gruppo->parent?->nome ?? '-'); ?></td>
<?php endif; ?>
<?php if(in_array('membri', $visibleColumns)): ?>
<td><span class="badge badge-info"><?php echo e($gruppo->individui->count()); ?></span></td>
<?php endif; ?>
<?php if(in_array('responsabili', $visibleColumns)): ?>
<td>
<?php $resp = $gruppo->getResponsabili() ?>
<?php if($resp->count() > 0): ?>
<?php echo e($resp->pluck('cognome')->implode(', ')); ?>
<?php else: ?>
-
<?php endif; ?>
</td>
<?php endif; ?>
<?php if(in_array('indirizzo', $visibleColumns)): ?>
<td><?php echo e($gruppo->indirizzo_incontro ?: '-'); ?></td>
<?php endif; ?>
<?php if(in_array('citta', $visibleColumns)): ?>
<td><?php echo e($gruppo->città_incontro ?: '-'); ?></td>
<?php endif; ?>
<?php if(in_array('telefono', $visibleColumns)): ?>
<td>-</td>
<?php endif; ?>
<?php if(in_array('email', $visibleColumns)): ?>
<td>-</td>
<?php endif; ?>
<td>
<a href="<?php echo e(route('gruppi.show', $gruppo->id)); ?>" class="btn btn-xs btn-info" title="Visualizza">
<i class="fas fa-eye"></i>
</a>
<?php if($canWriteGruppi): ?>
<a href="<?php echo e(url('/gruppi/' . $gruppo->id . '/edit')); ?>" class="btn btn-xs btn-warning" title="Modifica">
<i class="fas fa-edit"></i>
</a>
<?php endif; ?>
<?php if($canDeleteGruppi): ?>
<form action="<?php echo e(url('/gruppi/' . $gruppo->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Confermi l\'eliminazione?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<?php else: ?>
<div class="card-body p-0">
<div class="tree-view" style="padding: 15px;">
<?php $rootGruppi = $gruppi->filter(fn($g) => $g->parent_id === null) ?>
<?php $__empty_1 = true; $__currentLoopData = $rootGruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<?php echo $__env->make('gruppi.partials.tree-item', ['gruppo' => $gruppo, 'isRoot' => true], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<div class="text-center text-muted py-4">
<i class="fas fa-folder-open fa-2x mb-2"></i>
<p>Nessun gruppo presente.
<?php if($canWriteGruppi): ?>
<a href="<?php echo e(route('gruppi.create')); ?>">Crea il primo gruppo</a>
<?php endif; ?>
</p>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="modal fade" id="saveVistaModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-save mr-2"></i>Salva Vista</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Nome Vista *</label>
<input type="text" id="vista-nome" class="form-control" placeholder="Es. Elenco gruppi attivi">
</div>
<div class="form-group">
<label>Colonne visibili</label>
<div class="row" id="colonne-checkboxes">
<?php $__currentLoopData = $allColumns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $col): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="col-md-4 mb-2">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input col-checkbox" id="col-<?php echo e($col); ?>" value="<?php echo e($col); ?>" <?php echo e(in_array($col, $visibleColumns) ? 'checked' : ''); ?>>
<label class="custom-control-label" for="col-<?php echo e($col); ?>"><?php echo e($columnLabels[$col] ?? $col); ?></label>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="vista-default">
<label class="custom-control-label" for="vista-default">Imposta come vista predefinita</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-primary" onclick="saveVista()">
<i class="fas fa-save mr-1"></i> Salva
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="vistaListModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-bookmark mr-2"></i>Viste Salvate</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<?php
$visteSalvate = \App\Models\VistaReport::where('user_id', Auth::id())
->where('tipo', 'gruppi')
->orderBy('is_default', 'desc')
->orderBy('nome')
->get();
?>
<?php if($visteSalvate->count() > 0): ?>
<div class="list-group">
<?php $__currentLoopData = $visteSalvate; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="list-group-item d-flex justify-content-between align-items-center">
<div>
<a href="?vista_id=<?php echo e($v->id); ?>"><?php echo e($v->nome); ?></a>
<?php if($v->is_default): ?>
<span class="badge badge-success ml-1">Predefinita</span>
<?php endif; ?>
</div>
<form action="<?php echo e(route('gruppi.delete-vista', $v->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questa vista?')">
<i class="fas fa-trash"></i>
</button>
</form>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<?php else: ?>
<p class="text-muted text-center">Nessuna vista salvata</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function switchView(mode) {
window.location.href = '?view=' + mode;
}
function toggleItem(id) {
const el = document.getElementById('group-' + id);
const icon = document.getElementById('icon-' + id);
if (el.style.display === 'none') {
el.style.display = 'block';
icon.classList.remove('fa-chevron-right');
icon.classList.add('fa-chevron-down');
} else {
el.style.display = 'none';
icon.classList.remove('fa-chevron-down');
icon.classList.add('fa-chevron-right');
}
}
function toggleAllGroups() {
const collapsed = document.querySelectorAll('.tree-children[style*="display: none"]').length > 0;
document.querySelectorAll('.tree-children').forEach(el => {
el.style.display = collapsed ? 'block' : 'none';
});
document.querySelectorAll('.tree-toggle i').forEach(icon => {
if (collapsed) {
icon.classList.remove('fa-chevron-right');
icon.classList.add('fa-chevron-down');
} else {
icon.classList.remove('fa-chevron-down');
icon.classList.add('fa-chevron-right');
}
});
}
let sortDirection = {};
function sortTable(column) {
const tbody = document.getElementById('table-body');
const rows = Array.from(tbody.querySelectorAll('tr'));
sortDirection[column] = sortDirection[column] === 'asc' ? 'desc' : 'asc';
const dir = sortDirection[column];
rows.sort(function(a, b) {
const cellA = a.querySelector(`td:nth-child(${getColumnIndex(column)})`)?.textContent.trim() || '';
const cellB = b.querySelector(`td:nth-child(${getColumnIndex(column)})`)?.textContent.trim() || '';
if (dir === 'asc') {
return cellA.localeCompare(cellB, 'it');
}
return cellB.localeCompare(cellA, 'it');
});
rows.forEach(row => tbody.appendChild(row));
document.querySelectorAll('th i.fa-sort').forEach(icon => {
icon.className = 'fas fa-sort float-right text-muted';
});
const th = document.querySelector(`th[data-sortable][onclick="sortTable('${column}')"] i`);
if (th) {
th.className = `fas fa-sort-${dir === 'asc' ? 'up' : 'down'} float-right`;
}
}
function getColumnIndex(column) {
const th = document.querySelector(`th[onclick="sortTable('${column}')"]`);
if (th) {
return Array.from(th.parentNode.children).indexOf(th) + 1;
}
return 1;
}
function showSaveVistaModal() {
document.getElementById('vista-nome').value = '';
document.getElementById('vista-default').checked = false;
$('#saveVistaModal').modal('show');
}
function saveVista() {
const nome = document.getElementById('vista-nome').value.trim();
if (!nome) {
alert('Inserisci un nome per la vista');
return;
}
const colonneVisibili = Array.from(document.querySelectorAll('.col-checkbox:checked')).map(cb => cb.value);
const isDefault = document.getElementById('vista-default').checked;
fetch('/gruppi/save-vista', {
method: 'POST',
headers: {
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({
nome: nome,
colonne_visibili: colonneVisibili,
is_default: isDefault,
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
$('#saveVistaModal').modal('hide');
window.location.reload();
} else {
alert('Errore nel salvataggio della vista');
}
})
.catch(error => {
alert('Errore: ' + error.message);
});
}
</script>
<style>
.tree-item { margin-bottom: 5px; }
.tree-children {
margin-left: 25px;
border-left: 1px dashed #dee2e6;
padding-left: 10px;
}
.tree-toggle {
cursor: pointer;
padding: 3px 8px;
border-radius: 4px;
}
.tree-toggle:hover {
background-color: #f8f9fa;
}
.tree-label {
display: inline-flex;
align-items: center;
gap: 8px;
}
.badge-level {
font-size: 0.7em;
padding: 2px 5px;
}
.btn-group .btn.active {
background-color: #007bff;
color: white;
border-color: #007bff;
}
</style>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/gruppi/index.blade.php ENDPATH**/ ?>
@@ -1,44 +0,0 @@
<?php if($paginator->hasPages()): ?>
<ul class="pagination justify-content-center" role="navigation">
<?php if($paginator->onFirstPage()): ?>
<li class="page-item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">
<span class="page-link" aria-hidden="true">&lsaquo;</span>
</li>
<?php else: ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" aria-label="<?php echo app('translator')->get('pagination.previous'); ?>">&lsaquo;</a>
</li>
<?php endif; ?>
<?php $__currentLoopData = $elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_string($element)): ?>
<li class="page-item disabled" aria-disabled="true"><span class="page-link"><?php echo e($element); ?></span></li>
<?php endif; ?>
<?php if(is_array($element)): ?>
<?php $__currentLoopData = $element; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($page == $paginator->currentPage()): ?>
<li class="page-item active" aria-current="page"><span class="page-link"><?php echo e($page); ?></span></li>
<?php elseif($page >= $paginator->currentPage() - 2 && $page <= $paginator->currentPage() + 2): ?>
<li class="page-item"><a class="page-link" href="<?php echo e($url); ?>"><?php echo e($page); ?></a></li>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php if($paginator->hasMorePages()): ?>
<li class="page-item">
<a class="page-link" href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">&rsaquo;</a>
</li>
<?php else: ?>
<li class="page-item disabled" aria-disabled="true" aria-label="<?php echo app('translator')->get('pagination.next'); ?>">
<span class="page-link" aria-hidden="true">&rsaquo;</span>
</li>
<?php endif; ?>
</ul>
<?php endif; ?><?php /**PATH /var/www/html/glastree/resources/views/vendor/pagination/simple-bootstrap-4.blade.php ENDPATH**/ ?>
@@ -1,103 +0,0 @@
<?php $__env->startSection('title', 'Calendario Eventi'); ?>
<?php $__env->startSection('page_title', 'Calendario Eventi'); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
<div class="col-12">
<div class="card card-primary">
<div class="card-header">
<h3 class="card-title">
<i class="fas fa-calendar-alt mr-2"></i>Calendario Eventi
</h3>
<div class="card-tools">
<a href="<?php echo e(route('eventi.index')); ?>" class="btn btn-secondary btn-sm">
<i class="fas fa-list mr-1"></i> Elenco Eventi
</a>
<a href="<?php echo e(route('eventi.create')); ?>" class="btn btn-success btn-sm">
<i class="fas fa-plus mr-1"></i> Nuovo Evento
</a>
<form action="<?php echo e(route('eventi.export-selected-ics')); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?>
<button type="submit" class="btn btn-success btn-sm">
<i class="fas fa-calendar-plus mr-1"></i> Esporta ICS
</button>
</form>
</div>
</div>
<div class="card-body">
<div id="calendar"></div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.10/index.global.min.css">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.10/index.global.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth',
locale: 'it',
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,listWeek'
},
buttonText: {
today: 'Oggi',
month: 'Mese',
week: 'Settimana',
list: 'Lista'
},
eventSources: [
{
url: '/eventi/calendar/events',
method: 'GET',
extraParams: function() {
return {
_token: document.querySelector('meta[name="csrf-token"]')?.content || ''
};
},
startParam: 'start',
endParam: 'end',
success: function(response) {
console.log('Eventi caricati:', response.length, response);
},
failure: function(error) {
console.error('Errore:', error);
console.log('XHR:', error.xhr);
alert('Errore nel caricamento degli eventi. Controlla la console per dettagli.');
}
}
],
eventClick: function(info) {
info.jsEvent.preventDefault();
window.location.href = info.event.url;
},
eventDisplay: 'block',
displayEventTime: true,
displayEventEnd: true,
nowIndicator: true,
height: 'auto',
expandRows: true,
stickyHeaderDates: true,
dayMaxEvents: true,
eventTimeFormat: {
hour: '2-digit',
minute: '2-digit',
hour12: false
}
});
calendar.render();
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/eventi/calendar.blade.php ENDPATH**/ ?>
@@ -1,373 +0,0 @@
<?php $__env->startSection('title', 'Eventi'); ?>
<?php $__env->startSection('page_title', 'Eventi'); ?>
<?php
$canWriteEventi = Auth::user()->canManage('eventi');
$canDeleteEventi = Auth::user()->canDelete('eventi');
?>
<?php $__env->startSection('content'); ?>
<?php if(session('success')): ?>
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo e(session('success')); ?>
</div>
<?php endif; ?>
<div class="card">
<div class="card-header">
<h3 class="card-title">Tutti gli Eventi</h3>
<div class="card-tools">
<a href="/eventi/calendar" class="btn btn-sm btn-outline-primary mr-2">
<i class="fas fa-calendar-alt mr-1"></i> Calendario
</a>
<button type="button" class="btn btn-sm btn-success mr-2" onclick="exportSelectedIcs()">
<i class="fas fa-calendar-plus mr-1"></i> Esporta ICS
</button>
<?php if($canDeleteEventi): ?>
<div class="btn-group mr-2">
<button type="button" class="btn btn-sm btn-danger" onclick="deleteSelected()">
<i class="fas fa-trash mr-1"></i> Elimina Selezionati
</button>
</div>
<?php endif; ?>
<?php if($canWriteEventi): ?>
<a href="/eventi/import" class="btn btn-sm btn-warning mr-2">
<i class="fas fa-file-import mr-1"></i> Importa ICS
</a>
<a href="/eventi/create" class="btn btn-xs btn-success">
<i class="fas fa-plus mr-1"></i> Nuovo Evento
</a>
<?php endif; ?>
</div>
</div>
<div class="card-body">
<form method="GET" class="mb-3">
<div class="row">
<div class="col-md-3">
<input type="text" name="search" class="form-control" placeholder="Cerca evento..." value="<?php echo e(request('search')); ?>">
</div>
<div class="col-md-3">
<select name="gruppo_id" class="form-control" onchange="this.form.submit()">
<option value="">Tutti i gruppi</option>
<?php $__currentLoopData = $gruppi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $g): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($g->id); ?>" <?php echo e(request('gruppo_id') == $g->id ? 'selected' : ''); ?>><?php echo e($g->full_path); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-md-2">
<select name="tipo" class="form-control" onchange="this.form.submit()">
<option value="">Tutte le ricorrenze</option>
<option value="singolo" <?php echo e(request('tipo') == 'singolo' ? 'selected' : ''); ?>>Singolo</option>
<option value="settimanale" <?php echo e(request('tipo') == 'settimanale' ? 'selected' : ''); ?>>Settimanale</option>
<option value="mensile" <?php echo e(request('tipo') == 'mensile' ? 'selected' : ''); ?>>Mensile</option>
<option value="annuale" <?php echo e(request('tipo') == 'annuale' ? 'selected' : ''); ?>>Annuale</option>
</select>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><i class="fas fa-search mr-1"></i> Cerca</button>
<a href="/eventi" class="btn btn-secondary"><i class="fas fa-times"></i></a>
</div>
</div>
</form>
<table class="table table-bordered table-hover">
<thead class="thead-light">
<tr>
<th style="width: 40px;">
<?php if($canDeleteEventi): ?>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="select-all" onchange="toggleSelectAll(this)">
<label class="custom-control-label" for="select-all"></label>
</div>
<?php endif; ?>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'nome_evento', 'direction' => request('sort') === 'nome_evento' && request('direction') === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark">
Nome Evento
<?php if(request('sort') === 'nome_evento'): ?>
<i class="fas fa-sort-<?php echo e(request('direction') === 'asc' ? 'up' : 'down'); ?> ml-1"></i>
<?php else: ?>
<i class="fas fa-sort ml-1 text-muted"></i>
<?php endif; ?>
</a>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'descrizione_evento', 'direction' => request('sort') === 'descrizione_evento' && request('direction') === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark">
Descrizione
<?php if(request('sort') === 'descrizione_evento'): ?>
<i class="fas fa-sort-<?php echo e(request('direction') === 'asc' ? 'up' : 'down'); ?> ml-1"></i>
<?php else: ?>
<i class="fas fa-sort ml-1 text-muted"></i>
<?php endif; ?>
</a>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'tipo_evento', 'direction' => request('sort') === 'tipo_evento' && request('direction') === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark">
Tipologia
<?php if(request('sort') === 'tipo_evento'): ?>
<i class="fas fa-sort-<?php echo e(request('direction') === 'asc' ? 'up' : 'down'); ?> ml-1"></i>
<?php else: ?>
<i class="fas fa-sort ml-1 text-muted"></i>
<?php endif; ?>
</a>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'tipo_recorrenza', 'direction' => request('sort') === 'tipo_recorrenza' && request('direction') === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark">
Ricorrenza
<?php if(request('sort') === 'tipo_recorrenza'): ?>
<i class="fas fa-sort-<?php echo e(request('direction') === 'asc' ? 'up' : 'down'); ?> ml-1"></i>
<?php else: ?>
<i class="fas fa-sort ml-1 text-muted"></i>
<?php endif; ?>
</a>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'gruppi', 'direction' => request('sort') === 'gruppi' && request('direction') === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark">
Gruppi
<?php if(request('sort') === 'gruppi'): ?>
<i class="fas fa-sort-<?php echo e(request('direction') === 'asc' ? 'up' : 'down'); ?> ml-1"></i>
<?php else: ?>
<i class="fas fa-sort ml-1 text-muted"></i>
<?php endif; ?>
</a>
</th>
<th>
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'responsabili', 'direction' => request('sort') === 'responsabili' && request('direction') === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark">
Responsabili
<?php if(request('sort') === 'responsabili'): ?>
<i class="fas fa-sort-<?php echo e(request('direction') === 'asc' ? 'up' : 'down'); ?> ml-1"></i>
<?php else: ?>
<i class="fas fa-sort ml-1 text-muted"></i>
<?php endif; ?>
</a>
</th>
<th style="width: 120px;">
<a href="<?php echo e(request()->fullUrlWithQuery(['sort' => 'created_at', 'direction' => request('sort') === 'created_at' && request('direction') === 'asc' ? 'desc' : 'asc'])); ?>" class="text-dark">
Creato
<?php if(request('sort') === 'created_at'): ?>
<i class="fas fa-sort-<?php echo e(request('direction') === 'asc' ? 'up' : 'down'); ?> ml-1"></i>
<?php else: ?>
<i class="fas fa-sort ml-1 text-muted"></i>
<?php endif; ?>
</a>
</th>
<th style="width: 120px;">Azioni</th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $eventi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $evento): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr data-id="<?php echo e($evento->id); ?>">
<td>
<?php if($canDeleteEventi): ?>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input row-checkbox" id="row-checkbox-<?php echo e($evento->id); ?>" value="<?php echo e($evento->id); ?>">
<label class="custom-control-label" for="row-checkbox-<?php echo e($evento->id); ?>"></label>
</div>
<?php endif; ?>
</td>
<td>
<a href="/eventi/<?php echo e($evento->id); ?>">
<i class="fas fa-calendar mr-1 text-primary"></i>
<?php echo e($evento->nome_evento); ?>
</a>
<?php if($evento->is_incontro_gruppo): ?>
<span class="badge badge-success ml-1">Incluso</span>
<?php endif; ?>
</td>
<td><?php echo e(Str::limit($evento->descrizione_evento, 50) ?: '-'); ?></td>
<td>
<?php if($evento->tipo_evento): ?>
<?php
$tipologiaEvento = \App\Models\TipologiaEvento::where('nome', $evento->tipo_evento)->first();
?>
<?php if($tipologiaEvento): ?>
<span class="badge badge-primary"><?php echo e($tipologiaEvento->descrizione ?: $tipologiaEvento->nome); ?></span>
<?php else: ?>
<span class="badge badge-secondary"><?php echo e($evento->tipo_evento); ?></span>
<?php endif; ?>
<?php else: ?>
<span class="text-muted">-</span>
<?php endif; ?>
</td>
<td>
<?php if($evento->tipo_recorrenza && $evento->tipo_recorrenza !== 'singolo'): ?>
<span class="badge badge-info"><?php echo e($evento->periodicita_label); ?></span>
<?php else: ?>
<span class="badge badge-secondary">Singolo</span>
<?php endif; ?>
</td>
<td>
<?php $__empty_2 = true; $__currentLoopData = $evento->gruppi->take(2); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $gruppo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_2 = false; ?>
<a href="/gruppi/<?php echo e($gruppo->id); ?>">
<span class="badge badge-warning"><?php echo e($gruppo->nome); ?></span>
</a>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_2): ?>
<span class="text-muted">-</span>
<?php endif; ?>
<?php if($evento->gruppi->count() > 2): ?>
<small class="text-muted">+<?php echo e($evento->gruppi->count() - 2); ?></small>
<?php endif; ?>
</td>
<td>
<?php $__empty_2 = true; $__currentLoopData = $evento->responsabili->take(2); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $resp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_2 = false; ?>
<small><?php echo e($resp->nome_completo); ?></small><br>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_2): ?>
<span class="text-muted">-</span>
<?php endif; ?>
<?php if($evento->responsabili->count() > 2): ?>
<small class="text-muted">+<?php echo e($evento->responsabili->count() - 2); ?> altri</small>
<?php endif; ?>
</td>
<td><small class="text-muted"><?php echo e($evento->created_at->format('d/m/Y')); ?></small></td>
<td>
<a href="<?php echo e(url('/eventi/' . $evento->id)); ?>" class="btn btn-xs btn-info" title="Visualizza">
<i class="fas fa-eye"></i>
</a>
<?php if($canWriteEventi): ?>
<a href="<?php echo e(url('/eventi/' . $evento->id . '/edit')); ?>" class="btn btn-xs btn-warning" title="Modifica">
<i class="fas fa-edit"></i>
</a>
<form action="<?php echo e(url('/eventi/' . $evento->id)); ?>" method="POST" class="d-inline">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Confermi l\'eliminazione?')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
</form>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td colspan="9" class="text-center text-muted py-4">
<i class="fas fa-calendar fa-2x mb-2"></i>
<p class="mb-0">Nessun evento trovato</p>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<div class="card-footer d-flex justify-content-between align-items-center">
<div>
<form method="GET" class="form-inline" id="perPageForm">
<label class="mr-2 small">Righe per pagina:</label>
<select name="perPage" class="form-control form-control-sm" onchange="this.form.submit()" style="width: auto;">
<?php $__currentLoopData = [10, 20, 25, 50, 100]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($p); ?>" <?php echo e((int) request('perPage', 20) === $p ? 'selected' : ''); ?>><?php echo e($p); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<?php $__currentLoopData = request()->except(['perPage', 'page']); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_array($value)): ?>
<?php $__currentLoopData = $value; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<input type="hidden" name="<?php echo e($key); ?>[]" value="<?php echo e($v); ?>">
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<input type="hidden" name="<?php echo e($key); ?>" value="<?php echo e($value); ?>">
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</form>
</div>
<div>
<?php echo e($eventi->links()); ?>
</div>
</div>
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog">
<?php if($canDeleteEventi): ?>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header bg-danger">
<h5 class="modal-title text-white"><i class="fas fa-trash-alt mr-2"></i>Conferma Eliminazione</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<p>Stai per eliminare <strong id="delete-count">0</strong> eventi selezionati.</p>
<p class="text-muted small">Verranno eliminati anche i collegamenti con gruppi e responsabili.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-danger" onclick="confirmDelete()">Elimina</button>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
function toggleSelectAll(source) {
document.querySelectorAll('.row-checkbox').forEach(cb => cb.checked = source.checked);
}
function getSelectedIds() {
return Array.from(document.querySelectorAll('.row-checkbox:checked')).map(cb => cb.value);
}
function deleteSelected() {
const selectedIds = getSelectedIds();
if (selectedIds.length === 0) {
alert('Seleziona almeno un evento');
return;
}
document.getElementById('delete-count').textContent = selectedIds.length;
document.querySelector('#deleteModal .btn-danger').onclick = function() {
const form = document.createElement('form');
form.method = 'POST';
form.action = '/eventi/mass-elimina';
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '<?php echo e(csrf_token()); ?>';
let html = `<input type="hidden" name="_token" value="${csrfToken}">`;
selectedIds.forEach(function(id) {
html += `<input type="hidden" name="ids[]" value="${id}">`;
});
form.innerHTML = html;
document.body.appendChild(form);
form.submit();
};
$('#deleteModal').modal('show');
}
function exportSelectedIcs() {
const selectedIds = getSelectedIds();
const form = document.createElement('form');
form.method = 'POST';
form.action = '/eventi/export-ics';
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '<?php echo e(csrf_token()); ?>';
let html = `<input type="hidden" name="_token" value="${csrfToken}">`;
if (selectedIds.length > 0) {
selectedIds.forEach(function(id) {
html += `<input type="hidden" name="ids[]" value="${id}">`;
});
} else {
const params = new URLSearchParams(window.location.search);
params.forEach(function(value, key) {
if (key === 'search') html += `<input type="hidden" name="search" value="${value}">`;
if (key === 'gruppo_id') html += `<input type="hidden" name="gruppo_id" value="${value}">`;
if (key === 'tipo') html += `<input type="hidden" name="tipo" value="${value}">`;
});
}
form.innerHTML = html;
document.body.appendChild(form);
form.submit();
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/eventi/index.blade.php ENDPATH**/ ?>
@@ -1,943 +0,0 @@
<?php $__env->startSection('title', 'Individui'); ?>
<?php $__env->startSection('page_title', 'Elenco Individui'); ?>
<?php
$columnLabels = [
'codice' => 'Codice',
'cognome' => 'Cognome',
'nome' => 'Nome',
'email' => 'Email',
'telefono' => 'Telefono',
];
$vistaDefaultJson = $vista ? $vista->toJson() : 'null';
$allColumnsJson = json_encode($allColumns);
$visibleColumnsJson = json_encode($visibleColumns);
$canWriteIndividui = Auth::user()->canManage('individui');
$canDeleteIndividui = Auth::user()->canDelete('individui');
?>
<?php $__env->startSection('content'); ?>
<div class="card">
<div class="card-header">
<h3 class="card-title"><i class="fas fa-users mr-2"></i>Lista Individui</h3>
<div class="card-tools">
<button type="button" class="btn btn-info btn-sm mr-1" onclick="toggleSearchPanel()">
<i class="fas fa-search mr-1"></i> Ricerca/Filtri
</button>
<div class="btn-group mr-1">
<button type="button" class="btn btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-cog mr-1"></i> Azioni
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" onclick="exportCSV(); return false;">
<i class="fas fa-file-csv mr-2"></i>Esporta Tutti CSV
</a>
<a class="dropdown-item" href="#" onclick="exportSelectedCSV(); return false;">
<i class="fas fa-file-csv mr-2"></i>Esporta Selezionati CSV
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" onclick="printSelected(); return false;">
<i class="fas fa-print mr-2"></i>Stampa Selezionati
</a>
<a class="dropdown-item" href="#" onclick="emailSelected(); return false;">
<i class="fas fa-envelope mr-2"></i>Email Selezionati
</a>
<?php if($canWriteIndividui): ?>
<a class="dropdown-item" href="#" onclick="showCreateMailingListModal(); return false;">
<i class="fas fa-list mr-2"></i>Crea Mailing List
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger" href="#" onclick="deleteSelected(); return false;">
<i class="fas fa-trash mr-2"></i>Elimina Selezionati
</a>
<?php endif; ?>
</div>
</div>
<button type="button" class="btn btn-primary btn-sm" onclick="showSaveVistaModal()">
<i class="fas fa-save mr-1"></i> Salva Vista
</button>
<?php if($canWriteIndividui): ?>
<a href="<?php echo e(route('individui.import')); ?>" class="btn btn-warning btn-sm ml-2">
<i class="fas fa-file-import mr-1"></i> Importa
</a>
<a href="/individui/create" class="btn btn-success btn-sm ml-2">
<i class="fas fa-plus mr-1"></i> Nuovo
</a>
<?php endif; ?>
</div>
</div>
<div id="search-panel" class="p-3 bg-light border-bottom" style="display: none;">
<div class="row">
<div class="col-md-4">
<div class="form-group mb-2">
<label class="small font-weight-bold">Cerca</label>
<input type="text" id="global-search" class="form-control form-control-sm" placeholder="Cerca in tutte le colonne..." oninput="applyGlobalSearch(this.value)">
</div>
</div>
<div class="col-md-3">
<div class="form-group mb-2">
<label class="small font-weight-bold">Colonna</label>
<select id="filter-column" class="form-control form-control-sm">
<option value="">Tutte le colonne</option>
<?php $__currentLoopData = $allColumns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $col): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($col['key']); ?>"><?php echo e($col['label']); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
</div>
<div class="col-md-2">
<div class="form-group mb-2">
<label class="small font-weight-bold">Operatore</label>
<select id="filter-operator" class="form-control form-control-sm">
<option value="contains">Contiene</option>
<option value="equals">Uguale a</option>
<option value="starts">Inizia con</option>
<option value="ends">Finisce con</option>
</select>
</div>
</div>
<div class="col-md-2">
<div class="form-group mb-2">
<label class="small font-weight-bold">Valore</label>
<input type="text" id="filter-value" class="form-control form-control-sm" placeholder="Valore filtro">
</div>
</div>
<div class="col-md-1">
<label class="small">&nbsp;</label>
<div>
<button type="button" class="btn btn-xs btn-primary" onclick="applyColumnFilter()">
<i class="fas fa-filter"></i>
</button>
<button type="button" class="btn btn-xs btn-secondary" onclick="clearFilters()">
<i class="fas fa-times"></i>
</button>
</div>
</div>
</div>
<div class="mt-2">
<small class="text-muted">
<i class="fas fa-info-circle mr-1"></i>
Ordina cliccando sulle intestazioni delle colonne
</small>
</div>
</div>
<div class="card-body p-0">
<?php if($individui->count() > 0): ?>
<table class="table table-bordered table-hover table-striped mb-0" id="individui-table">
<thead class="thead-light">
<tr>
<th style="width: 40px;">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="select-all" onchange="toggleSelectAll(this)">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<?php if(in_array('codice', $visibleColumns)): ?>
<th style="width: 100px;" data-sortable="true" data-column="codice" onclick="sortTable('codice')">Codice <i class="fas fa-sort float-right"></i></th>
<?php endif; ?>
<?php if(in_array('cognome', $visibleColumns)): ?>
<th data-sortable="true" data-column="cognome" onclick="sortTable('cognome')">Cognome <i class="fas fa-sort float-right"></i></th>
<?php endif; ?>
<?php if(in_array('nome', $visibleColumns)): ?>
<th data-sortable="true" data-column="nome" onclick="sortTable('nome')">Nome <i class="fas fa-sort float-right"></i></th>
<?php endif; ?>
<?php if(in_array('email', $visibleColumns)): ?>
<th data-sortable="true" data-column="email" onclick="sortTable('email')">Email <i class="fas fa-sort float-right"></i></th>
<?php endif; ?>
<?php if(in_array('telefono', $visibleColumns)): ?>
<th data-sortable="true" data-column="telefono" onclick="sortTable('telefono')">Telefono <i class="fas fa-sort float-right"></i></th>
<?php endif; ?>
<th style="width: 120px;">Azioni</th>
</tr>
</thead>
<tbody id="table-body">
<?php $__currentLoopData = $individui; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ind): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr data-id="<?php echo e($ind->id); ?>">
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input row-checkbox" id="select-<?php echo e($ind->id); ?>" value="<?php echo e($ind->id); ?>">
<label class="custom-control-label" for="select-<?php echo e($ind->id); ?>"></label>
</div>
</td>
<?php if(in_array('codice', $visibleColumns)): ?>
<td><span class="badge badge-secondary"><?php echo e($ind->codice_id); ?></span></td>
<?php endif; ?>
<?php if(in_array('cognome', $visibleColumns)): ?>
<td class="font-weight-bold">
<a href="<?php echo e(url('/individui/' . $ind->id . '/edit')); ?>"><?php echo e($ind->cognome); ?></a>
</td>
<?php endif; ?>
<?php if(in_array('nome', $visibleColumns)): ?>
<td>
<a href="<?php echo e(url('/individui/' . $ind->id . '/edit')); ?>"><?php echo e($ind->nome); ?></a>
</td>
<?php endif; ?>
<?php if(in_array('email', $visibleColumns)): ?>
<td><?php echo e($ind->getEmailPrimariaAttribute() ?: '-'); ?></td>
<?php endif; ?>
<?php if(in_array('telefono', $visibleColumns)): ?>
<td><?php echo e($ind->getTelefonoPrimarioAttribute() ?: '-'); ?></td>
<?php endif; ?>
<td>
<?php if($canWriteIndividui): ?>
<a href="<?php echo e(url('/individui/' . $ind->id . '/edit')); ?>" class="btn btn-xs btn-warning" title="Modifica">
<i class="fas fa-edit"></i>
</a>
<?php endif; ?>
<?php if($canDeleteIndividui): ?>
<button type="button" class="btn btn-xs btn-danger" onclick="showDeleteModal(<?php echo e($ind->id); ?>, '<?php echo e($ind->cognome); ?> <?php echo e($ind->nome); ?>')" title="Elimina">
<i class="fas fa-trash"></i>
</button>
<?php endif; ?>
<button type="button" class="btn btn-xs btn-secondary" onclick="printIndividuo(<?php echo e($ind->id); ?>)" title="Stampa">
<i class="fas fa-print"></i>
</button>
<button type="button" class="btn btn-xs btn-primary" onclick="exportIndividuoCSV(<?php echo e($ind->id); ?>)" title="Esporta CSV">
<i class="fas fa-download"></i>
</button>
<button type="button" class="btn btn-xs btn-info" onclick="sendEmail(<?php echo e($ind->id); ?>)" title="Invia Email">
<i class="fas fa-envelope"></i>
</button>
<button type="button" class="btn btn-xs btn-dark" onclick="generateReport(<?php echo e($ind->id); ?>)" title="Genera Report">
<i class="fas fa-chart-bar"></i>
</button>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
<?php else: ?>
<div class="text-center text-muted py-5">
<i class="fas fa-users fa-3x mb-3"></i>
<p>Nessun individuo presente</p>
<?php if($canWriteIndividui): ?>
<a href="/individui/create" class="btn btn-success">Crea il primo individuo</a>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php if($individui->count() > 0): ?>
<div class="card-footer d-flex justify-content-between align-items-center">
<div>
<form method="GET" class="form-inline" id="perPageForm">
<label class="mr-2 small">Righe per pagina:</label>
<select name="perPage" class="form-control form-control-sm" onchange="this.form.submit()" style="width: auto;">
<?php $__currentLoopData = [10, 20, 25, 50, 100]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($p); ?>" <?php echo e((int) request('perPage', 20) === $p ? 'selected' : ''); ?>><?php echo e($p); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<?php $__currentLoopData = request()->except(['perPage', 'page']); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(is_array($value)): ?>
<?php $__currentLoopData = $value; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<input type="hidden" name="<?php echo e($key); ?>[]" value="<?php echo e($v); ?>">
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php else: ?>
<input type="hidden" name="<?php echo e($key); ?>" value="<?php echo e($value); ?>">
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</form>
</div>
<div>
<?php echo e($individui->links()); ?>
</div>
</div>
<?php endif; ?>
</div>
<div class="modal fade" id="saveVistaModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-save mr-2"></i>Salva Vista</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Nome Vista *</label>
<input type="text" id="vista-nome" class="form-control" placeholder="Es. Elenco soci attivi">
</div>
<div class="form-group">
<label>Colonne visibili</label>
<div class="row" id="colonne-checkboxes">
<?php $__currentLoopData = $allColumns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $col): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="col-md-6">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input col-visibile" id="col-vis-<?php echo e($col['key']); ?>" value="<?php echo e($col['key']); ?>" <?php echo e(in_array($col['key'], $visibleColumns) ? 'checked' : ''); ?>>
<label class="custom-control-label" for="col-vis-<?php echo e($col['key']); ?>"><?php echo e($col['label']); ?></label>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="vista-default" value="true">
<label class="custom-control-label" for="vista-default">Imposta come vista predefinita</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-primary" onclick="saveVista()">Salva</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="colonneModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="fas fa-columns mr-2"></i>Colonne Visibili</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<?php $__currentLoopData = $allColumns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $col): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="col-md-6">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input col-toggle" id="col-toggle-<?php echo e($col['key']); ?>" value="<?php echo e($col['key']); ?>" <?php echo e(in_array($col['key'], $visibleColumns) ? 'checked' : ''); ?> onchange="toggleColumn('<?php echo e($col['key']); ?>', this.checked)">
<label class="custom-control-label" for="col-toggle-<?php echo e($col['key']); ?>"><?php echo e($col['label']); ?></label>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog">
<?php if($canDeleteIndividui): ?>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header bg-danger">
<h5 class="modal-title text-white"><i class="fas fa-trash-alt mr-2"></i>Conferma Eliminazione</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<p>Stai per eliminare l'individuo: <strong id="delete-individuo-name"></strong></p>
<p class="text-muted">Seleziona gli elementi collegati da eliminare:</p>
<div class="ml-3">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="delete-contatti" checked>
<label class="custom-control-label" for="delete-contatti">Contatti (<span id="count-contatti">0</span>)</label>
</div>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="delete-gruppi">
<label class="custom-control-label" for="delete-gruppi">Gruppi (<span id="count-gruppi">0</span>) - solo scollegamento</label>
</div>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="delete-documenti" checked>
<label class="custom-control-label" for="delete-documenti">Documenti (<span id="count-documenti">0</span>)</label>
</div>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="delete-eventi">
<label class="custom-control-label" for="delete-eventi">Eventi (<span id="count-eventi">0</span>) - solo scollegamento</label>
</div>
</div>
<div class="alert alert-warning mt-3 mb-0">
<small><i class="fas fa-info-circle mr-1"></i>Se non selezionato, l'elemento verrà scollegato ma non eliminato.</small>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-danger" id="confirm-delete-btn" onclick="confirmDelete()">Elimina</button>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="modal fade" id="createMailingListModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header bg-info">
<h5 class="modal-title text-white"><i class="fas fa-list mr-2"></i>Crea Mailing List</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Nome Lista *</label>
<input type="text" id="ml-nome" class="form-control" placeholder="Es. Newsletter Maggio 2026">
</div>
<div class="form-group">
<label>Descrizione</label>
<textarea id="ml-descrizione" class="form-control" rows="2" placeholder="Descrizione opzionale"></textarea>
</div>
<div class="form-group">
<label>Contatti inclusi (<span id="ml-count">0</span>)</label>
<div class="table-responsive" style="max-height: 300px; overflow-y: auto;">
<table class="table table-bordered table-sm" id="ml-contatti-table">
<thead class="thead-light">
<tr>
<th style="width: 40px;">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="ml-select-all" onchange="toggleMlSelectAll(this)">
<label class="custom-control-label" for="ml-select-all"></label>
</div>
</th>
<th>Codice</th>
<th>Cognome</th>
<th>Nome</th>
<th>Email</th>
<th style="width: 50px;"></th>
</tr>
</thead>
<tbody id="ml-contatti-tbody">
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
<button type="button" class="btn btn-success" onclick="createMailingList()">
<i class="fas fa-save mr-1"></i> Salva Lista
</button>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>
let currentSort = { column: null, direction: 'asc' };
let columnVisibility = <?php echo json_encode(array_column($allColumns, 'key')); ?>;
function toggleSearchPanel() {
const panel = document.getElementById('search-panel');
panel.style.display = panel.style.display === 'none' ? 'block' : 'none';
}
function applyGlobalSearch(value) {
const rows = document.querySelectorAll('#table-body tr');
const searchTerm = value.toLowerCase();
rows.forEach(row => {
const text = row.textContent.toLowerCase();
row.style.display = text.includes(searchTerm) ? '' : 'none';
});
}
function applyColumnFilter() {
const col = document.getElementById('filter-column').value;
const op = document.getElementById('filter-operator').value;
const val = document.getElementById('filter-value').value.toLowerCase();
if (!col || !val) return;
const rows = document.querySelectorAll('#table-body tr');
const colIndex = { codice: 1, cognome: 2, nome: 3, email: 4, telefono: 5, azioni: 6 }[col];
rows.forEach(row => {
const cells = row.querySelectorAll('td');
const cellText = cells[colIndex]?.textContent.toLowerCase() || '';
let matches = false;
switch(op) {
case 'contains': matches = cellText.includes(val); break;
case 'equals': matches = cellText === val; break;
case 'starts': matches = cellText.startsWith(val); break;
case 'ends': matches = cellText.endsWith(val); break;
}
row.style.display = matches ? '' : 'none';
});
}
function clearFilters() {
document.getElementById('global-search').value = '';
document.getElementById('filter-column').value = '';
document.getElementById('filter-value').value = '';
document.querySelectorAll('#table-body tr').forEach(row => row.style.display = '');
}
function sortTable(column) {
if (currentSort.column === column) {
currentSort.direction = currentSort.direction === 'asc' ? 'desc' : 'asc';
} else {
currentSort = { column: column, direction: 'asc' };
}
const colIndex = { codice: 0, cognome: 1, nome: 2, email: 3, telefono: 4, azioni: 5 }[column];
const tbody = document.getElementById('table-body');
const rows = Array.from(tbody.querySelectorAll('tr'));
rows.sort((a, b) => {
const aVal = a.querySelectorAll('td')[colIndex]?.textContent.trim() || '';
const bVal = b.querySelectorAll('td')[colIndex]?.textContent.trim() || '';
const cmp = aVal.localeCompare(bVal, undefined, { numeric: true });
return currentSort.direction === 'asc' ? cmp : -cmp;
});
rows.forEach(row => tbody.appendChild(row));
document.querySelectorAll('th[data-sortable]').forEach(th => {
const icon = th.querySelector('i');
if (th.dataset.column === column) {
icon.className = currentSort.direction === 'asc' ? 'fas fa-sort-up float-right' : 'fas fa-sort-down float-right';
} else {
icon.className = 'fas fa-sort float-right';
}
});
}
function toggleColumn(column, visible) {
const colIndex = { codice: 1, cognome: 2, nome: 3, email: 4, telefono: 5, azioni: 6 }[column];
const ths = document.querySelectorAll('#individui-table thead th');
const rows = document.querySelectorAll('#table-body tr');
if (visible) {
ths[colIndex].style.display = '';
rows.forEach(row => {
row.querySelectorAll('td')[colIndex].style.display = '';
});
} else {
ths[colIndex].style.display = 'none';
rows.forEach(row => {
row.querySelectorAll('td')[colIndex].style.display = 'none';
});
}
}
async function saveVista() {
let nome = document.getElementById('vista-nome').value.trim();
if (!nome) {
const now = new Date();
nome = 'Vista ' + now.toLocaleDateString('it-IT') + ' ' + now.toLocaleTimeString('it-IT', { hour: '2-digit', minute: '2-digit' });
}
const colonneVisibili = Array.from(document.querySelectorAll('#colonne-checkboxes input:checked')).map(i => i.value);
const isDefault = document.getElementById('vista-default').checked;
const data = {
nome: nome,
tipo: 'individui',
colonne_visibili: colonneVisibili,
colonne_ordinamento: currentSort.column ? [[currentSort.column, currentSort.direction]] : [],
ricerca: document.getElementById('global-search').value,
is_default: isDefault
};
try {
const response = await fetch('/viste', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content || ''
},
body: JSON.stringify(data)
});
if (response.ok) {
alert('Vista salvata!');
$('#saveVistaModal').modal('hide');
} else {
alert('Errore salvataggio');
}
} catch(e) {
alert('Errore: ' + e.message);
}
}
function toggleSelectAll(source) {
const checkboxes = document.querySelectorAll('.row-checkbox');
checkboxes.forEach(cb => {
cb.checked = source.checked;
});
}
function exportCSV() {
window.location.href = '/individui/export';
}
function exportSelectedCSV() {
const selectedIds = getSelectedIds();
if (selectedIds.length === 0) {
alert('Seleziona almeno un individuo');
return;
}
const params = new URLSearchParams();
selectedIds.forEach(function(id) {
params.append('ids[]', id);
});
window.location.href = '/individui/export?' + params.toString();
}
let deleteIndividuoId = null;
async function showDeleteModal(id, nome) {
deleteIndividuoId = id;
document.getElementById('delete-individuo-name').textContent = nome;
document.getElementById('count-contatti').textContent = '...';
document.getElementById('count-gruppi').textContent = '...';
document.getElementById('count-documenti').textContent = '...';
document.getElementById('count-eventi').textContent = '...';
try {
const response = await fetch(`/individui/${id}/collegati`);
const data = await response.json();
document.getElementById('count-contatti').textContent = data.contatti;
document.getElementById('count-gruppi').textContent = data.gruppi;
document.getElementById('count-documenti').textContent = data.documenti;
document.getElementById('count-eventi').textContent = data.eventi;
} catch(e) {
console.error('Errore recupero dati:', e);
}
$('#deleteModal').modal('show');
}
function confirmDelete() {
const eliminaContatti = document.getElementById('delete-contatti').checked;
const eliminaDocumenti = document.getElementById('delete-documenti').checked;
const form = document.createElement('form');
form.method = 'POST';
form.action = `/individui/${deleteIndividuoId}/elimina`;
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '<?php echo e(csrf_token()); ?>';
form.innerHTML = `
<input type="hidden" name="_token" value="${csrfToken}">
<input type="hidden" name="elimina_contatti" value="${eliminaContatti}">
<input type="hidden" name="elimina_documenti" value="${eliminaDocumenti}">
`;
document.body.appendChild(form);
form.submit();
}
function printIndividuo(id) {
window.open('/individui/' + id + '/report', '_blank');
}
function exportIndividuoCSV(id) {
const row = document.querySelector(`tr[data-id="${id}"]`);
if (!row) return;
const cells = Array.from(row.querySelectorAll('td'));
const data = {
codice: cells[1].textContent.trim(),
cognome: cells[2].textContent.trim(),
nome: cells[3].textContent.trim(),
email: cells[4].textContent.trim(),
telefono: cells[5].textContent.trim()
};
const csv = `Codice,Cognome,Nome,Email,Telefono\n"${data.codice}","${data.cognome}","${data.nome}","${data.email}","${data.telefono}"`;
const blob = new Blob([csv], { type: 'text/csv' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `individuo_${data.codice}.csv`;
a.click();
}
function sendEmail(id) {
window.location.href = `/mailing/nuovo?individui=${id}`;
}
function generateReport(id) {
window.open('/individui/' + id + '/report', '_blank');
}
function getSelectedIds() {
return Array.from(document.querySelectorAll('.row-checkbox:checked')).map(cb => cb.value);
}
function exportSelectedCSV() {
const selectedIds = getSelectedIds();
if (selectedIds.length === 0) {
alert('Seleziona almeno un individuo');
return;
}
const rows = [];
rows.push('Codice,Cognome,Nome,Email,Telefono');
document.querySelectorAll('#table-body tr').forEach(row => {
const checkbox = row.querySelector('.row-checkbox');
if (checkbox && checkbox.checked) {
const cells = Array.from(row.querySelectorAll('td'));
const codice = cells[1].textContent.trim();
const cognome = cells[2].textContent.trim();
const nome = cells[3].textContent.trim();
const email = cells[4].textContent.trim();
const telefono = cells[5].textContent.trim();
rows.push(`"${codice}","${cognome}","${nome}","${email}","${telefono}"`);
}
});
const blob = new Blob([rows.join('\n')], { type: 'text/csv' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `individui_selezionati_${new Date().toISOString().slice(0,10)}.csv`;
a.click();
}
function printSelected() {
const selectedIds = getSelectedIds();
if (selectedIds.length === 0) {
alert('Seleziona almeno un individuo');
return;
}
window.open(`/individui/report/stampa?ids=${selectedIds.join(',')}`, '_blank');
}
function emailSelected() {
const selectedIds = getSelectedIds();
if (selectedIds.length === 0) {
alert('Seleziona almeno un individuo');
return;
}
window.location.href = `/mailing/nuovo?individui=${selectedIds.join(',')}`;
}
function deleteSelected() {
const selectedIds = getSelectedIds();
if (selectedIds.length === 0) {
alert('Seleziona almeno un individuo');
return;
}
document.getElementById('delete-individuo-name').textContent = selectedIds.length + ' individui selezionati';
document.getElementById('count-contatti').textContent = '...';
document.getElementById('count-gruppi').textContent = '...';
document.getElementById('count-documenti').textContent = '...';
document.getElementById('count-eventi').textContent = '...';
document.getElementById('confirm-delete-btn').onclick = function() {
const eliminaContatti = document.getElementById('delete-contatti').checked;
const eliminaDocumenti = document.getElementById('delete-documenti').checked;
const form = document.createElement('form');
form.method = 'POST';
form.action = '/individui/mass-elimina';
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '<?php echo e(csrf_token()); ?>';
let html = `<input type="hidden" name="_token" value="${csrfToken}">`;
html += `<input type="hidden" name="elimina_contatti" value="${eliminaContatti}">`;
html += `<input type="hidden" name="elimina_documenti" value="${eliminaDocumenti}">`;
selectedIds.forEach(function(id) {
html += `<input type="hidden" name="ids[]" value="${id}">`;
});
form.innerHTML = html;
document.body.appendChild(form);
form.submit();
};
$('#deleteModal').modal('show');
}
document.addEventListener('DOMContentLoaded', function() {
const csrfToken = document.querySelector('meta[name="csrf-token"]');
if (!csrfToken) {
const meta = document.createElement('meta');
meta.name = 'csrf-token';
meta.content = '<?php echo e(csrf_token()); ?>';
document.head.appendChild(meta);
}
const visibleCols = <?php echo $visibleColumnsJson; ?>;
const allCols = <?php echo $allColumnsJson; ?>;
allCols.forEach(function(col) {
const visibile = visibleCols.includes(col.key);
const saveCheckbox = document.querySelector(`#col-vis-${col.key}`);
const toggleCheckbox = document.querySelector(`#col-toggle-${col.key}`);
if (saveCheckbox) saveCheckbox.checked = visibile;
if (toggleCheckbox) toggleCheckbox.checked = visibile;
});
const vistaDefault = <?php echo $vistaDefaultJson; ?>;
if (vistaDefault && vistaDefault.ricerca) {
document.getElementById('global-search').value = vistaDefault.ricerca;
applyGlobalSearch(vistaDefault.ricerca);
}
});
function showCreateMailingListModal() {
document.getElementById('ml-nome').value = '';
document.getElementById('ml-descrizione').value = '';
document.getElementById('ml-contatti-tbody').innerHTML = '';
document.getElementById('ml-count').textContent = '0';
const selectedIds = getSelectedIds();
console.log('Selected IDs:', selectedIds);
if (selectedIds.length > 0) {
const url = '/individui/email-list?ids=' + selectedIds.join(',');
console.log('Fetching URL:', url);
fetch(url, {
credentials: 'include',
headers: {
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(response => {
console.log('Response status:', response.status);
console.log('Response type:', response.headers.get('content-type'));
if (!response.ok) {
return response.text().then(text => {
console.log('Full error response:', text.substring(0, 500));
const contentType = response.headers.get('content-type');
if (contentType && contentType.includes('application/json')) {
const json = JSON.parse(text);
throw new Error(json.message || 'Errore HTTP ' + response.status);
} else {
throw new Error('Server returned HTML (status ' + response.status + ') - probabilmente sessione scaduta. Ricarica la pagina.');
}
});
}
return response.json();
})
.then(data => {
console.log('Data:', data);
updateMlTable(data);
})
.catch(function(err) {
console.error('Error:', err);
alert('Errore caricamento contatti: ' + err.message + '\nURL: ' + url);
});
} else {
alert('Seleziona almeno un individuo dalla tabella');
}
$('#createMailingListModal').modal('show');
}
function updateMlTable(data) {
const tbody = document.getElementById('ml-contatti-tbody');
const existingIds = new Set();
document.querySelectorAll('.ml-row-checkbox').forEach(function(cb) {
existingIds.add(parseInt(cb.value));
});
data.forEach(function(item) {
if (existingIds.has(item.id)) return;
const tr = document.createElement('tr');
const checked = item.email_count === 1 ? 'checked' : '';
tr.innerHTML = `
<td>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input ml-row-checkbox" id="ml-${item.id}" value="${item.id}" data-email="${item.email || ''}" ${checked}>
<label class="custom-control-label" for="ml-${item.id}"></label>
</div>
</td>
<td><span class="badge badge-secondary">${item.codice_id}</span></td>
<td>${item.cognome}</td>
<td>${item.nome}</td>
<td>
${item.email_count === 1 ? (item.email || '-') :
'<select class="form-control form-control-sm" onchange="updateMlCheckboxEmail(' + item.id + ', this.value)">' +
'<option value="">Seleziona email...</option>' +
(item.emails || []).map(function(e) { return '<option value="' + e + '">' + e + '</option>'; }).join('') +
'</select>'}
</td>
<td>
<button type="button" class="btn btn-xs btn-danger" onclick="this.closest('tr').remove(); updateMlCount();">
<i class="fas fa-times"></i>
</button>
</td>
`;
tbody.appendChild(tr);
});
updateMlCount();
}
function updateMlCount() {
document.getElementById('ml-count').textContent = document.querySelectorAll('.ml-row-checkbox').length;
}
function toggleMlSelectAll(source) {
document.querySelectorAll('.ml-row-checkbox').forEach(function(cb) {
cb.checked = source.checked;
});
}
function updateMlCheckboxEmail(id, email) {
const checkbox = document.getElementById('ml-' + id);
if (checkbox) {
checkbox.dataset.email = email;
checkbox.checked = email !== '';
}
}
async function createMailingList() {
const nome = document.getElementById('ml-nome').value.trim();
if (!nome) {
alert('Inserisci un nome per la lista');
return;
}
const selected = [];
document.querySelectorAll('.ml-row-checkbox:checked').forEach(function(cb) {
if (cb.dataset.email) {
selected.push({
individuo_id: parseInt(cb.value),
email: cb.dataset.email
});
}
});
if (selected.length === 0) {
alert('Seleziona almeno un contatto con email');
return;
}
const data = {
nome: nome,
descrizione: document.getElementById('ml-descrizione').value.trim(),
contatti: selected
};
try {
const response = await fetch('/mailing-liste/create-from-individui', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content || ''
},
body: JSON.stringify(data)
});
if (response.ok) {
alert('Mailing list creata con successo!');
$('#createMailingListModal').modal('hide');
} else {
alert('Errore nella creazione della lista');
}
} catch(e) {
alert('Errore: ' + e.message);
}
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.adminlte', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/glastree/resources/views/individui/index.blade.php ENDPATH**/ ?>
@@ -1,108 +0,0 @@
<?php
use App\Models\AppSetting;
$appLogo = AppSetting::getLogoUrl();
$appName = AppSetting::getAppName() ?? 'Glastree';
$appOrgName = AppSetting::getOrgName() ?? '';
?>
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Accedi - <?php echo e(e($appName)); ?></title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="/">
<?php if($appLogo): ?>
<img src="<?php echo e($appLogo); ?>" alt="Logo" style="max-height: 80px; max-width: 200px;">
<?php else: ?>
<i class="fas fa-tree text-success"></i> <b><?php echo e(e($appName)); ?></b>
<?php endif; ?>
</a>
</div>
<?php if($appOrgName): ?>
<div class="text-center mb-3">
<small class="text-muted"><?php echo e(e($appOrgName)); ?></small>
</div>
<?php endif; ?>
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">Accedi per continuare</p>
<form action="<?php echo e(route('login')); ?>" method="POST">
<?php echo csrf_field(); ?>
<div class="input-group mb-3">
<input type="email" name="email" class="form-control <?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" placeholder="Email" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div>
</div>
<?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="input-group mb-3">
<input type="password" name="password" class="form-control <?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" placeholder="Password" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
<?php $__errorArgs = ['password'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
<span class="invalid-feedback"><?php echo e($message); ?></span>
<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
<div class="row">
<div class="col-8">
<div class="icheck-primary">
<input type="checkbox" id="remember" name="remember">
<label for="remember">Ricordami</label>
</div>
</div>
<div class="col-4">
<button type="submit" class="btn btn-success btn-block">Accedi</button>
</div>
</div>
</form>
<p class="mb-0 text-center mt-3">
<a href="<?php echo e(route('password.request')); ?>" class="text-center">Password dimenticata?</a>
</p>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html><?php /**PATH /var/www/html/glastree/resources/views/auth/login.blade.php ENDPATH**/ ?>
@@ -1,301 +0,0 @@
<?php
$appLogoSmall = \App\Models\AppSetting::getLogoSmallUrl();
$appName = \App\Models\AppSetting::getAppName() ?? 'Glastree';
?>
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
<title><?php echo $__env->yieldContent('title', e($appName)); ?></title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap">
<?php echo $__env->yieldContent('styles'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="<?php echo e(route('help')); ?>" title="Guida">
<i class="fas fa-question-circle"></i>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="far fa-bell"></i>
<?php $unread = Auth::user()->unreadNotificheCount() ?? 0 ?>
<?php if($unread > 0): ?>
<span class="badge badge-warning navbar-badge"><?php echo e($unread); ?></span>
<?php endif; ?>
</a>
<div class="dropdown-menu dropdown-menu-right">
<span class="dropdown-header">Notifiche (<?php echo e($unread); ?>)</span>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">Visualizza tutte</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="fas fa-user"></i> <?php echo e(Auth::user()->name); ?>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?php echo e(route('profile')); ?>" class="dropdown-item">
<i class="fas fa-user-cog mr-2"></i> Profilo
</a>
<div class="dropdown-divider"></div>
<form method="POST" action="<?php echo e(route('logout')); ?>">
<?php echo csrf_field(); ?>
<button type="submit" class="dropdown-item">
<i class="fas fa-sign-out-alt mr-2"></i> Esci
</button>
</form>
</div>
</li>
</ul>
</nav>
<?php
$appLogoSmall = \App\Models\AppSetting::getLogoSmallUrl();
$appName = \App\Models\AppSetting::getAppName() ?? 'Glastree';
?>
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<a href="<?php echo e(route('dashboard')); ?>" class="brand-link">
<?php if($appLogoSmall): ?>
<img src="<?php echo e($appLogoSmall); ?>" alt="Logo" class="brand-image" style="max-height: 35px; max-width: 40px;">
<?php else: ?>
<i class="fas fa-tree brand-image ml-3 mr-2"></i>
<?php endif; ?>
<span class="brand-text font-weight-light"><?php echo e($appName); ?></span>
</a>
<div class="sidebar">
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu">
<li class="nav-item">
<a href="<?php echo e(route('dashboard')); ?>" class="nav-link <?php echo e(request()->routeIs('dashboard') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>Dashboard</p>
</a>
</li>
<?php if(Auth::user()->canAccess('individui')): ?>
<li class="nav-item">
<a href="<?php echo e(route('individui.index')); ?>" class="nav-link">
<i class="nav-icon fas fa-users"></i>
<p>Individui</p>
</a>
</li>
<?php endif; ?>
<?php if(Auth::user()->canAccess('gruppi')): ?>
<li class="nav-item">
<a href="<?php echo e(route('gruppi.index')); ?>" class="nav-link">
<i class="nav-icon fas fa-folder"></i>
<p>Gruppi</p>
</a>
</li>
<?php endif; ?>
<?php if(Auth::user()->canAccess('documenti')): ?>
<li class="nav-item">
<a href="<?php echo e(route('documenti.index')); ?>" class="nav-link">
<i class="nav-icon fas fa-file"></i>
<p>Documenti</p>
</a>
</li>
<?php endif; ?>
<?php if(Auth::user()->canAccess('eventi')): ?>
<li class="nav-item has-treeview">
<a href="<?php echo e(route('eventi.calendar')); ?>" class="nav-link">
<i class="nav-icon fas fa-calendar"></i>
<p>Eventi <i class="right fas fa-angle-left" style="font-size: 0.8rem;"></i></p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="<?php echo e(route('eventi.calendar')); ?>" class="nav-link">
<i class="nav-icon fas fa-calendar-alt"></i>
<p>Calendario</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('eventi.index')); ?>" class="nav-link">
<i class="nav-icon fas fa-list"></i>
<p>Elenco</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('eventi.create')); ?>" class="nav-link">
<i class="nav-icon fas fa-plus"></i>
<p>Nuovo Evento</p>
</a>
</li>
</ul>
</li>
<?php endif; ?>
<?php if(Auth::user()->canAccess('email') || Auth::user()->canAccess('mailing')): ?>
<li class="nav-item has-treeview">
<a href="<?php echo e(route('email.index', 'inbox')); ?>" class="nav-link">
<i class="nav-icon fas fa-envelope"></i>
<p>Email <i class="right fas fa-angle-left" style="font-size: 0.8rem;"></i></p>
</a>
<ul class="nav nav-treeview">
<?php if(Auth::user()->canAccess('email')): ?>
<li class="nav-item">
<a href="<?php echo e(route('email.compose')); ?>" class="nav-link">
<i class="nav-icon fas fa-plus"></i>
<p>Nuova Email</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('email.index', 'inbox')); ?>" class="nav-link">
<i class="nav-icon fas fa-inbox"></i>
<p>In arrivo</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('email.index', 'starred')); ?>" class="nav-link">
<i class="nav-icon fas fa-star"></i>
<p>Preferiti</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('email.index', 'sent')); ?>" class="nav-link">
<i class="nav-icon fas fa-paper-plane"></i>
<p>Inviate</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('email.index', 'drafts')); ?>" class="nav-link">
<i class="nav-icon fas fa-edit"></i>
<p>Bozze</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('email.index', 'archive')); ?>" class="nav-link">
<i class="nav-icon fas fa-archive"></i>
<p>Archivio</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('email.index', 'trash')); ?>" class="nav-link">
<i class="nav-icon fas fa-trash"></i>
<p>Cestino</p>
</a>
</li>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>
<?php if(Auth::user()->canAccess('mailing')): ?>
<li class="nav-item">
<a href="<?php echo e(route('mailing-liste.index')); ?>" class="nav-link">
<i class="nav-icon fas fa-list"></i>
<p>Mailing List</p>
</a>
</li>
<?php endif; ?>
<?php if(Auth::user()->canAccess('report')): ?>
<li class="nav-item">
<a href="<?php echo e(route('report.index')); ?>" class="nav-link <?php echo e(request()->routeIs('report.*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-chart-bar"></i>
<p>Report</p>
</a>
</li>
<?php endif; ?>
<?php if(Auth::user()->canManage('settings')): ?>
<li class="nav-item">
<a href="/impostazioni" class="nav-link <?php echo e(request()->is('impostazioni*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-cog"></i>
<p>Impostazioni</p>
</a>
</li>
<li class="nav-item has-treeview <?php echo e(request()->is('admin/*') ? 'menu-open' : ''); ?>">
<a href="#" class="nav-link <?php echo e(request()->is('admin/*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-users-cog"></i>
<p>Admin <i class="right fas fa-angle-left" style="font-size: 0.8rem;"></i></p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="/admin/utenti" class="nav-link <?php echo e(request()->routeIs('admin.utenti.*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-user-shield"></i>
<p>Utenti</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('admin.ruoli.index')); ?>" class="nav-link <?php echo e(request()->routeIs('admin.ruoli.*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-tag"></i>
<p>Ruoli</p>
</a>
</li>
<li class="nav-item">
<a href="/admin/backup" class="nav-link <?php echo e(request()->routeIs('admin.backup.*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-hdd"></i>
<p>Backup</p>
</a>
</li>
<li class="nav-item">
<a href="<?php echo e(route('admin.activity-logs.index')); ?>" class="nav-link <?php echo e(request()->routeIs('admin.activity-logs.*') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-history"></i>
<p>Log Attività</p>
</a>
</li>
</ul>
</li>
<?php endif; ?>
<li class="nav-item">
<a href="<?php echo e(route('help')); ?>" class="nav-link <?php echo e(request()->routeIs('help') ? 'active' : ''); ?>">
<i class="nav-icon fas fa-question-circle"></i>
<p>Guida / Aiuto</p>
</a>
</li>
</ul>
</nav>
</div>
</aside>
<div class="content-wrapper" style="min-height: calc(100vh - 120px);">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php echo $__env->yieldContent('page_title', 'Dashboard'); ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<?php echo $__env->yieldContent('breadcrumbs'); ?>
</ol>
</div>
</div>
</div>
</div>
<div class="content">
<div class="container-fluid">
<?php echo $slot ?? ''; ?>
<?php echo $__env->yieldContent('content'); ?>
</div>
</div>
</div>
<footer class="main-footer">
<strong><?php echo e(\App\Models\AppSetting::getFooterText()); ?></strong>
<?php if(\App\Models\AppSetting::shouldShowVersion() && \App\Models\AppSetting::getAppVersion()): ?>
<span class="ml-2">v<?php echo e(\App\Models\AppSetting::getAppVersion()); ?></span>
<?php endif; ?>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/js/adminlte.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<?php echo $__env->yieldContent('scripts'); ?>
</body>
</html><?php /**PATH /var/www/html/glastree/resources/views/layouts/adminlte.blade.php ENDPATH**/ ?>