Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
114 righe
3.9 KiB
114 righe
3.9 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
$bind = [":codice_gestore"=>$_SESSION["ente"]->codice ?? 0]; |
|
$sql = "SELECT b_guide.codice |
|
FROM b_guide |
|
LEFT JOIN r_visibilita_guide |
|
ON b_guide.codice = r_visibilita_guide.codice_guida |
|
WHERE (codice_gestore = :codice_gestore OR codice_gestore = 0) |
|
AND soft_delete = 'N' "; |
|
|
|
if (isset($_SESSION["ente"])) { |
|
$moduli = []; |
|
foreach ($_SESSION["utente"]->moduliDisponibili() as $key => $values) { |
|
foreach ($values as $key => $value) { |
|
$moduli[] = $key; |
|
} |
|
} |
|
|
|
array_push($moduli, 'tutti'); |
|
$moduli = implode( "', '", $moduli ); |
|
$sql .= " AND id_modulo IN ('$moduli') "; |
|
} |
|
$risultato = $pdo->go($sql,$bind); |
|
|
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<h2> |
|
<?= Modulo::header($radice) ?> |
|
</h2> |
|
</div> |
|
</div> |
|
</div> |
|
<? if ($_SESSION["utente"]->gerarchia <= 10 && !$_SESSION["utente"]->readOnly) { ?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="text-right"> |
|
<? if ($_SESSION["utente"]->gerarchia <= 1):?> |
|
<a class="btn btn-danger" title="<?= __('Pulisci cache') ?>" onClick="confirmBeforeSubmit(0,'/backend/guida/clear-cache.php')"> |
|
<i class="fas fa-trash"></i> <?=__('Pulisci cache')?> |
|
</a> |
|
<?endif?> |
|
<a href="/backend/<?= $radice ?>/edit.php?codice=0" class="btn btn-success" title="<?= __('Aggiungi nuovo') ?>"><span class="fa fa-plus-circle"></span> <?= __('Aggiungi nuovo') ?></a> |
|
</div> |
|
</div> |
|
</div> |
|
<? } ?> |
|
<? |
|
if ($risultato->rowCount() > 0) { |
|
?> |
|
<div class="card mb-2"> |
|
<div class="card-body"> |
|
<div class="table-responsive"> |
|
<h2 id="table-title"></h2> |
|
<table class="table table-striped table-hover" id="tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10"></th> |
|
<th><?= __("Titolo") ?></th> |
|
<th><?= __("Ultima modifica") ?></th> |
|
<th width="5"></th> |
|
<? if ($_SESSION["utente"]->gerarchia <= 10) { ?> |
|
<th width="5"></th> |
|
<th width="5"></th> |
|
<th width="5"></th> |
|
<? } ?> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
</div> |
|
<script> |
|
var table = $("#tab-data").DataTable({ |
|
"processing": true, |
|
"serverSide": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": { |
|
"url": "table.php" |
|
}, |
|
"order": [[1,'desc']], |
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, '<?= __("tutti") ?>']], |
|
"columns": [ |
|
null, |
|
null, |
|
null, |
|
{ "orderable": false }, |
|
<? if ($_SESSION["utente"]->gerarchia <= 10) { ?> |
|
{ "orderable": false }, |
|
{ "orderable": false }, |
|
{ "orderable": false } |
|
<? } ?> |
|
] |
|
}); |
|
</script> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun risultato")); |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|