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.
52 righe
2.2 KiB
52 righe
2.2 KiB
<? |
|
$error = true; |
|
$new_user = false; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "inviti"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_POST["codice_gara"],$id_modulo)) { |
|
$gara = gara::init($_POST["codice_gara"]); |
|
$lock = $gara->checkLock($cmd_info["id"]); |
|
if (!empty($gara) && !$lock) { |
|
$estrazione = oeManager::getEstrazione("gare",$_POST["codice_gara"],$_POST["codice_lotto"]); |
|
if (!empty($_POST["codice_lotto"])) { |
|
$estrazioneGenerale = oeManager::getEstrazione("gare",$_POST["codice_gara"],"0"); |
|
} |
|
if (empty($estrazione) && empty($estrazioneGenerale)) { |
|
$pec = $_POST["pec"]; |
|
$ragione_sociale = $_POST["ragione_sociale"]; |
|
$codice_fiscale = $_POST["codice_fiscale"]; |
|
$codice_lotto = $_POST["codice_lotto"]; |
|
$codice_oe = oeManager::getIdFromPEC($pec); |
|
$error = false; |
|
// Se esiste già, chiamiamo save.php |
|
if(!empty($codice_oe)) { |
|
$gara->inviteOE([$codice_oe], $codice_lotto, null, false); |
|
} else { |
|
$new_user = true; |
|
$idTemp = $gara->saveTempInvito($codice_lotto,$codice_fiscale,$ragione_sociale,$pec); |
|
if (!empty($idTemp)) { |
|
if ($gara->info["stato"] >= 20) { |
|
$gara->inviaInvito([$pec]); |
|
} |
|
} else { |
|
?> |
|
swal({title:"<?= __("Errore nell'invito") ?>",html:"<?= __("Verificare che l'invito non sia già stato inviato") ?>",type:"error"}); |
|
<? |
|
die(); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
?> |
|
swal({title:"<?= __("Errore nell'invito") ?>",html:"<?= __("Impossibile inviare l'invito") ?>",type:"error"}); |
|
<? |
|
} else { |
|
?> |
|
//swal({title:"<?= __("Invito inviato") ?>",html:"<?= $new_user ? __("L'operatore è stato aggiunto alla lista degli invitati. Dovrà iscriversi per poter partecipare.") : __("L'operatore è stato aggiunto alla lista degli invitati") ?>",type:"success"}); |
|
<? |
|
} |
|
?>
|
|
|