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.
54 righe
2.4 KiB
54 righe
2.4 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
$id_modulo = "contratti"; |
|
$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_gara"],$id_modulo) && tokenVerify()) { |
|
if (!empty($_POST["partecipante"])) { |
|
$gara = gara::init($_POST["codice_gara"],$_POST["codice_round"]); |
|
if (!empty($gara) && $gara->setLotto($_POST["codice_lotto"])) { |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
if (!$lock) { |
|
$operatori = []; |
|
$aggiudicazione = $gara->getImportoAggiudicazionePartecipanti(); |
|
$partecipanti = $gara->getPartecipanti(); |
|
foreach($partecipanti AS $partecipante) { |
|
if (in_array($partecipante["codice"],$_POST["partecipante"]) !== false) { |
|
$operatori[] = $partecipante["codice_operatore"]; |
|
$importo = $aggiudicazione[$partecipante["codice"]]["offerta"] ?? 0; |
|
} |
|
} |
|
if (!empty($operatori)) { |
|
$data["modalita"] = "scrittura_privata"; |
|
$data["tipologia"] = 2; |
|
$data["oggetto"] = $gara->info["oggetto"] . " - " . __("Lotto") . " " . $gara->lotto["numero"] . " - " . $gara->lotto["oggetto"]; |
|
$data["codice_pec"] = $gara->info["codice_pec"]; |
|
$data["codice_ente"] = $gara->info["codice_ente"]; |
|
$data["importo_totale"] = (count($operatori) === 1) ? $importo : 0; |
|
$data["cig"] = $gara->lotto["cig"]; |
|
$data["cup"] = $gara->lotto["cup"]; |
|
$data["modulo_origine"] = "gare"; |
|
$data["codice_elemento"] = $gara->lotto["codice"]; |
|
$contratto = stipula::saveContratto($data,$operatori); |
|
if (!empty($contratto)) { |
|
$error = false; |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.href="/backend/contratti/edit.php?codice=<?= $contratto ?>" }); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
} else { |
|
?> |
|
swal({title:js_dict.error,html:"<?= __("Selezionare almeno un operatore economico") ?>",type:"error"}); |
|
<? |
|
die(); |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|