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.
 
 
 
 
 

123 righe
5.9 KiB

<?
if (!empty($chiarimenti) && !empty($radice)) {
$json = json_encode($chiarimenti);
$hash = md5($json);
$tokenExport = "esportazione-chiarimenti-".$hash;
if (empty($_SESSION["esportazione-chiarimenti"][$tokenExport])) {
$_SESSION["esportazione-chiarimenti"][$tokenExport] = $chiarimenti;
}
?>
<script>
function checkExportButtons() {
if ($(".exportChiarimento:checked").length > 0) {
$(".exportButtons").slideDown();
} else {
$(".exportButtons").slideUp();
}
}
</script>
<form action="/backend/common/chiarimenti/export.php" method="post" target="_blank" rel="validate">
<input type="hidden" name="tokenExport" value="<?= base64_encode($tokenExport) ?>">
<input type="hidden" id="format" name="format" value="" rel="S;3;3;A" title="<?= __("Formato") ?>">
<input type="hidden" name="radice" value="<?= $radice ?>">
<div class="card">
<div class="card-header exportButtons collapse text-right">
<button onClick="$('#format').val('pdf');" class="btn btn-danger">
<span class="fa fa-file-pdf"></span> <?= __("Esporta PDF") ?>
</button>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="list-chiarimenti">
<thead>
<tr>
<th width="5">
<button type="button" onClick="$('.exportChiarimento').prop('checked',true); checkExportButtons();" class="btn btn-sm" title="<?= __("Seleziona tutto") ?>"><span class="fa fa-check"></span></button>
</th>
<th width="5">#</th>
<th width="5"></th>
<th width="200"></th>
<th><?= __("Quesito") ?></th>
<? if (empty($hideName)) { ?><th width="20%"><?= __("Mittente") ?></th><? } ?>
<th width="20%"><?= __("Timestamp") ?></th>
<th width="10"></th>
<th width="10"></th>
</tr>
</thead>
<tbody>
<?
foreach($chiarimenti AS $chiarimento) {
$stato = "bg-disabled";
$stato_label = __('In attesa di risposta');
if ($chiarimento["attivo"]!="N") {
$stato = ($chiarimento["attivo"]=="S") ? "bg-active" : "bg-warning";
if ($stato == "bg-active") {
$stato_label = __('Pubblicato');
} else {
$stato_label = __('Risposto al richiedente');
}
} else {
if (!empty($chiarimento["risposta"])) {
$stato = "bg-warning";
$stato_label = __('In attesa di pubblicazione');
}
}
?>
<tr>
<td class="text-center">
<input type="checkbox" name="export[]" class="exportChiarimento" value="<?= $chiarimento["codice"] ?>" onchange="checkExportButtons()">
</td>
<td>
<?= $chiarimento["count"] ?>
</td>
<td>
<div id="flag_<?= $chiarimento["codice"] ?>" class="status_flag <?= $stato ?>"><span class="sr-only"><?= $stato_label ?></span></div>
</td>
<td><?= $stato_label ?></td>
<td style="position:relative">
<?= substr($chiarimento["quesito"],0,255) ?>
<?= (strlen($chiarimento["quesito"]) > 255) ? "..." : ""; ?>
</td>
<? if (empty($hideName)) { ?><td><a href='#' onClick='showCompany(<?= $chiarimento["codice_richiedente"] ?>)'><?= $chiarimento["ragione_sociale"] ?></a></td><? } ?>
<td><span class="hide collapse"><?= $chiarimento["timestamp_richiesta"] ?></span><?= mysql2datetime($chiarimento["timestamp_richiesta"]) ?></td>
<td width="10"><a href='edit.php?codice=<?= $chiarimento["codice"] ?><?= $editQueryString ?? '' ?>' title='<?= __("modifica") ?>' class='btn btn-info btn-sm'><span class='fa fa-pencil-alt'></span></a></td>
<td width="10"><? if ($chiarimento["attivo"] != "N" && !$lock) { ?><button type="button" title='<?= __("Attiva/Disattiva") ?>' class='btn btn-sm btn-warning' id="disable<?= $chiarimento["codice"] ?>" onclick='disabilita(<?= $chiarimento["codice"] ?>,"<?= $radice ?>/chiarimenti");'><span class='fa fa-sync'></span></button><? } ?></td>
</tr>
<?
}
?>
</tbody>
</table>
<script>
$("#list-chiarimenti").DataTable({
"language": {
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang"
},
"lengthMenu": [[10, 25, 50, 100], [10, 25, 50, 100]],
"order": [[0,'ASC']],
"columns": [
{ "orderable": true, "class": 'fit-width' },
{ "orderable": true, "class": 'fit-width' },
{ "orderable": true, "class": 'fit-width' },
<? if (empty($hideName)) { ?>{ "orderable": true, "class": 'fit-width' },<? } ?>
{ "orderable": false, "class": 'fit-width' },
{ "orderable": false, "class": 'fit-width' },
{ "orderable": false, "class": 'fit-width' },
{ "orderable": false, "class": 'fit-width' },
{ "orderable": false, "class": 'fit-width' }
]
});
</script>
</div>
</div>
<div class="card-footer exportButtons collapse text-right">
<button onClick="$('#format').val('pdf');" class="btn btn-danger">
<span class="fa fa-file-pdf"></span> <?= __("Esporta PDF") ?>
</button>
</div>
</div>
</form>
<?
}
?>