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.
100 righe
3.7 KiB
100 righe
3.7 KiB
<? |
|
if (isset($this) && is_a($this,"concorso")) { |
|
$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 == "hasInvito" && !empty($checkInstance->hasInvito($tl["codice"]))) { |
|
$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 ($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"] ?? ""; |
|
} else { |
|
if (isset($lotto["stato"])) { |
|
if ($lotto["stato"] == 95) { |
|
$class = "btn-warning"; |
|
$label = __("Lotto deserto"); |
|
} |
|
if ($lotto["stato"] == 99) { |
|
$class = "btn-warning"; |
|
$label = __("Lotto non aggiudicato"); |
|
} |
|
} |
|
} |
|
?> |
|
<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(); |
|
} |
|
} |
|
} |
|
?>
|