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.
207 righe
9.7 KiB
207 righe
9.7 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]) && !empty($_GET["codice_lotto"])) { |
|
$gara = publicGara::init($_GET["codice"]); |
|
if (!empty($gara)) { |
|
if ($gara->setLotto($_GET["codice_lotto"])) { |
|
$record = $gara->info; |
|
$round = $gara->round; |
|
$lotto = $gara->lotto; |
|
$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[] = __("Invia partecipazione"); |
|
include_once ($root."/layout/top.php"); |
|
?> |
|
<div class="container"> |
|
<? |
|
if ($gara->modalitaLotti() == "tutti") { |
|
$lotti = $gara->getLotti(); |
|
} else { |
|
$lotti = [$lotto]; |
|
} |
|
$html = ""; |
|
$checks = ["obbligatori"=>0,"presenti"=>0]; |
|
$checkInstance = publicGara::init($_GET["codice"]); |
|
if ($checkInstance->partecipazioneAttiva()) { |
|
ob_start(); |
|
?> |
|
<h1 class="clearfix"> |
|
<?= __("Gara") ?> #<?= $record["id"] ?> |
|
</h1> |
|
<? |
|
foreach($lotti AS $lotto) { |
|
if ($checkInstance->setLotto($lotto["codice"]) && $checkInstance->partecipazioneAttiva()) { |
|
?> |
|
<div class="card my-2"> |
|
<div class="card-header"> |
|
<h2 class="card-title"><?= __("Lotto") ?> <?= $lotto["numero"] ?> - <?= $lotto["oggetto"] ?></h2> |
|
</div> |
|
<div class="card-body"> |
|
<? |
|
$partecipante = $checkInstance->miaPartecipazione(); |
|
if (!empty($partecipante)) { |
|
$tipiBuste = gara::tipologieBusta(); |
|
$buste = []; |
|
foreach($tipiBuste AS $id_busta => $busta) { |
|
$tmp = $checkInstance->getRichieste($id_busta); |
|
if (!empty($tmp)) { |
|
$buste[$id_busta] = ["info"=>$busta,"richieste"=>$tmp]; |
|
} |
|
} |
|
if (!empty($buste)) { |
|
if ($partecipante["conferma"]=="N") { |
|
?> |
|
<ul> |
|
<? |
|
foreach($buste AS $id_busta => $busta) { |
|
?> |
|
<li> |
|
<strong><span class="fa fa-folder"></span> <?= __($busta["info"]["titolo"]) ?></strong> |
|
<ul> |
|
<? |
|
foreach($busta["richieste"] AS $input) { |
|
if ($input["controllo"] != "N") { |
|
$checks["obbligatori"]++; |
|
} |
|
$content = $checkInstance->getBusta($partecipante["codice"],$input["codice"]); |
|
$secretata = null; |
|
if (!empty($content)) { |
|
if ($input["controllo"] != "N") { |
|
$checks["presenti"]++; |
|
} |
|
if ($content["segreta"] == "S") { |
|
$checks["obbligatori"]++; |
|
$secretata = $checkInstance->getBustaSecretata($partecipante["codice"],$input["codice"],"busta"); |
|
if (!empty($secretata)) { |
|
$checks["presenti"]++; |
|
} |
|
} |
|
} |
|
?> |
|
<li><strong><?= $input["titolo"] ?></strong> |
|
<? if (!empty($content["nomeFile"])) { ?> |
|
<ul> |
|
<li><span class="far fa-file"></span> <?= $content["nomeFile"] ?></li> |
|
<li><?= __("Impronta hash") ?> SHA256: <strong><?= $content["sha256"] ?></strong></li> |
|
<? if (!empty($secretata)) { ?> |
|
<li><?= __("Versione oscurata") ?>: |
|
<ul> |
|
<li><span class="far fa-file"></span> <?= $secretata["nomeFile"] ?></li> |
|
<li><?= __("Impronta hash") ?> SHA256: <strong><?= $secretata["sha256"] ?></strong></li> |
|
</ul> |
|
</li> |
|
<? } else if ($content["segreta"] == "S") { ?> |
|
<li><? alertManager::printAlertCompact(__("Versione oscurata mancante")) ?></li> |
|
<? } ?> |
|
</ul> |
|
<? } else { |
|
if ($input["controllo"] != "N") { |
|
alertManager::printAlertBox(__("Documento obbligatorio")); |
|
} |
|
} ?> |
|
</li> |
|
<? |
|
} |
|
?> |
|
</ul> |
|
</li> |
|
<? |
|
} |
|
?> |
|
</ul> |
|
<? |
|
$html .= ob_get_clean(); |
|
ob_start(); |
|
} else { |
|
alertManager::printInfoBox(__("Partecipazione già inviata")); |
|
} |
|
} |
|
} else { |
|
if (count($lotti) > 1) { |
|
$errorLotto = true; |
|
alertManager::printAlertBox(__("Partecipazione assente")); |
|
} |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
$html .= ob_get_clean(); |
|
echo $html; |
|
if ($checks["obbligatori"]==$checks["presenti"] && !isset($errorLotto)) { |
|
foreach($lotti AS $lotto) { |
|
if ($checkInstance->setLotto($lotto["codice"]) && $checkInstance->partecipazioneAttiva()) { |
|
$partecipante = $checkInstance->miaPartecipazione(); |
|
if (!empty($partecipante)) { |
|
$partecipante["conferma"] = "S"; |
|
$salva = new salva(); |
|
$salva->debug = false; |
|
|
|
$salva->nome_tabella = "r_partecipanti_gare"; |
|
$salva->operazione = "UPDATE"; |
|
$salva->oggetto = $partecipante; |
|
$partecipante["codice"] = $salva->save(); |
|
if (empty($partecipante["codice"])) { |
|
$erroreSalvataggio = true; |
|
?> |
|
<h2 class="alert alert-danger text-center"> |
|
<span class="fa fa-exclamation fa-2x"></span><br> |
|
<?= __('Errore invio') ?> |
|
</h2> |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if (!isset($erroreSalvataggio)) { |
|
$corpo = purify($html); |
|
$mailer = new Communicator(); |
|
$mailer->oggetto = __('Conferma di ricezione offerta') . " " . __('Gara') . ' #' . $record["id"]; |
|
if (count($lotti) == 1) { |
|
$mailer->oggetto .= " - " . __("Lotto") . " #{$lotti[0]["numero"]}"; |
|
} |
|
$mailer->corpo = $corpo; |
|
$mailer->codice_pec = $gara->info["codice_pec"] ?? 0; |
|
$mailer->comunicazione = true; |
|
$mailer->sezione = "gare"; |
|
$mailer->codice_gara = $record["codice"]; |
|
$mailer->coda = true; |
|
$mailer->destinatari = $_SESSION["utente"]->oe["codice"]; |
|
$mailer->send(); |
|
|
|
$mailer->codice_pec = -1; |
|
$mailer->comunicazione = false; |
|
$mailer->destinatari = Communicator::getPecAddress($record["codice_pec"]); |
|
$mailer->send(); |
|
alertManager::printSuccessBox(__("La partecipazione è stata ricevuta con successo"),__("Un messaggio di posta elettronica certificata è stato inviato per confermare l'operazione")); |
|
} else { |
|
alertManager::printAlertBox(__("Impossibile continuare"),__("Errore nella conferma")); |
|
} |
|
} else { |
|
alertManager::printAlertBox(__("Impossibile continuare"),__("Documenti mancanti")); |
|
} |
|
} else { |
|
alertManager::printAlertBox(__("Impossibile continuare"),__("Termini scaduti")); |
|
} |
|
?> |
|
</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(); |
|
} |
|
?>
|
|
|