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.
63 righe
2.4 KiB
63 righe
2.4 KiB
<?php |
|
if (!empty($gara) && $gara->usaGraduatoria()) { |
|
$status = "status-border-danger"; |
|
$checkLotti = $gara->getLotti(); |
|
$ok = 0; |
|
$totaleLotti = count($checkLotti); |
|
if (!empty($checkLotti)) { |
|
foreach($checkLotti AS $checkLotto) { |
|
if (in_array($checkLotto["stato"],gara::statiTermineProcedura()) === false) { |
|
$hrefLotto = $hrefComando . "&codice_lotto=" . $checkLotto["codice"]; |
|
if ($gara->setLotto($checkLotto["codice"])) { |
|
$criteri = $gara->getMacroCriteri(); |
|
if (!empty($criteri)) { |
|
$status = "status-border-warning"; |
|
$somma = 0; |
|
foreach($criteri AS $criterio) { |
|
$sub = true; |
|
$subCriteri = $gara->getSubCriteri($criterio["codice"]); |
|
if (!empty($subCriteri)) { |
|
$sub = false; |
|
$ss = 0; |
|
foreach($subCriteri AS $s) { |
|
$ss += $s["peso"]; |
|
} |
|
if ($ss == $criterio["peso"]) { $sub = true; } |
|
} |
|
if (!$sub) { $somma -= 999; } |
|
$somma += $criterio["peso"]; |
|
if ($criterio["tipologia"] == "E" && !empty($criterio["auto"]) && empty($gara->getElencoPrezzi($criterio["codice"]))) { |
|
$somma -= 10000; |
|
} |
|
} |
|
if ($somma == 100) { |
|
$ok++; |
|
} else { |
|
if ($somma < 0) { |
|
if ($somma < -999) { |
|
$somma = __("Elenco prezzi mancante"); |
|
} else { |
|
$somma = __("Errore nei subcriteri"); |
|
} |
|
} else { |
|
$somma = "{$somma} / 100"; |
|
} |
|
$alertManager->addDangerAlert(__("Configurazione criteri errata per lotto") . ": #{$checkLotto["numero"]} - {$somma}" ,$hrefLotto); |
|
} |
|
} else { |
|
$alertManager->addDangerAlert(__("Nessun criterio specificato per il lotto") . ": #{$checkLotto["numero"]}",$hrefLotto); |
|
} |
|
} else { |
|
$alertManager->addDangerAlert(__("Errore inizializzazione lotto") . ": #{$checkLotto["numero"]}",$hrefComando); |
|
break; |
|
} |
|
} else { |
|
$ok++; |
|
} |
|
} |
|
if ($ok === $totaleLotti) { |
|
$status = "status-border-success"; |
|
} |
|
} |
|
} |
|
?>
|