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.
106 righe
4.0 KiB
106 righe
4.0 KiB
<? |
|
if (isset($this) && is_a($this,"gara")) { |
|
$lotti = $this->getLotti(); |
|
if (!empty($this->printSelectLottiConditions)) { |
|
$checkInstance = clone $this; |
|
$tmp = $lotti; |
|
$lotti = []; |
|
if (!is_array($this->printSelectLottiConditions)) { |
|
$this->printSelectLottiConditions = [$this->printSelectLottiConditions]; |
|
} |
|
foreach($tmp AS $tl) { |
|
$checks = 0; |
|
foreach($this->printSelectLottiConditions AS $check) { |
|
$checkInstance->setLotto($tl["codice"]); |
|
if ($check == "hasPartecipanti" && !empty($checkInstance->getPartecipanti())) { |
|
$checks++; |
|
} |
|
if ($check == "hasPartecipantiOnline") { |
|
$checkPartecipanti = $checkInstance->getPartecipanti(); |
|
if (!empty($checkPartecipanti)) { |
|
foreach($checkPartecipanti AS $checkPar) { |
|
if (!empty($checkPar["codice_operatore"])) { |
|
$checks++; |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
if ($check == "hasVerificheAnomalie") { |
|
$checkPartecipanti = $checkInstance->getPartecipanti(); |
|
if (!empty($checkPartecipanti)) { |
|
foreach($checkPartecipanti AS $partecipante) { |
|
if ($partecipante["esclusione_automatica"] != "S" && ($partecipante["anomalia"] == "S" || $partecipante["a_verificata"] == "S")) { |
|
$checks++; |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
if ($check == "hasInvito" && !empty($checkInstance->hasInvito())) { |
|
$checks++; |
|
} |
|
if ($check == "hasAggiudicatari" && !empty($checkInstance->getAggiudicatari())) { |
|
$checks++; |
|
} |
|
if ($check == "hasAggiudicatariMultipli") { |
|
$checkPartecipanti = $checkInstance->getAggiudicatari(); |
|
$extraInfo = $checkInstance->getExtraInfo(); |
|
if (count($checkPartecipanti) > 1 || !empty($extraInfo["lotto"]["estremi_sorteggio"])) { |
|
$checks++; |
|
break; |
|
} |
|
} |
|
if ($check == "hasCriteri" && !empty($checkInstance->getCriteri())) { |
|
$checks++; |
|
} |
|
if ($check == "hasCriteriValutabili" && !empty($checkInstance->getCriteriValutabili())) { |
|
$checks++; |
|
} |
|
if ($check == "hasCriteriCommissione" && !empty($checkInstance->returnCriteri($checkInstance->round["codice"],["tipologia"=>"Q"]))) { |
|
$checks++; |
|
} |
|
} |
|
if (!empty($_SESSION["utente"]->oe) && $this->modalitaLotti() == "singola" && $this->partecipato(true)) { |
|
$partecipante = $checkInstance->miaPartecipazione(); |
|
if (empty($partecipante) || $partecipante["conferma"] != "S") { |
|
$checks--; |
|
} |
|
} |
|
if ($checks == count($this->printSelectLottiConditions)) { |
|
$lotti[] = $tl; |
|
} |
|
} |
|
unset($checkInstance); |
|
} |
|
if (!empty($lotti)) { |
|
if (count($lotti) > 1) { |
|
if ($allOption) { |
|
array_unshift($lotti,["codice"=>"","oggetto"=>__("Tutti i lotti")]); |
|
} |
|
foreach($lotti AS $lotto) { |
|
$class = "btn-primary"; |
|
$label = ""; |
|
if (!empty($stati[$lotto["codice"]])) { |
|
$class = $stati[$lotto["codice"]]["class"]; |
|
$label = $stati[$lotto["codice"]]["label"] ?? ""; |
|
} |
|
?> |
|
<a href="<?= $target ?>&codice_lotto=<?= $lotto["codice"] ?>" class="btn btn-lg btn-block <?= $class ?> my-1"> |
|
<? if (!empty($lotto["codice"])) { ?> |
|
<strong><?= __("Lotto") ?> #<?= $lotto["numero"] ?><br> |
|
<small><?= $lotto["oggetto"] ?></small> |
|
<? } else { ?> |
|
<strong><?= $lotto["oggetto"] ?></strong> |
|
<? } ?> |
|
<? if (!empty($label)) { ?><br><small><?= $label ?></small><? } ?> |
|
</a> |
|
<? |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL='.$target.'&codice_lotto='.$lotti[0]["codice"].'">'; |
|
die(); |
|
} |
|
} |
|
} |
|
?>
|