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.
188 righe
6.7 KiB
188 righe
6.7 KiB
<?php |
|
define('_ELENCHI_API', 1); |
|
require_once(__DIR__ . "/inc/init.php"); |
|
|
|
$allowedFilters = json_decode(tuttogare_api_call("{$endpoint['endpoint']}/getFiltriAlbo?codice={$key}", $endpoint["token"]), true) ?? []; |
|
$elenco = json_decode(tuttogare_api_call("{$endpoint['endpoint']}/getAlbi?codice={$key}", $endpoint["token"]), true) ?? []; |
|
|
|
if(empty($elenco)) { |
|
die_forbidden(); |
|
} |
|
|
|
$breadcrumb[""] = $elenco[0]["oggetto"]; |
|
|
|
$showFilterButton = false; |
|
foreach ($allowedFilters as $filterName => $filterValue) { |
|
if ($filterName == "search") continue; |
|
if (!isset(publicElenchi::VALID_API_FILTERS[$filterName])) { |
|
continue; |
|
} |
|
if (!($filterValue["available"] ?? false)) { |
|
continue; |
|
} |
|
$showFilterButton = true; |
|
break; |
|
} |
|
|
|
if (!$isModal) { |
|
include_once "{$beRoot}/layout/top.php"; |
|
} |
|
|
|
?> |
|
|
|
|
|
<h3><i class="fa fa-list mr-2"></i><?= $elenco[0]["oggetto"] ?></h3> |
|
<h5>Dall'endpoint <?= $endpoint["displayName"] ?></h5> |
|
</div> |
|
<div class="text-right mb-2"> |
|
|
|
<div class="btn-group"> |
|
<?php if ($showFilterButton) : ?> |
|
<button data-toggle="modal" id="show-filter" data-target="#modal-filter" class="btn btn-warning"> |
|
<i class="fa fa-filter"></i> |
|
<?= __("filtra"); ?> |
|
</button> |
|
<?php endif; ?> |
|
<button id="oe-filter-button" onClick="window.location.reload();" class="btn btn-danger collapse"> |
|
<i class="fa fa-times"></i> |
|
</button> |
|
</div> |
|
</div> |
|
<div class="card"> |
|
<?php if ($showFilterButton) : ?> |
|
<div class="card-header"> |
|
|
|
<div id="oeManager-showfiltriApplicati" class="text-right"> |
|
|
|
</div> |
|
</div> |
|
<?php endif; ?> |
|
<div class="card-body"> |
|
<div class="table-responsive"> |
|
<table class="table table-striped table-hover table-condensed" id="tab-data-partecipanti-remoti" width="100%"> |
|
<thead> |
|
<tr> |
|
<th width="10">#</th> |
|
<th width="110"><?= __("Codice Fiscale") ?></th> |
|
<th><?= __("Denominazione") ?></th> |
|
<th><?= __("PEC") ?></th> |
|
<?php if ($modulo_riferimento === "gare") : ?> |
|
<th><?= __("Invita") ?></th> |
|
<?php endif; ?> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
</tbody> |
|
</table> |
|
</div> |
|
<script> |
|
var table = $("#tab-data-partecipanti-remoti").DataTable({ |
|
"processing": true, |
|
"serverSide": true, |
|
"language": { |
|
"url": "/dictionary/datatables/<?= $_SESSION["language"] ?>.lang" |
|
}, |
|
"ajax": { |
|
"url": "/backend/elenchi_api/table.php", |
|
"method": "POST", |
|
"data": function(d) { |
|
d.filters = $("#filtriTabella").serialize() |
|
d.endpoint = `<?= $endpoint_name ?>` |
|
d.key = `<?= $key ?>` |
|
d.type = `<?= $type ?>` |
|
d.modulo_riferimento = `<?= $modulo_riferimento ?>` |
|
<?php if ($modulo_riferimento == "gare") : ?> |
|
d.codice_gara = `<?= $codice_gara ?>` |
|
d.codice_lotto = `<?= $codice_lotto ?>` |
|
<?php endif; ?> |
|
} |
|
}, |
|
"order": [ |
|
[2, 'asc'] |
|
], |
|
"columns": [{ |
|
"orderable": false, |
|
"class": 'fit-width' |
|
}, |
|
{ |
|
"orderable": true, |
|
"class": 'fit-width' |
|
}, |
|
{ |
|
"orderable": true, |
|
"class": 'fit-width' |
|
}, |
|
{ |
|
"orderable": true, |
|
"class": 'fit-width' |
|
}, |
|
<?php if ($modulo_riferimento === "gare") : ?> { |
|
"orderable": false, |
|
"class": 'fit-width' |
|
} |
|
<?php endif; ?> |
|
] |
|
}); |
|
</script> |
|
<?php if ($modulo_riferimento === "gare") : ?> |
|
<script> |
|
function invitaRemoto(cf, nome, pec) { |
|
let data = {}; |
|
data.codice_gara = `<?= $codice_gara ?>`; |
|
data.codice_lotto = `<?= $codice_lotto ?>`; |
|
data.codice_fiscale = cf; |
|
data.ragione_sociale = nome; |
|
data.pec = pec; |
|
$.ajax({ |
|
type: "POST", |
|
url: "/backend/gare/inviti/save-remote.php", |
|
data: data, |
|
dataType: "script", |
|
success: function(result) { |
|
result; |
|
$("#tab-data-partecipanti-remoti").DataTable().ajax.reload(); |
|
}, |
|
error: function() { |
|
swal(js_dict["error-retry"]); |
|
} |
|
}); |
|
} |
|
</script> |
|
<?php endif; ?> |
|
</div> |
|
</div> |
|
<!-- Modal --> |
|
|
|
<!-- Modal --> |
|
<?php if ($showFilterButton) : ?> |
|
<div class="modal fade" id="modal-filter" tabindex="-1" role="dialog" aria-hidden="true"> |
|
<div class="modal-dialog modal-xl" role="document"> |
|
<div class="modal-content"> |
|
<div class="modal-header"> |
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
<span aria-hidden="true">×</span> |
|
</button> |
|
</div> |
|
<div class="modal-body"> |
|
<form id="filtriTabella"> |
|
<? |
|
include("{$beRoot}/operatori_economici/filter/form_dynamic.php"); |
|
?> |
|
</form> |
|
<script> |
|
printFilterList('oeManager-showfiltriApplicati'); |
|
</script> |
|
</div> |
|
<div class="modal-footer"> |
|
<button type="button" data-dismiss="modal" class="btn btn-block btn-success" onClick="table.draw(); printFilterList('oeManager-showfiltriApplicati'); $('#oe-filter-button').slideDown();"><?= __("Applica filtro") ?></button> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<?php endif; ?> |
|
<?php |
|
if (!$isModal) { |
|
include_once "{$beRoot}/layout/bottom.php"; |
|
} |
|
?>
|