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.
 
 
 
 
 

153 righe
8.7 KiB

<?
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$id_modulo = "open";
$cmd_info = concorso::getInfoModulo($id_modulo);
$error = true;
if (!empty($_SESSION["utente"]) && !empty($_GET["codice_lotto"])
&& (
$_SESSION["utente"]->permission($cmd_info["modulo_riferimento"],$_GET["codice"],$id_modulo)
|| (!empty($_GET["valutazione"]) && !empty($_GET["codice_round"]))
)
&& !empty($_GET["partecipante"])
&& !empty($_GET["busta"])) {
if (empty($_GET["valutazione"])) {
$valutazione = NULL;
$codice_round = $_GET["codice_round"] ?? NULL;
} else {
$valutazione = "commissione";
$codice_round = $_GET["codice_round"];
}
$concorso = concorso::init($_GET["codice"],$codice_round,$valutazione);
if (!empty($concorso) && $concorso->setLotto($_GET["codice_lotto"])) {
$record = $concorso->info;
$round = $concorso->round;
$lotto = $concorso->lotto;
$lock = $concorso->checkLock($cmd_info["id"]);
$partecipante = $concorso->getPartecipante($_GET["partecipante"]);
if (!empty($partecipante)) {
$richieste = $concorso->getRichieste($_GET["busta"]);
if (!empty($richieste)) {
foreach($richieste AS $tmp) {
if ($tmp["controllo"] != "N") {
$richiesta = $tmp;
}
}
$error = false;
if (empty($richiesta) || $concorso->checkOpeningPermission($partecipante["codice"],$richiesta["codice"])) {
$unlock = false;
?>
<div id="keyTool" class="float-right text-center">
<div class="showKeySelect">
<?= __("Seleziona chiave") ?><br>
<input type="file" id="chiave-show" title="<?= __("chiave privata") ?>" rel="S;0;0;F"/>
</div>
<div class="showKeyOk">
<div class="alert alert-success">
<span class="fa fa-key"></span> <?= __("Chiave caricata") ?>
<button type="button" onClick='$("#chiave").val("");$("#private").val("");$(".private").val("");$(".showKeySelect").slideDown();$(".showKeyOk").slideUp();' title="<?= __("Rimuovi chiave") ?>" class="btn btn-sm btn-danger"><span class="fa fa-times"></span></button>
</div>
</div>
</div>
<h2><?= $partecipante["id"] ?></h2>
<div class="table-responsive">
<table class="table table-striped table-hover">
<?
foreach($richieste AS $richiesta) {
$infoBusta = $concorso->getBusta($partecipante["codice"],$richiesta["codice"]);
?>
<tr>
<td><?= $richiesta["titolo"] ?></td>
<td class="text-center" width="20%">
<?
if (!empty($infoBusta)) {
$p7mtype = false;
$icon = "download";
$label = "Scarica documento";
addBypassCheckURL("/backend/concorsi/open/decrypt.php");
if ($infoBusta["mime"]=="application/octet-stream" && substr($infoBusta["nomeFile"], -3) == "p7m") {
$icon = "file-signature";
$label = "Scarica P7M";
$p7mtype = true;
}
if ($infoBusta["open"] == "N") { $unlock = true; }
?>
<form id="form-<?= $richiesta["codice"] ?>-<?= $partecipante["codice"] ?>" class="m-0 p-0" method="POST" action="/backend/concorsi/open/decrypt.php" rel="validate" <? if ($infoBusta["open"] == "S") { ?>target="_blank"<? } ?>>
<input type="hidden" name="token" value="<?= tokenGen() ?>">
<input type="hidden" name="codice" value="<?= $record["codice"] ?>">
<input type="hidden" name="codice_round" value="<?= $round["codice"] ?>">
<input type="hidden" name="codice_lotto" value="<?= $lotto["codice"] ?>">
<? if ($valutazione) { ?><input type="hidden" name="valutazione" value="true"><? } ?>
<input type="hidden" name="openP7M" value="N" id="openP7M-<?= $richiesta["codice"] ?>-<?= $partecipante["codice"] ?>">
<? if ($infoBusta["open"] == "N") { ?><input type="hidden" name="private" title="<?= __("chiave privata") ?>" class="private" rel="S;0;0;A"><? } ?>
<input type="hidden" name="partecipante" value="<?= $partecipante["codice"] ?>">
<input type="hidden" name="richiesta" value="<?= $richiesta["codice"] ?>">
<button id="btn-<?= $richiesta["codice"] ?>-<?= $partecipante["codice"] ?>" onclick="$('#openP7M-<?= $richiesta["codice"] ?>-<?= $partecipante["codice"] ?>').val('N');" class="btn mb-1 btn-block btn-sm btn-<?= ($infoBusta["open"] == "S") ? "success" : "danger" ?>">
<span class="fa fa-<?= ($infoBusta["open"] == "S") ? $icon : "lock" ?>"></span> <?= ($infoBusta["open"] == "S") ? __($label) : __("Apri") ?>
</button>
<div class="<?= ($p7mtype) ? "btn-group" : "" ?> mb-1 <?= ($infoBusta["open"] == "S") ? "d-flex" : "" ?>" id="p7m-operation-<?= $richiesta["codice"] ?>-<?= $partecipante["codice"] ?>" <?if ($infoBusta["open"] == "N") { echo 'style="display:none"'; } ?>>
<?
if ($p7mtype) {
?><button class="btn btn-block btn-sm btn-primary" onclick="$('#openP7M-<?= $richiesta["codice"] ?>-<?= $partecipante["codice"] ?>').val('S');"><span class="fa fa-file-export"></span> <?= __("estrai contenuto") ?></button><?
}
$infoPathModal = "/backend/concorsi/open/info.php?codice={$record["codice"]}&codice_round={$round["codice"]}&codice_lotto={$lotto["codice"]}" . (($valutazione) ? "&valutazione=true" : "") . "&token=" . tokenGen() . "&partecipante={$partecipante["codice"]}&richiesta={$richiesta["codice"]}";
addBypassCheckURL($infoPathModal);
?>
<button type="button" class="btn <?= (!$p7mtype) ? "btn-block" : "" ?> { btn-sm btn-info" onclick="showModalWithURL('<?= $infoPathModal ?>'); return false;">
<span class="fa fa-info-circle"></span> <?= (!$p7mtype) ? __("Informazioni") : "" ?>
</button>
<div class="clearfix"></div>
</div>
</form>
<?
if ($infoBusta["open"] == "S" && $richiesta["locked"] == "S") {
$infoFormModal = "/backend/concorsi/open/form.php?codice={$record["codice"]}&codice_round={$round["codice"]}&codice_lotto={$lotto["codice"]}" . (($valutazione) ? "&valutazione=true" : "") . "&token=" . tokenGen() . "&partecipante={$partecipante["codice"]}&richiesta={$richiesta["codice"]}";
addBypassCheckURL($infoFormModal);
?>
<button type="button" class="btn mb-1 btn-block btn-sm btn-warning" onclick="showModalWithURL('<?= $infoFormModal ?>'); return false;">
<span class="fa fa-search"></span> <?= __("Visualizza form") ?>
</button>
<?
}
} else {
echo __("Non presentato");
}
?>
</td>
</tr>
<?
}
?>
</table>
<script>
<? if ($unlock) { ?>
if ($("#private").val() != "") {
$(".showKeySelect").hide();
$(".private").val($("#private").val());
} else {
$(".showKeyOk").hide();
}
document.getElementById("chiave-show").addEventListener('change', handleFileSelect, false);
<? } else { ?>
$("#keyTool").hide();
<? } ?>
</script>
</div>
<?
} else {
?>
<div class="alert alert-danger text-center">
<span class="fa fa-exclamation-triangle fa-5x"></span><br>
<strong><?= __("Impossibile procedere") ?></strong>
</div>
<?
}
}
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}