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.
132 righe
3.7 KiB
132 righe
3.7 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"public_html/"))."config.php"; |
|
include_once($configPath); |
|
if (isset($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
include_once($root."/backend/layout/top.php"); |
|
$bind = []; |
|
$sql = "SELECT codice FROM b_cpn WHERE codice > 0 "; |
|
if ($_SESSION["utente"]->gerarchia > 10) { |
|
$ids = Utente::getPermissionsInModulo($_SESSION["ente"]->codice,$_SESSION["utente"]->codice,"cpn"); |
|
$ids = implode(",",$ids); |
|
$sql .= " AND codice IN ({$ids}) "; |
|
} |
|
if (!$_SESSION["utente"]->fromHere()) { |
|
$sql .= " AND codice_ente = :codice_ente "; |
|
$bind[":codice_ente"] = $_SESSION["utente"]->codice_ente; |
|
} |
|
$sql_stato = $sql . " AND stato = :stato "; |
|
$risultato = $pdo->go($sql,$bind); |
|
$stati = attiCPN::getStati(); |
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<h2> |
|
<?= Modulo::header($radice) ?> |
|
</h2> |
|
</div> |
|
</div> |
|
</div> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<? if ($risultato->rowCount() > 0) { ?> |
|
<div class="row"> |
|
<div class="col-12 col-md-4"> |
|
<label><?= __("Stato") ?></label> |
|
<select name="status" id="filtroStatus" onChange="table.draw();"> |
|
<option value=""><?= __("Tutti") ?></option> |
|
<? |
|
foreach($stati AS $stat => $stato) { |
|
?> |
|
<option style="border-left: 5px solid <?= $stato["color"] ?>" value="<?= $stat ?>"> |
|
<?= __($stato["titolo"]) ?> |
|
</option> |
|
<? |
|
} |
|
?> |
|
</select> |
|
</div> |
|
<div class="col-12 col-md-8 text-right"> |
|
<? } else { ?> |
|
<div> |
|
<div class="text-right"> |
|
<?} ?> |
|
<? |
|
cpn::printLoginStatus(); |
|
if ($_SESSION["utente"]->gerarchia === 1) { |
|
?> |
|
<button class="btn btn-warning" onClick="showModalWithURL('utility/index.php');"><span class="fa fa-cogs"></span> <?= __("Avanzate") ?></button> |
|
<? |
|
} |
|
/* |
|
?> |
|
<? if (!$_SESSION["utente"]->readOnly) { ?> |
|
<a href="/backend/cpn/edit.php?codice=0" class="btn btn-success" title="<?= __('Aggiungi nuovo') ?>"><span class="fa fa-plus-circle mr-2"></span> <?= __('Aggiungi nuovo') ?></a> |
|
<? } |
|
*/ ?> |
|
</div> |
|
</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 width="150"></th> |
|
<th><?= __("Oggetto") ?></th> |
|
<th><?= __("Ente") ?></th> |
|
<th width="10"></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", |
|
"data": function (d) { |
|
d.stato = $('#filtroStatus').val(); |
|
} |
|
}, |
|
"order": [[1,'desc']], |
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, '<?= __("tutti") ?>']], |
|
"drawCallback": function( settings ) { |
|
$('[data-toggle="tooltip"]').tooltip(); |
|
}, |
|
"columns": [ |
|
null, |
|
null, |
|
null, |
|
null, |
|
{ "orderable": false } |
|
] |
|
}); |
|
</script> |
|
<? |
|
} else { |
|
alertManager::printWarningBox(__("Nessun risultato")); |
|
} |
|
|
|
include_once($root."/backend/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|