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.
70 righe
2.5 KiB
70 righe
2.5 KiB
<? |
|
$_cdir = __DIR__; |
|
|
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
|
|
if (! empty($_POST) && ! empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice, $_POST["codice"]) && tokenVerify() && (!$_SESSION["utente"]->isSupporto() || $_SESSION["utente"]->hasSuperpowers()) ) { |
|
$contratto = stipula::init($_POST["codice"]); |
|
$unimod = new UnimodForm($contratto); |
|
if ( |
|
empty($_POST["telematico_dati-telematico_adempimento_dati-negozio_negozio_£_soggetti_0__attributes_id_soggetto_avente_causa"]) && |
|
empty($_POST["telematico_dati-telematico_adempimento_dati-negozio_negozio_£_soggetti_1__attributes_id_soggetto_avente_causa"]) |
|
) { |
|
?> |
|
swal({ |
|
title:"<?=__('Attenzione')?>", |
|
text:"<?=__('Selezionare il soggetto avente causa')?>", |
|
type:"error", |
|
confirmButtonText:"Ok" |
|
}); |
|
<? |
|
die(); |
|
} |
|
if ( |
|
empty($_POST["telematico_dati-telematico_adempimento_dati-negozio_negozio_£_soggetti_0__attributes_id_soggetto_dante_causa"]) && |
|
empty($_POST["telematico_dati-telematico_adempimento_dati-negozio_negozio_£_soggetti_1__attributes_id_soggetto_dante_causa"]) |
|
) { |
|
?> |
|
swal({ |
|
title:"<?=__('Attenzione')?>", |
|
text:"<?=__('Selezionare il soggetto dante causa')?>", |
|
type:"error", |
|
confirmButtonText:"Ok" |
|
}); |
|
<? |
|
die(); |
|
} |
|
if ($unimod->save()) { |
|
?> |
|
swal({ |
|
title:js_dict["success-msg"],type:"success", |
|
showCancelButton:true, |
|
confirmButtonText: '<span><i class="fas fa-download"></i> Scarica XML</span>', |
|
cancelButtonText: 'Conferma' |
|
}).then(function(result){ |
|
if (result.value){ |
|
var link=document.createElement('a'); |
|
document.body.appendChild(link); |
|
link.download = true |
|
link.href='<?=url("/backend/contratti/unimod/download.php?codice={$contratto->info["codice"]}")?>'; |
|
link.click(); |
|
} else { |
|
window.location.reload(); |
|
} |
|
}); |
|
<? |
|
} else { |
|
?> |
|
swal({ |
|
title:js_dict["error"], |
|
type:"error", |
|
text:js_dict["unimod-error"], |
|
confirmButtonText: '<span>Correggi</span>', |
|
}).then(function(){ |
|
window.location.reload(); |
|
}); |
|
<? |
|
} |
|
} |
|
?>
|