function upload() { if ($("#blob").val()) { swal({ title: "'.tr('Avviare la procedura?').'", type: "warning", showCancelButton: true, confirmButtonText: "'.tr('Sì').'" }).then(function (result) { $("#upload").ajaxSubmit({ url: globals.rootdir + "/actions.php", data: { op: "save", id_module: "'.$id_module.'", id_plugin: "'.$id_plugin.'", }, type: "post", success: function(data){ data = JSON.parse(data); if (!data.already) { launch_modal("'.tr('Righe fattura').'", globals.rootdir + "/actions.php?id_module=" + globals.id_module + "&id_plugin=" + '.$id_plugin.' + "&op=list&filename=" + data.filename); } else { swal({ title: "'.tr('Fattura già importata!').'", type: "info", }) } }, error: function(data) { alert("'.tr('Errore').': " + data); } }); }) } else { swal({ title: "'.tr('Selezionare un file!').'", type: "error", }) } }