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.
229 righe
9.7 KiB
229 righe
9.7 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "accessoAtti"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"])) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$gara = gara::init($_GET["codice"],$codice_round); |
|
if (!empty($gara)) { |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$titolo_modulo = __($cmd_info["titolo"]); |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/".$radice."/panel.php?codice=".$record["codice"]."&codice_round=".$round["codice"]] = __("Pannello"); |
|
$breadcrumb[""] = $titolo_modulo; |
|
|
|
include_once ($beRoot."/layout/top.php"); |
|
?> |
|
<h1> |
|
<?= $titolo_modulo ?> |
|
</h1> |
|
<? |
|
if ($gara->chooseLotto($_GET["codice_lotto"] ?? false,"{$_SERVER["PHP_SELF"]}?codice=".$record["codice"]."&codice_round=".$round["codice"])) { |
|
$lotto = $gara->lotto; |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
$showAtti = $gara->pubblicaAtti(); |
|
if ($showAtti) { |
|
$labelAtti = "Nascondi atti"; |
|
$btnAtti = "btn-danger"; |
|
} else { |
|
$labelAtti = "Pubblica atti"; |
|
$btnAtti = "btn-primary"; |
|
} |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-body text-right"> |
|
<? if (!$lock) { ?> |
|
<button type="button" onClick="visualizzaAtti()" class="btn ignore-lock <?= $btnAtti ?>" title="<?= $labelAtti ?>"><span class="fa fa-eye"></span> <?= $labelAtti ?></button> |
|
<? } ?> |
|
<? |
|
if ($showAtti) { |
|
alertManager::printSuccessBox(__("Gli atti sono visibili")); |
|
} else { |
|
alertManager::printAlertBox(__("Gli atti non sono visibili")); |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
ob_start(); |
|
filesManager::printList($round["codice"],"gare-accessoatti"); |
|
$allegatiGenerali = trim(ob_get_clean()); |
|
if (!empty($allegatiGenerali)) { |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-header"> |
|
<span class="card-title h3"><?= __("Atti generali") ?></span> |
|
</div> |
|
<div class="card-body"><?= $allegatiGenerali ?></div> |
|
</div> |
|
<? |
|
} |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-header"> |
|
<span class="card-title h3"><?= __("Atti lotto") ?></span> |
|
</div> |
|
<div class="card-body"> |
|
<div class="row"> |
|
<? if (!$lock) { ?> |
|
<div class="col-12"> |
|
<form rel="validate" method="post" action="attach.php" id="edit-form"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice" value="<?= $record["codice"] ?>"> |
|
<input id="codice_lotto" type="hidden" name="codice_lotto" value="<?= $lotto["codice"] ?>"> |
|
<input id="codice_round" type="hidden" name="codice_round" value="<?= $round["codice"] ?>"> |
|
<? |
|
filesManager::printForm("accessoatti-lotto"); |
|
?> |
|
<button type="submit" class="btn btn-block btn-success my-2"><?= __("Allega") ?></button> |
|
</form> |
|
</div> |
|
<? } ?> |
|
<div class="col-12"> |
|
<? |
|
filesManager::printList($gara->lotto["codice"],"gare-accessoatti-lotto"); |
|
?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
$busteAccesso = $gara->getBusteSoggetteAccesso(); |
|
$richieste = $gara->getRichiestePubblicabili(); |
|
if (!empty($busteAccesso)) { |
|
?> |
|
<div class="card"> |
|
<div class="card-header"> |
|
<h3><?= __("Buste Atti") ?></h3> |
|
</div> |
|
<div class="card-body p-0"> |
|
<table class="m-0 table table-striped"> |
|
<thead> |
|
<tr> |
|
<th><?= __("Partecipante") ?></th> |
|
<? foreach($richieste AS $richiesta) { ?> |
|
<th class="text-center"><?= $richiesta["titolo"] ?></th> |
|
<? } ?> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
<? |
|
foreach($busteAccesso as $partecipante => $buste) { |
|
$partecipante = $gara->getPartecipante($partecipante); |
|
?> |
|
<tr> |
|
<td><?= $partecipante["ragione_sociale"] ?></td> |
|
<? foreach($richieste AS $richiesta) { |
|
$busta = $buste[$richiesta["codice"]] ?? null; |
|
if (!empty($busta)) { |
|
$buttons = ""; |
|
$button = "<button onClick='modificaVisualizzazioneBusta({$busta["codice_richiesta"]},{$busta["codice_partecipante"]},--ESITO--)' class='btn btn-block my-1 btn-sm btn---COLOR--'>--LABEL--</button>"; |
|
if ($busta["pubblica"] == "S") { |
|
$icon = "check"; |
|
$label = "Pubblicato"; |
|
$color = "success"; |
|
$buttons = strtr($button,["--ESITO--"=>0,"--COLOR--"=>"danger","--LABEL--"=>"Nascondi"]); |
|
} else if ($busta["pubblica"] == "N") { |
|
$icon = "ban"; |
|
$label = "Non pubblicato"; |
|
$color = "danger"; |
|
$buttons = strtr($button,["--ESITO--"=>1,"--COLOR--"=>"success","--LABEL--"=>"Pubblica"]); |
|
} else { |
|
$icon = "exclamation-triangle"; |
|
$label = "In attesa"; |
|
$color = "warning"; |
|
$buttons = strtr($button,["--ESITO--"=>1,"--COLOR--"=>"success","--LABEL--"=>"Pubblica"]); |
|
$buttons .= strtr($button,["--ESITO--"=>0,"--COLOR--"=>"danger","--LABEL--"=>"Nascondi"]); |
|
} |
|
?> |
|
<td class="text-center"> |
|
<div class="d-none" id="buttons-<?= $busta["codice"] ?>"><p><?= $buttons ?></p></div> |
|
<button data-toggle="popover" data-id="<?= $busta["codice"] ?>" type="button" class="bustaCmd btn btn-<?= $color ?>"><span class="fa fa-<?= $icon ?>"></span> <?= __($label) ?></button> |
|
</td> |
|
<? |
|
} else { |
|
?> |
|
<td class="text-center"> |
|
<?= __("Non presentata") ?> |
|
</td> |
|
<? |
|
} |
|
} |
|
?> |
|
</tr> |
|
<? |
|
} |
|
?> |
|
</tbody> |
|
</table> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
if (!$lock) { ?> |
|
<script> |
|
const dataGara = "codice_gara=<?= $gara->info["codice"] ?>&codice_lotto=<?= $gara->lotto["codice"] ?>&codice_round=<?= $gara->round["codice"] ?>&token=<?= tokenGen() ?>"; |
|
function visualizzaAtti() { |
|
Swal({ |
|
title: js_dict["sei-sicuro"], |
|
text: js_dict["msg-conferma"], |
|
type: "warning", |
|
showCancelButton: true, |
|
confirmButtonColor: '#3085d6', |
|
cancelButtonColor: '#d33', |
|
confirmButtonText: js_dict.conferma, |
|
cancelButtonText: js_dict.annulla, |
|
closeOnConfirm: true |
|
}).then((result) => { |
|
if (result.value) { |
|
$.ajax({ |
|
type: "POST", |
|
url: "/backend/gare/accesso/toggle.php", |
|
data: dataGara, |
|
dataType: "script", |
|
success: function(result) { |
|
result; |
|
}, |
|
error: function() { |
|
swal(js_dict["error-retry"]); |
|
} |
|
}); |
|
} |
|
}); |
|
} |
|
function modificaVisualizzazioneBusta(richiesta,partecipante,esito) { |
|
let data = dataGara; |
|
data += "&esito=" + esito; |
|
data += "&richiesta=" + richiesta; |
|
data += "&partecipante=" + partecipante; |
|
confirmBeforeSubmit(richiesta,'/backend/gare/accesso/toggleBusta.php',data); |
|
} |
|
$(".bustaCmd").each(function(i,el) { |
|
$(el).popover({ |
|
placement:"top", |
|
title: "<?= __("Modifica visibilità") ?>", |
|
container: 'body', |
|
sanitize: false, |
|
content: $("#buttons-"+$(el).data("id")).html(), |
|
html:true |
|
}); |
|
}); |
|
</script> |
|
|
|
<? } else { ?> |
|
<script>$(":input").not(".ignore-lock").attr("disabled","disabled").trigger("chosen:updated");</script> |
|
<? } |
|
} |
|
include_once ($beRoot."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|