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.
136 righe
5.3 KiB
136 righe
5.3 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"); |
|
$enti = $_SESSION["utente"]->getEntiBeneficiari(); |
|
?> |
|
<div class="container-fluid pt-5 pb-3"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<h2> |
|
<?= Modulo::header($radice) ?> |
|
</h2> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
$bind = []; |
|
$sql = "SELECT codice FROM b_progetti WHERE codice > 0 "; |
|
if ($_SESSION["utente"]->gerarchia > 10) { |
|
$ids = Utente::getPermissionsInModulo($_SESSION["ente"]->codice,$_SESSION["utente"]->codice,"progetti"); |
|
$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; |
|
} |
|
$risultato = $pdo->go($sql,$bind); |
|
if (!$_SESSION["utente"]->readOnly) { |
|
?> |
|
<div id="commands" class="mb-5"> |
|
<div class="commands container-fluid"> |
|
<div class="text-right"> |
|
<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> |
|
<? if ($_SESSION["utente"]->permission("programmazione-art21")) { ?> |
|
<a href="/backend/<?= $radice ?>/programmazione/index.php" class="btn btn-info" title="<?= __('Programmazione') ?>"><span class="fa fa-calendar"></span> <?= __('Programmazione') ?></a> |
|
<? } ?> |
|
<button class="btn btn-primary" onclick="showModalWithURL('/backend/progetti/immobili/index.php')"><span class="fa fa-building"></span> <?= __("Gestione immobili") ?> |
|
</div> |
|
</div> |
|
</div> |
|
<? } ?> |
|
<? if ($risultato->rowCount() > 0) { |
|
?> |
|
<div class="row mb-2"> |
|
<? if (count($enti) > 1) { |
|
?> |
|
<div class="col-12 col-md-4"> |
|
<label><?= __("Ente beneficiario") ?></label> |
|
<select id="filtroBeneficiario" onChange="table.draw();"> |
|
<option value=""><?= __("Tutti") ?></option> |
|
<? foreach($enti AS $ente) {?> |
|
<option value="<?= $ente["codice"] ?>"><?= $ente["denominazione"] ?></option> |
|
<? } ?> |
|
</select> |
|
</div> |
|
<? } ?> |
|
<div class="col-12 col-md-4"> |
|
<label><?= __("Tipologia") ?></label> |
|
<select id="filtroTipologie" onChange="table.draw();"> |
|
<option value=""><?= __("Tutte") ?></option> |
|
<? foreach(progetto::tipologie() AS $key => $label) {?> |
|
<option value="<?= $key ?>"><?= __($label) ?></option> |
|
<? } ?> |
|
</select> |
|
</div> |
|
</div> |
|
<div class="card mb-2"> |
|
<div class="card-body p-1 p-xl-3"> |
|
<div class="table-responsive"> |
|
<h2 id="table-title"></h2> |
|
<table class="table table-striped table-condensed table-hover" id="tab-data" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10"><?= __("ID") ?></th> |
|
<th width="10"><?= __("Anno") ?></th> |
|
<th width="10"><?= __("CUI") ?></th> |
|
<th width="10"><?= __("CUP") ?></th> |
|
<th width="10"><?= __("Tipologia") ?></th> |
|
<th><?= __("Oggetto") ?></th> |
|
<th width="200"><?= __("Valore totale") ?></th> |
|
<? |
|
if (!empty($enti)) { |
|
?> |
|
<th><?= __("Beneficiario") ?></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.tipologia = $('#filtroTipologie').val(); |
|
<? if (!empty($enti)) { ?>d.ente = $('#filtroBeneficiario').val();<? } ?> |
|
} |
|
}, |
|
"order": [[1,'desc']], |
|
"lengthMenu": [[25, 50, -1], [25, 50, '<?= __("tutti") ?>']], |
|
"columns": [ |
|
null, |
|
null, |
|
null, |
|
null, |
|
null, |
|
{ "orderable": false }, |
|
null, |
|
<? if (!empty($enti)) { ?>{ "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(); |
|
} |
|
?>
|
|
|