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.
115 righe
4.9 KiB
115 righe
4.9 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && !empty($_POST["codice_lotto"])) { |
|
$concorso = publicConcorso::init($_POST["codice_concorso"]); |
|
if (!empty($concorso)) { |
|
if ($concorso->setLotto($_POST["codice_lotto"])) { |
|
$record = $concorso->info; |
|
$lotto = $concorso->lotto; |
|
$round = $concorso->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 raggruppamento"); |
|
|
|
include_once ($root."/layout/top.php"); |
|
?> |
|
<div class="container"> |
|
<? |
|
if ($concorso->partecipazioneAttiva()) { |
|
?> |
|
<h3><?= $record["oggetto"] ?></h3> |
|
<? |
|
$partecipante = $concorso->miaPartecipazione(); |
|
if (empty($partecipante)) { |
|
$partecipante = $concorso->savePartecipante(); |
|
} |
|
if (!empty($partecipante)) { |
|
$codici = []; |
|
if (!empty($_POST["raggruppamento"])) { |
|
$salva = new salva(); |
|
$salva->debug = false; |
|
|
|
$salva->nome_tabella = "r_raggruppamenti_concorsi"; |
|
$existing = $concorso->getRaggruppamento($partecipante["codice"] ?? NULL); |
|
foreach($_POST["raggruppamento"] AS $id => $membro) { |
|
$continua = true; |
|
$data = [ |
|
"stato" => $membro["stato"], |
|
"codice_fiscale_impresa" => $membro["codice_fiscale_impresa"], |
|
"ragione_sociale" => $membro["ragione_sociale"], |
|
"ruolo" => $membro["ruolo"] |
|
]; |
|
$membro["encryptedData"] = base64_encode(simple_encrypt(json_encode($data),$config["simple_encrypt"]["offer"])); |
|
foreach(array_keys($data) AS $key) { |
|
unset($membro[$key]); |
|
} |
|
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_raggruppamenti_concorsi WHERE codice NOT IN (".implode(",",$codici).") AND codice_padre = :codice_padre "; |
|
if (empty($codici)) { $sql = "DELETE FROM r_raggruppamenti_concorsi WHERE codice_padre = :codice_padre "; } |
|
$pdo->go($sql,[":codice_padre"=>$partecipante["codice"]]); |
|
scriviLog("r_raggruppamenti_concorsi","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 salvare il partecipante') ?> |
|
</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(); |
|
} |
|
?>
|
|
|