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.
164 righe
7.2 KiB
164 righe
7.2 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "open"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && !empty($_GET["codice_lotto"])) { |
|
$codice_round = $_GET["codice_round"] ?? NULL; |
|
$gara = gara::init($_GET["codice"],$codice_round); |
|
if (!empty($gara) && $gara->setLotto($_GET["codice_lotto"])) { |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$lotto = $gara->lotto; |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
$error = false; |
|
$partecipanti = $gara->getPartecipanti(); |
|
$return = array(); |
|
$return["draw"] = (int)$_GET["draw"]; |
|
$return["recordsTotal"] = (int)0; |
|
$return["recordsFiltered"] = (int)0; |
|
$return["data"] = []; |
|
if (count($partecipanti) > 0) { |
|
$return["recordsTotal"] = count($partecipanti); |
|
$return["recordsFiltered"] = count($partecipanti); |
|
$tipiBuste = gara::tipologieBusta(); |
|
$i = 0; |
|
$richieste = []; |
|
foreach($partecipanti AS $partecipante) { |
|
$i++; |
|
$row = []; |
|
$row[] = $i; |
|
$row[] = $partecipante["codice_fiscale"]; |
|
ob_start(); |
|
if(!empty($partecipante["codice_operatore"])) { ?> |
|
<a href="#" title="<?= __("visualizza") ?>" onclick="showCompany(<?= $partecipante["codice_operatore"] ?>); return false"> |
|
<? } ?> |
|
<strong><?= $partecipante["ragione_sociale"] ?></strong> |
|
<? if(!empty($partecipante["codice_operatore"])) { ?></a><? } |
|
$row[] = ob_get_clean(); |
|
reset($tipiBuste); |
|
foreach($tipiBuste AS $id_busta => $busta) { |
|
$label_locked = "Bloccata"; |
|
$color_locked = "warning"; |
|
$icon_locked = "lock"; |
|
if ($partecipante["escluso"] == "S") { |
|
$label_locked = "Non ammesso"; |
|
$color_locked = "disabled"; |
|
$icon_locked = "ban"; |
|
} |
|
if (!isset($richieste[$id_busta])) { |
|
$richieste[$id_busta] = $gara->getRichieste($id_busta); |
|
} |
|
if (!empty($richieste[$id_busta])) { |
|
ob_start(); |
|
reset($richieste[$id_busta]); |
|
$block = false; |
|
$aperte = 0; |
|
$presenti = 0; |
|
$emendamenti = false; |
|
$oscuramenti = false; |
|
$labelEmendamenti = "<span class=\"fa fa-check\"></span>" . __("Emendamenti gestiti"); |
|
$classEmendamenti = "success"; |
|
$labelOscuramenti = "<span class=\"fa fa-check\"></span>" . __("Oscuramenti gestiti"); |
|
$classOscuramenti = "success"; |
|
foreach($richieste[$id_busta] AS $richiesta) { |
|
$busta = $gara->getBusta($partecipante["codice"],$richiesta["codice"]); |
|
if (!empty($busta)) { |
|
if ($busta["segreta"] == "S") { |
|
$secretata = $gara->getBustaSecretata($partecipante["codice"],$richiesta["codice"],"busta"); |
|
if (!empty($secretata)) { |
|
$oscuramenti = true; |
|
if ($secretata["accettata"] == "W") { |
|
$labelOscuramenti = "<span class=\"fa fa-exclamation\"></span>" . __("Oscuramenti richiesti"); |
|
$classOscuramenti = "warning"; |
|
} |
|
} |
|
} |
|
$emendamento = $gara->getEmendamento($partecipante["codice"],$richiesta["codice"]); |
|
if (!empty($emendamento)) { |
|
if ($emendamento["segreta"] == "S") { |
|
$tmp = $gara->getBustaSecretata($partecipante["codice"],$richiesta["codice"],"emendamento"); |
|
if (!empty($tmp)) { |
|
$secretata = $tmp; |
|
} else { |
|
$emendamento = null; |
|
} |
|
} |
|
if (!empty($emendamento)) { |
|
$emendamenti = true; |
|
if ($emendamento["accettata"] == "W") { |
|
$labelEmendamenti = "<span class=\"fa fa-exclamation\"></span>" . __("Emendamenti richiesti"); |
|
$classEmendamenti = "warning"; |
|
if (!empty($secretata)) { |
|
$oscuramenti = true; |
|
if ($secretata["accettata"] == "W") { |
|
$labelOscuramenti = "<span class=\"fa fa-exclamation\"></span>" . __("Oscuramenti richiesti"); |
|
$classOscuramenti = "warning"; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (!$block) { |
|
$block = !$gara->checkOpeningPermission($partecipante["codice"],$richiesta["codice"]); |
|
} |
|
$presenti++; |
|
if ($busta["open"] == "S") { |
|
$aperte++; |
|
} |
|
} |
|
} |
|
if ($presenti > 0) { |
|
if ($aperte == $presenti) { |
|
$bg_open = "info"; |
|
$label_open = "Visualizza"; |
|
$icon_open = "folder-open"; |
|
} else { |
|
$icon_open = "unlock"; |
|
if ($aperte > 0) { |
|
$bg_open = "primary"; |
|
$label_open = "Continua"; |
|
} else { |
|
$bg_open = "success"; |
|
$label_open = "Apri"; |
|
} |
|
} |
|
} else { |
|
$block = true; |
|
$label_locked = "Vuota"; |
|
$color_locked = "disabled"; |
|
$icon_locked = "circle"; |
|
} |
|
?><button |
|
class="btn btn-block btn-sm btn-<?= ($block) ? $color_locked : $bg_open ?>" |
|
<? if (!$block) { ?> |
|
onClick="showModalWithURL('show.php?codice=<?= $record["codice"] ?>&codice_round=<?= $round["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?>&partecipante=<?= $partecipante["codice"] ?>&busta=<?= $id_busta ?>')" |
|
<? } ?> |
|
> |
|
<span class="fa fa-<?= ($block) ? $icon_locked : $icon_open ?>"></span> <?= __(($block) ? $label_locked : $label_open) ?> |
|
|
|
<? if ($emendamenti) { ?> |
|
<small class="d-block my-1 p-1 bg-<?= $classEmendamenti ?> text-white"> |
|
<?= $labelEmendamenti ?> |
|
</small> |
|
<? } ?> |
|
<? if ($oscuramenti) { ?> |
|
<small class="d-block my-1 p-1 bg-<?= $classOscuramenti ?> text-white"> |
|
<?= $labelOscuramenti ?> |
|
</small> |
|
<? } ?> |
|
</button><? |
|
$row[] = ob_get_clean(); |
|
} |
|
} |
|
$return["data"][] = $row; |
|
} |
|
} |
|
echo json_encode($return); |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
}
|