gestione gare pubbliche
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.
 
 
 
 
 

137 righe
4.9 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission("programmazione-art21")) {
$breadcrumb = [];
$breadcrumb["/{$radice}/index.php"] = __("Progetti");
$breadcrumb[] = __("Programmazione");
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('programmazione-art21') ?>
</h2>
</div>
</div>
</div>
<?
$bind = [];
$sql = "SELECT codice FROM b_programmi_art21 WHERE codice > 0 ";
if (!$_SESSION["utente"]->fromHere()) {
$sql .= " AND codice_ente = :codice_ente";
$bind[":codice_ente"] = $_SESSION["utente"]->codice_ente;
}
$risultato = $pdo->go($sql,$bind);
?>
<div id="commands" class="mb-5">
<div class="commands container-fluid">
<div class="text-right">
<?
cpn::printLoginStatus();
?>
<button class="btn btn-primary" onclick="showModalWithURL('/backend/progetti/programmazione/edit.php?codice=0')"><span class="fa fa-plus-circle"></span> <?= __('Aggiungi nuovo') ?></button>
</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(Programma::tipologie() AS $key => $label) {?>
<option value="<?= $key ?>"><?= __($label) ?></option>
<? } ?>
</select>
</div>
</div>
<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="200"><?= __("Stato") ?></th>
<th width="10"><?= __("Anno") ?></th>
<th><?= __("Tipologia") ?></th>
<?
if (!empty($enti)) {
?>
<th><?= __("Beneficiario") ?></th>
<?
}
?>
<th width="5"><?= __("Modifica") ?></th>
<th width="5"><?= __("Docs") ?></th>
<? if ($_SESSION["utente"]->permission("cpn")) { ?>
<th width="5"><?= __("Invio") ?></th>
<th width="5"><?= __("Download") ?></th>
<? } ?>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<script>
var table = $("#tab-data").DataTable({
"processing": true,
"serverSide": true,
"searching": false,
"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": [
{ "orderable": false },
null,
null,
null,
<? if (!empty($enti)) { ?>{ "orderable": false },<? } ?>{ "orderable": false },
{ "orderable": false },
<? if ($_SESSION["utente"]->permission("cpn")) { ?>
{ "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();
}
?>