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.
69 righe
2.3 KiB
69 righe
2.3 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && tokenVerify() && !$_SESSION["utente"]->isSupporto()) { |
|
$concorso = publicConcorso::init($_POST["codice"]); |
|
if (!empty($concorso)) { |
|
$record = $concorso->info; |
|
$round = $concorso->round; |
|
if ($concorso->chiarimentiAperti()) { |
|
|
|
$array = array(); |
|
$array["codice_round"] = $round["codice"]; |
|
$array["quesito"] = $_POST["quesito"]; |
|
$array["utente_richiesta"] = $_SESSION["utente"]->codice; |
|
$array["timestamp_richiesta"] = date('Y-m-d H:i:s'); |
|
$array["codice_richiedente"] = $_SESSION["utente"]->oe["codice"]; |
|
|
|
$salva = new salva(); |
|
$salva->debug = false; |
|
|
|
$salva->nome_tabella = "b_concorsi_chiarimenti"; |
|
$salva->operazione = "INSERT"; |
|
$salva->oggetto = $array; |
|
$codice = $salva->save(); |
|
|
|
if ($codice !== false) { |
|
|
|
$concorso->updateBadges(); |
|
|
|
if (isset($_POST["allegato"])) { |
|
foreach($_POST["allegato"] as $allegato) { |
|
filesManager::saveFile($allegato["filename"],$codice,"concorsi-quesiti",$allegato["nome"]); |
|
} |
|
} |
|
|
|
$corpo = "<h1>concorso #" . $record["id"] . "</h1>"; |
|
$corpo .= "<h2>" . $record["oggetto"] . "</h2>"; |
|
$corpo .= "<strong>" . $array["quesito"] . "</strong>"; |
|
|
|
$mailer = new Communicator(); |
|
$mailer->oggetto = __("E' stato richiesto un chiarimento"); |
|
$mailer->corpo = $corpo; |
|
$mailer->codice_pec = -1; |
|
$mailer->comunicazione = false; |
|
$mailer->codice_gara = $record["codice"]; |
|
$mailer->coda = true; |
|
|
|
$destinatari = [Communicator::getPecAddress($record["codice_pec"])]; |
|
$utenti = $concorso->getDestinatariInterni(); |
|
if (!empty($utenti)) { |
|
$destinatari = array_merge($destinatari,$utenti); |
|
} |
|
$mailer->destinatari = $destinatari; |
|
$mailer->send(); |
|
|
|
$error = false; |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.reload(); }); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|