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.
139 righe
4.5 KiB
139 righe
4.5 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice)) { |
|
?> |
|
<div class="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 text-right"> |
|
<? if (! $_SESSION["utente"]->readOnly) { ?> |
|
<a href="javascript:void(0)" onclick="showModalWithURL('/backend/npa/create.php');" class="btn btn-success" title="<?= __('Crea nuova scheda') ?>"><i class="fa fa-plus-circle mr-3"></i><?= __('Crea nuova scheda') ?></a> |
|
<? } ?> |
|
</div> |
|
</div> |
|
<? |
|
$bind = [":codice_gestore"=>$_SESSION["ente"]->codice]; |
|
$sql = "SELECT codice FROM b_npa WHERE codice_gestore = :codice_gestore "; |
|
if ($_SESSION["utente"]->gerarchia > 10) { |
|
$ids = Utente::getPermissionsInModulo($_SESSION["ente"]->codice, $_SESSION["utente"]->codice, "npa"); |
|
$ids = implode(",",$ids); |
|
$sql = "{$sql} AND codice IN ({$ids})"; |
|
} |
|
if (!$_SESSION["utente"]->fromHere()) { |
|
$sql = "{$sql} AND codice_ente = :codice_ente"; |
|
$bind[":codice_ente"] = $_SESSION["utente"]->codice_ente; |
|
} |
|
$risultato = $pdo->go($sql,$bind); |
|
if($risultato->rowCount() < 0) { |
|
?> |
|
<div class="card"> |
|
<div class="card-body text-warning pt-5 pb-5 text-center"> |
|
<span class="display-4"><i class="fas fa-times-circle"></i><br><?= "Nessun risultato trovato" ?></span> |
|
</div> |
|
</div> |
|
<? |
|
} else { |
|
?> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<div class="card"> |
|
<div class="card-body"> |
|
<div class="table-responsive"> |
|
<table class="table table-striped table-hover table-condensed" id="tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10">#</th> |
|
<th width="10"><?= __("Stato") ?></th> |
|
<th><?= __("Identificativo") ?></th> |
|
<th width="150"><?= __("Data trasmissione") ?></th> |
|
<th width="120"><?= __("Data creazione") ?></th> |
|
<th width="10"></th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
</tbody> |
|
</table> |
|
</div> |
|
<script> |
|
let table = $("#tab-data").DataTable({ |
|
"processing": true, |
|
"serverSide": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": "table.php", |
|
"order": [[0,'DESC'],[3,'ASC']], |
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, '<?= __("tutti") ?>']], |
|
"columns": [ |
|
{ "orderable": true, "class": 'fit-width' }, |
|
{ "orderable": true, "class": 'fit-width' }, |
|
{ "orderable": true }, |
|
{ "orderable": true, "class": 'fit-width' }, |
|
{ "orderable": true, "class": 'fit-width' }, |
|
{ "orderable": false, "class": 'fit-width' } |
|
], |
|
"drawCallback": function(settings, json) { |
|
$('[data-toggle="tooltip"]').tooltip(); |
|
} |
|
}); |
|
</script> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<script type="text/javascript"> |
|
|
|
let dispatchCard = function(id, card) { |
|
if(typeof window.npa != "undefined") { |
|
window.npa.enableAutosave = false; |
|
} |
|
$.ajax({ |
|
|
|
type: "POST", |
|
url: "ajax/invia.php", |
|
data: { codice: id, id_scheda: card }, |
|
dataType: "script", |
|
beforeSend: function () { |
|
|
|
$("#wait_div").show(); |
|
|
|
} |
|
|
|
}).fail(function (response) { |
|
|
|
swal(js_dict["error-retry"]); |
|
|
|
}).done(function (response) { |
|
|
|
table.ajax.reload(); |
|
|
|
}).always(function () { |
|
|
|
$("#wait_div").slideUp('fast'); |
|
|
|
}); |
|
|
|
} |
|
|
|
</script> |
|
<? |
|
} |
|
?> |
|
|
|
<? |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|