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.
100 righe
3.6 KiB
100 righe
3.6 KiB
<?php |
|
|
|
$_cdir = __DIR__; |
|
|
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
die_forbidden(); |
|
|
|
include_once __DIR__ . "/class/TedEsender.class.php"; |
|
|
|
$settings = file_get_contents("{$_cdir}/config/settings.json"); |
|
$settings = json_decode($settings, TRUE); |
|
|
|
$error = true; |
|
|
|
|
|
if (! empty($_GET) && ! empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && $_SESSION["utente"]->unlockSupporto()) { |
|
|
|
$ted = new TedEsender($_GET["form"], $_GET["codice"], $settings, "{$_cdir}/config/xml"); |
|
$ted->setMode("send"); |
|
$ted->debug = $config["developEnv"]; |
|
if (!empty($ted->info["modulo"]) && !empty($ted->info["codice_elemento"])) { |
|
if (!$_SESSION["utente"]->permission($ted->info["modulo"],$ted->info["codice_elemento"])) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
} |
|
|
|
if($ted->info["stato"] == "DA TRASMETTERE") { //FIX_ME: la chaive non dovrebbe essere hardcoded |
|
|
|
$error = false; |
|
//$ted->sortSections(); |
|
//$ted->fixValuesBeforeSend(); |
|
$pdo->go("UPDATE b_guue SET anno = :anno, numero = :numero WHERE codice = :codice",[ |
|
":anno" => date('Y'), |
|
":numero" => $ted->getLastNumber() + 1, |
|
":codice" => $ted->info["codice"] |
|
]); |
|
|
|
if (!is_array($ted->errors)) { |
|
$errors = json_decode(base64_decode($ted->errors), TRUE); |
|
} |
|
|
|
//dd($ted->info["valori"]["eforms2"]); |
|
$send = $ted->send(); |
|
//dd($send); |
|
|
|
$breadcrumb = []; |
|
$breadcrumb = array(); |
|
$breadcrumb["/".$radice."/"] = Modulo::getInfo($radice)["titolo"]; |
|
$breadcrumb = $ted->getBreadcrumb($breadcrumb); |
|
$breadcrumb[""] = "Trasmissione"; |
|
include_once "{$beRoot}/layout/top.php"; |
|
?> |
|
<div class="container-fluid pt-5"> |
|
<div class="row"> |
|
<div class="col-12"> |
|
<p class="d-block display-4"> |
|
<?= Modulo::header($radice) ?> |
|
</p> |
|
</div> |
|
</div> |
|
<div class="row mt-3"> |
|
<div class="col-12"> |
|
<div class="alert alert-<?= $send["error"] ? "danger" : "success" ?>" role="alert"> |
|
<? |
|
if($send["error"]) { |
|
?> |
|
<strong><i class="fas fa-exclamation-triangle mr-2"></i> <?= __guue("Attenzione! Si è verificato un errore e il form non è stato trasmesso.") ?></strong><br> |
|
<p><?= $send["data"]["message"] ?></p> |
|
<? |
|
} else { |
|
|
|
$submission_id = TedEsender::getSubmissionID($ted->response); |
|
?> |
|
<strong><i class="fas fa-check-circle mr-2"></i><?= __guue("Il form è stato trasmesso con successo.") ?></strong> |
|
<p><?= __guue("Il form è stato inviato con riferimento: {$submission_id}. All'avvenuta pubblicazione lo stato verrà automaticamente aggiornato.") ?></p> |
|
<? |
|
} |
|
?> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
<? |
|
include_once "{$beRoot}/layout/bottom.php"; |
|
|
|
} |
|
|
|
} |
|
|
|
if($error) { |
|
|
|
header('Location: /backend/guue'); |
|
die(); |
|
|
|
} |
|
|
|
?>
|