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.
118 righe
4.8 KiB
118 righe
4.8 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && !empty($_POST["codice_lotto"])) { |
|
$gara = publicGara::init($_POST["codice_gara"]); |
|
if (!empty($gara)) { |
|
if ($gara->setLotto($_POST["codice_lotto"])) { |
|
$record = $gara->info; |
|
$lotto = $gara->lotto; |
|
$round = $gara->round; |
|
|
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb["/".$radice."/dettaglio.php?codice={$record["codice"]}&codice_lotto={$lotto["codice"]}"] = __("Dettaglio"); |
|
$breadcrumb["partecipa.php?codice={$record["codice"]}&codice_lotto={$lotto["codice"]}"] = __("Pannello"); |
|
$breadcrumb[] = __("Salva avvalimento"); |
|
|
|
include_once ($root."/layout/top.php"); |
|
?> |
|
<div class="container"> |
|
<? |
|
if ($gara->partecipazioneAttiva()) { |
|
?> |
|
<h3><?= $record["oggetto"] ?></h3> |
|
<? |
|
$partecipante = $gara->miaPartecipazione(); |
|
if (!empty($partecipante)) { |
|
if ($partecipante["conferma"]=="S") { |
|
if ($gara->revoca() != false) { |
|
$partecipante = $gara->miaPartecipazione(); |
|
} |
|
} |
|
} else { |
|
$partecipante = $gara->savePartecipante(); |
|
} |
|
|
|
$sql = "DELETE FROM b_offerte_gare WHERE codice_partecipante = :codice_partecipante "; |
|
$ris = $pdo->go($sql,array(":codice_partecipante"=>$partecipante["codice"])); |
|
scriviLog("b_offerte_gare","DELETE",$pdo->getSQL()); |
|
|
|
$richieste = $gara->getRichieste(); |
|
if (!empty($richieste)) { |
|
foreach($richieste AS $richiesta) { |
|
if ($richiesta["locked"] == "S") { |
|
$gara->deleteBusta($richiesta["codice"]); |
|
} |
|
} |
|
} |
|
$codici = []; |
|
if (!empty($_POST["avvalimento"])) { |
|
$salva = new salva(); |
|
$salva->debug = false; |
|
|
|
$salva->nome_tabella = "r_avvalimenti_gare"; |
|
$existing = $gara->getAvvalimento($partecipante["codice"]); |
|
foreach($_POST["avvalimento"] as $id => $membro) { |
|
if(empty($membro["identifier_raggruppamento"]) || $membro["identifier_raggruppamento"] === "PARENT") { |
|
$membro["identifier_raggruppamento"] = null; |
|
} |
|
$continua = true; |
|
if (is_numeric($id)) { |
|
$membro["codice"] = $id; |
|
$continua = false; |
|
if (!empty($existing)) { |
|
foreach($existing as $ext) { |
|
if ($membro["codice"] == $ext["codice"]) { |
|
$continua = true; |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
if ($continua) { |
|
$membro["codice_padre"] = $partecipante["codice"]; |
|
$salva->operazione = (!is_numeric($id)) ? "INSERT" : "UPDATE"; |
|
$salva->oggetto = $membro; |
|
$codici[] = $salva->save(); |
|
} |
|
} |
|
} |
|
$sql = "DELETE FROM r_avvalimenti_gare WHERE codice NOT IN (".implode(",",$codici).") AND codice_padre = :codice_padre "; |
|
if (empty($codici)) { $sql = "DELETE FROM r_avvalimenti_gare WHERE codice_padre = :codice_padre "; } |
|
$pdo->go($sql,[":codice_padre"=>$partecipante["codice"]]); |
|
scriviLog("r_avvalimenti_gare","DELETE",$pdo->getSQL()); |
|
?> |
|
<div class="alert alert-success h1 text-center"> |
|
<span class="fa fa-check fa-2x"></span><br> |
|
<?= __("Operazione effettuata con successo") ?> |
|
</div> |
|
<? |
|
} else { |
|
?> |
|
<div class="alert alert-danger h1 text-center"> |
|
<span class="fa fa-exclamation-triangle fa-2x"></span><br> |
|
<?= __('Impossibile continuare') ?> |
|
</div> |
|
<? |
|
} |
|
?> |
|
<a class="btn btn-block btn-lg btn-primary" href="partecipa.php?codice=<?= $record["codice"] ?>&codice_lotto=<?= $lotto["codice"] ?>"> |
|
<?= __("pannello") ?> |
|
</a> |
|
</div> |
|
<? |
|
include_once ($root."/layout/bottom.php"); |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
} else { |
|
echo '<meta http-equiv="refresh" content="0;URL=/index.php">'; |
|
die(); |
|
} |
|
?>
|
|
|