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.
84 righe
3.7 KiB
84 righe
3.7 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
$id_modulo = "provvisoria"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_POST) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_POST["codice"],$id_modulo) && tokenVerify() && $_POST["codice_lotto"]) { |
|
$gara = gara::init($_POST["codice"],$_POST["codice_round"]); |
|
if (!empty($gara) && $gara->setLotto($_POST["codice_lotto"])) { |
|
$record = $gara->info; |
|
$lotto = $gara->lotto; |
|
$round = $gara->round; |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
if (!$lock) { |
|
$errori = ""; |
|
if (!empty($_POST["punteggio"])) { |
|
$salva = new salva(); |
|
$salva->debug = false; |
|
|
|
foreach($_POST["punteggio"] AS $codice_partecipante => $punteggi) { |
|
$sql = "SELECT * FROM r_partecipanti_gare WHERE codice = :codice_partecipante AND codice_round = :codice "; |
|
$ris = $pdo->go($sql,array(":codice_partecipante"=>$codice_partecipante,":codice"=>$round["codice"])); |
|
if ($ris->rowCount() == 1) { |
|
$partecipante = $ris->fetch(PDO::FETCH_ASSOC); |
|
$save = false; |
|
$totale = null; |
|
if (isset($punteggi["tecnico"]) && $punteggi["tecnico"] !== "") { |
|
if (!isset($totale)) { |
|
$totale = 0; |
|
} |
|
$totale += $punteggi["tecnico"]; |
|
if ($partecipante["totaleTecnico"] != $punteggi["tecnico"]) { |
|
$save = true; |
|
$partecipante["totaleTecnico"] = $punteggi["tecnico"]; |
|
} |
|
} |
|
if (isset($punteggi["economico"]) && $punteggi["economico"] !== "") { |
|
if (!isset($totale)) { |
|
$totale = 0; |
|
} |
|
$totale += $punteggi["economico"]; |
|
if ($partecipante["totaleEconomico"] != $punteggi["economico"]) { |
|
$save = true; |
|
$partecipante["totaleEconomico"] = $punteggi["economico"]; |
|
} |
|
} |
|
if (isset($totale) && $partecipante["totale"] != $totale) { |
|
$save = true; |
|
} |
|
if($save) { |
|
$partecipante["totale"] = $totale; |
|
$salva->nome_tabella = "r_partecipanti_gare"; |
|
$salva->operazione = "UPDATE"; |
|
$salva->oggetto = $partecipante; |
|
if ($salva->save() === false) { $errori = __("Errore nel salvataggio dei punteggi"); } |
|
} |
|
} |
|
} |
|
$gara->checkSoglie(); |
|
} |
|
$error = false; |
|
if (empty($errori)) { |
|
$gara->updatePartecipantiANAC(); |
|
$action = "window.location.href=\"/backend/gare/panel.php?codice={$gara->info["codice"]}&codice_round={$gara->round["codice"]}\";"; |
|
$gara->addToLog("UPDATE",__("Valutazione") . " " . __("Lotto") . " " . $gara->lotto["numero"]); |
|
if ($_POST["aggiudica"] == "S") { |
|
$action = "showModalWithURL('/backend/gare/provvisoria/dialog-proposta.php?codice={$gara->info["codice"]}&codice_round={$gara->round["codice"]}&codice_lotto={$gara->lotto["codice"]}');"; |
|
} |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ <?= $action ?>; }); |
|
<? |
|
} else { |
|
?> |
|
swal({title:js_dict["success-msg"],html:"<?= $errori ?>",type:"warning"}).then(function(){ window.location.reload(); }); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|