var errorMessage = "An error has occurred.Call status: ";
var dataWebinar = "Date Webinar";
var tCliccare = "Click on";
var tQui = "here";
var tPerAccessoWebinar = "to access to webinar";
var tLingua = "eng";
var tSuccesso = "Operation successfully held";
var tIdAnagrafica = "";
var tConfermare = "confirm";
var tChiudi = "Close";
var tErrore = "Error";
var tScegli = "Choose from list";
var tTutti = "All";
var trad = "";
var altezzasito = 0;
var altfooter = 0;
var larghezzasito = 0;
var totaltezza = 0;
var alttop = 0;
var menu = $("#menusxgest");
var posizione = menu.position();
function ricercapfe(idpercorsoformativo_eventi, idpercorsoformativo, lingua) {
var myElement = document.getElementById("ricercapfe").value;
Richiesta(idpercorsoformativo_eventi + '||' + idpercorsoformativo + '||||' + myElement + '||||||' + lingua + '||', '/admin/iscrittipfe.asp', 'iscrittipfe', 'si')
}
function update_ndomande_num(n) {
var nd = Math.floor($('#ndomande').val() * n / 100);
$('#nd_shownum').html(nd);
$('#ndomande_num').val(nd);
$('#select2-ndomande_num-container').html(nd);
$('#ndomande_abs').val(nd);
}
function update_ndomande(n) {
if (n > 0) {
var nn = $('#ndomande_num').val();
var np = Math.round(nn * 100 / n);
var nd = Math.floor(np * n / 100);
if (nd > nn) {
np -= 1
} else if (nd < nn) {
np += 1
}
$('#ndomande').val(np);
$('#nd_shownum').html(nn);
$('#select2-ndomande-container').html(np);
$('#ndomande_abs').val(n);
}
}
function show_ndomande() {
var input = $('#ndomande_input').val();
if (input == 0) {
$('#ndperc').show();
$('#ndnum').hide();
} else {
$('#ndperc').hide();
$('#ndnum').show();
}
}
function initGaugeS(targetId, valore) {
var opts = {
angle: 0, // The h4 of the gauge arc
lineWidth: 0.3, // The line thickness
radiusScale: 0.6, // Relative radius
pointer: {
length: 0.6, // // Relative to gauge radius
strokeWidth: 0.035, // The thickness
color: '#000000' // Fill color
},
limitMax: false, // If false, max value increases automatically if value > maxValue
limitMin: false, // If true, the min value of the gauge will be fixed
colorStart: '#6FADCF', // Colors
colorStop: '#8FC0DA', // just experiment with them
strokeColor: '#E0E0E0', // to see which ones work best for you
generateGradient: true,
highDpiSupport: true, // High resolution support
staticLabels: {
font: "12px helvetica", // Specifies font
labels: [0, 70, 80, 100], // Print labels at these values
color: "#000000", // Optional: Label text color
fractionDigits: 0 // Optional: Numerical precision. 0=round off.
},
staticZones: [{
strokeStyle: "#F03E3E",
min: 0,
max: 70
}, // Red from 100 to 130
{
strokeStyle: "#FFDD00",
min: 70,
max: 80
}, // Yellow
{
strokeStyle: "#30B32D",
min: 80,
max: 100
}, // Green
],
}
var target = document.getElementById(targetId); // your canvas element
var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
gauge.maxValue = 100; // set max gauge value
gauge.setMinValue(0); // Prefer setter over gauge.minValue = 0
gauge.animationSpeed = 32; // set animation speed (32 is default value)
gauge.set(valore); // set actual value
}
function mettifiltro(url, display) {
$("#imgresult").attr("src", url);
if (display == "none") {
$(".pal").hide()
$(".stotag").hide()
} else {
$(".pal").show()
$(".stotag").show()
}
}
function calendariocorsiajax(querystring) {
$('#calendario_corsi').html('
').accordion('destroy').accordion({
heightStyle: "content",
active: nactive,
collapsible: true,
create: function (event, ui)
{
$("#z" + iddomanda).html(msg);
$(".domandavuota").html(" ")
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
$.ajax({
url: "/admin/newdomanda.asp?idtest_corso=" + idtest_corso + "&lingua=" + tLingua,
success: function (result) {
$("#newdomanda").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$("select").select2('destroy');
}
});
}
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function aggiornasede(idazienda) {
$.ajax({
type: "POST",
url: "/admin/agenzie.asp?idazienda=" + idazienda,
dataType: "text",
success: function (msg) {
$("#agenzie").html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function findutenti()
{
data = $('#findutenti').serialize()
$.ajax({
url: "/admin/findutenti.asp",
data: data,
success: function (result) {
$("#result").html(result);
}
});
}
function ricercacontesti() {
data = $('#ricercacontesti').serialize()
usaoverlay('/admin/sceglicontesti.asp?' + data, 'si')
}
function setcontesto(idcontesto, ideventocorso, cosas)
{
data = $('#ricercacontesti').serialize()
$.ajax({
url: "/admin/selezionati.asp?idcontesto=" + idcontesto + "&ideventocorso=" + ideventocorso + "&cosa=" + cosas,
success: function (datas) {
//$("#selezionati").html(data);
usaoverlay('/admin/sceglicontesti.asp?' + data, 'si')
if (cosas == "add") {
$('#c' + idcontesto).html('
');
} else {
$('#c' + idcontesto).html('
');
}
},
error: function (richiesta, stato, errori) {
alert(ErrorMessage + stato);
}
});
}
function entepercorso() {
data = $('#formpercorso').serialize()
$.ajax({
type: "POST",
url: "/admin/percorso_ente.asp",
data: data,
dataType: "text",
success: function (msg)
{
$("#percorsoente").html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function deleterigacontesto(id)
{
$("#R" + id).remove();
$(".ui-dialog").remove();
$(".ui-widget-overlay").remove();
$("body").removeAttr("style")
}
function vaizoom() {
$('a').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
}
function removediv(id) {
$("#" + id).remove()
}
function deleterigapacchetto(id)
{
$("#P" + id).remove();
$(".ui-dialog").remove();
$(".ui-widget-overlay").remove();
$("body").removeAttr("style")
}
function tipoesame(variabile)
{
//alert(variabile)
oscura()
$.ajax({
url: "/admin/simulscan.asp?" + variabile,
success: function (result) {
$("#simulscan").html(result);
nooscura()
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2()
}
});
}
function tipopercentuale(variabile)
{
//alert(variabile)
$("#contminacce").addClass('disabled-div')
$.ajax({
url: "/admin/minacce.asp?" + variabile,
success: function (result) {
$("#contminacce").html(result);
$("#contminacce").removeClass('disabled-div')
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2()
$(".select2-container").css("min-width", "70px");
}
});
}
function filtralista(idec, iniziale, sede, sublocation, cluster, direzione, pagina)
{
$("#listauser").html('
');
$.ajax({
url: '/admin/listauser.asp?cluster=' + cluster + '&sede=' + sede + '&sublocation=' + sublocation + '&ideventocorso=' + idec + '&iniziale=' + iniziale + '&lingua=' + tLingua + '&direzione=' + direzione + '&pag=' + pagina + '&' + $("#dis").serialize(),
success: function (data, stato) {
$("#listauser").html(data);
},
error: function (richiesta, stato, errori) {
alert(ErrorMessage + stato);
}
});
}
function reportsimulscan(cosa)
{
data = $("#filtro"+cosa).serialize();
$.ajax({
url: "/admin/reportsimulscan.asp?cosa="+cosa,
data: data,
success: function (msg)
{
$("#report"+cosa).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function fatturato(id) {
if ((document.getElementById('F' + id).checked == false))
$.ajax({
url: '/admin/setfatturato.asp?idrc=' + id + '&fatturato=0'
});
else
$.ajax({
url: '/admin/setfatturato.asp?idrc=' + id + '&fatturato=1'
});
}
function setpropedeutico(id) {
if ((document.getElementById('pro' + id).checked == false))
$.ajax({
url: '/admin/setpropedeutico.asp?idrc=' + id + '&propedeutico=0'
});
else
$.ajax({
url: '/admin/setpropedeutico.asp?idrc=' + id + '&propedeutico=1'
});
}
function aggiornascore(id, numero) {
$.ajax({
url: "/simulscan/calcola_media.asp?id=" + id,
success: function (result) {
aggiornariga(id, numero)
}
});
}
function aggiornariga(id, numero) {
data = $('#formrec').serialize()
$.ajax({
type: "POST",
url: "riga_iscrizione.asp?numero=" + numero + "&idregistrazione_corso=" + id,
dataType: "text",
success: function (msg)
{
$("#accordion").accordion({
active: 1
});
$("#riga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('bianco');
$('tr:even').addClass('grigio');
$('div.clear:odd').addClass('bianco');
$('div.clear:even').addClass('grigio');
$("select").select2();
$("body").css('position', 'relative')
$("body").css('overflow', 'auto')
$(".ui-dialog").remove()
$(".ui-widget-overlay").remove()
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function openinvia(id, numero) {
$.ajax({
url: "/admin/openinvia.asp?id=" + id + "&numero=" + numero,
success: function (result) {
$("#ga" + id).html(result);
}
});
}
function inviaattestato(id, numero, idattestato)
{
data = $('#formrec').serialize()
$.ajax({
type: "POST",
url: "/admin/invia_attestato.asp?numero=" + numero + "&idregistrazione_corso=" + id,
data: data,
dataType: "text",
success: function (msg)
{
$("#ga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
//alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function inviasattestato(id, numero, idattestato, emailr, emailu)
{
$.ajax({
type: "POST",
url: "/admin/invia_attestato.asp?numero=" + numero + "&idregistrazione_corso=" + id + "&emailr=" + emailr + "&emailu=" + emailu,
dataType: "text",
success: function (msg)
{
$("#ga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function upattestato(id, numero, idattestato) {
data = $('#formrec').serialize()
$.ajax({
type: "POST",
url: "/admin/up_attestato.asp?numero=" + numero + "&idregistrazione_corso=" + id,
data: data,
dataType: "text",
success: function (msg)
{
$("#ga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function creaattestato(id, numero, idattestato)
{
data = $('#formrec').serialize()
$.ajax({
url: "/admin/crea_attestato.asp?numero=" + numero + "&idregistrazione_corso=" + id,
type: "get",
data: data,
dataType: "text",
success: function (msg)
{
$("#ga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function (msg) {
$("#ga" + id).html(msg);
}
});
}
function creaattestati() {
$("#spaziomsgres").html('
');
datax = $('#inviaazienda').serialize()
$.ajax({
url: "/admin/lista_rep.asp",
type: "get",
data: datax,
dataType: "text",
success: function (msg)
{
$("#spaziomsgres").html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
},
error: function () {
//alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function creaattestatoAll(id, numero, idattestato)
{
data = $('#inviaazienda').serialize()
$.ajax({
url: "/admin/crea_attestato_all.asp?idrc=" + id,
type: "POST",
data: data,
dataType: "text",
success: function (msg)
{
$("#gag" + id).html(msg);
},
error: function () {
//alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function uppayment(id, numero)
{
data = $('#formrec').serialize()
$.ajax({
type: "POST",
url: "/admin/up_payment.asp?idregistrazione_corso=" + id,
data: data,
dataType: "text",
success: function (msg)
{
$("#riga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function mettirisposta() {
$('#idlistarisposte').on('change', function () {
idrisposta = this.value;
$.ajax({
url: "/admin/mettirisposta.asp?id=" + idrisposta,
success: function (result) {
$("#risposta").html(result);
}
});
});
}
function backpayment(id, numero) {
$.ajax({
type: "POST",
url: "/admin/pay.asp",
data: "numero=" + numero + "&idregistrazione_corso=" + id,
dataType: "html",
success: function (msg)
{
$("#rp" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
//alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function recpayment(id, numero) {
$.ajax({
type: "POST",
url: "/admin/rec_payment.asp",
data: "numero=" + numero + "&idregistrazione_corso=" + id,
dataType: "html",
success: function (msg)
{
$("#rp" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function modificaattestato(id, numero) {
$.ajax({
type: "POST",
url: "/admin/genera_attestato.asp",
data: "modifica=si&numero=" + numero + "&idregistrazione_corso=" + id,
dataType: "text",
success: function (msg)
{
$("#ga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function myFunction(variabile) {
setTimeout(function () {
Richiesta(variabile, '/admin/newsletter/sendavviso.asp', 's' + variabile)
}, 30000);
}
function vedi_impegno(idtipoimpegno, iddocenteevento) {
if (idtipoimpegno == 2) {
$("#lezionepersonale").css('display', 'block');
var start = $('#dal').val();
var end = $('#al').val();
$.ajax({
url: "/admin/giorni.asp?inizio=" + start + "&fine=" + end + "&iddocenteevento=" + iddocenteevento,
success: function (result) {
$("#giorni").html(result);
}
});
} else {
$("#lezionepersonale").css('display', 'none');
}
}
function verificafile(attestato, files, id) {
$.ajax({
url: "/admin/verificafile.asp?files=" + files + "&attestato=" + attestato,
success: function (result) {
if (result == 'ko') {
creaattestatoAll(attestato, 0, 0)
} else {
$("#gag" + attestato).html(result);
}
}
});
}
function listafiles(ideventocorso, iddocente, lingua) {
$.ajax({
url: "/admin/filescorso.asp?iddocente=" + iddocente + "&ideventocorso=" + ideventocorso + "&lingua=" + lingua,
success: function (result) {
$("#filescorso").html(result);
}
});
}
function generaattestato(id, numero, cosa) {
$("#ga" + id).html('')
$("#ga" + id).html('
')
$.ajax({
type: "POST",
url: "/admin/genera_attestato.asp",
data: "numero=" + numero + "&idregistrazione_corso=" + id + "&cosa=" + cosa,
dataType: "text",
success: function (msg)
{
$("#ga" + id).html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
},
error: function () {
alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function aggiornadomanda(iddomanda, domanda)
{
$(".domandavuota").val("")
$.ajax({
type: "POST",
url: "/admin/domanda.asp?iddomanda=" + iddomanda,
dataType: "text",
success: function (msg) {
$(".domandavuota").html("");
$("#id" + iddomanda).html(domanda);
$("#z" + iddomanda).html('
' + tSuccesso + '
' + msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$('.zoom').wtLightBox({
rotate: true,
delay: 4000,
display_number: true,
display_dbuttons: true,
display_timer: true,
display_caption: true,
caption_align: "bottom",
transition_speed: 600,
cont_nav: true,
auto_fit: true,
easing: ""
});
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href, 'no')
});
$.ajax({
url: "/admin/newdomanda.asp?libgua=" + tLingua,
success: function (result) {
$("#newdomanda").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$("select").select2('destroy');
}
});
},
error: function () {
//alert("Chiamata fallita, si prega di riprovare...");
}
});
}
function vaievento(idevento, prov) {
location.href = prov + 'evento_corso.asp?idevento_corso=' + idevento
}
function addlista(idanagrafica, ideventocorso) {}
function vedivalore(variabile, valore, ideventocorso, idazienda) {
$('#idanagrafica' + valore).hide()
$('#td' + valore).append('
')
$("#stato_iscrizioni").html('
')
oscura()
$.ajax({
type: "GET",
url: "/admin/stato_iscrizioni.asp",
data: variabile,
error: function (jqXhr, textStatus, errorMessage) { // error callback
if (errorMessage!="")
alert(tErrore + '\n' + errorMessage);
else if (jqXhr.responseText.includes('
'))
alert (tErrore + '\n' + decodeHtmlEntities(jqXhr.responseText.replace(/<[^>]*(>|$)| ||»|«|>/g, ' ')));
//alert(tErrore + '\n' + jqXhr.responseText.replace(/<[^>]*(>|$)| ||»|«|>/g, ' '));
else
alert(tErrore + '\n' + decodeHtmlEntities(jqXhr.responseText));
},
success: function (msg) {
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#stato_iscrizioni").html(msg);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$('a[rel="#overlay"]').click(function (event) {
evt = event;
evt.preventDefault();
var href = $(this).attr('href');
usaoverlay(href)
});
$.ajax({
url: "/admin/sis.asp?ord=datains desc&tutti=&ideventocorso=" + ideventocorso + "&idazienda=" + idazienda,
success: function (result) {
$("#sis").html(result);
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$(".noselect").select2('destroy');
}
});
nooscura()
$('.loadgif').remove()
$('#idanagrafica' + valore).show()
document.getElementById('idanagrafica' + valore).disabled = true;
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$(".noselect").select2('destroy');
}
});
}
function cercaazienda() {
$.ajax({
url: "/admin/lista_aziende_eventocorso.asp",
data: $("#inviaazienda").serialize(),
success: function (result) {
$("#spaziomsg").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
}
});
}
function cercaaziendaRef() {
$.ajax({
url: "/admin/lista_user_eventocorso_edit.asp",
data: $("#inviaazienda").serialize(),
success: function (result) {
$("#spaziomsg").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
}
});
}
function chiudiordine(idordine) {
$.ajax({
url: "/admin/lista_aziende_eventocorso.asp?finalizza=si&idordine=" + idordine,
success: function (result) {
$("#spaziomsg").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
}
});
}
function cercalista() {
$.ajax({
url: "/admin/lista_user_eventocorso.asp",
data: $("#inviaazienda").serialize(),
success: function (result) {
$("#spaziomsg").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
}
});
}
function cercacv() {
$.ajax({
url: "/admin/lista_cv_eventocorso.asp",
data: $("#inviaazienda").serialize(),
success: function (result) {
$("#spaziomsg").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
}
});
}
function paginazione(pagina, variabili, ricerca, div) {
$("#" + div).html("");
var valore = variabili;
$.ajax({
type: "POST", //Tipo di richiesta
url: pagina, //Url web service
data: "variabile=" + valore + '&ricerca=' + ricerca, //Parametri (da concatenare con &)
//dataType: "json", //Tipo di risposta
success: function (msg) { //Callback risposta
$("#" + div).html(msg).fadeIn("slow");
//sistemamenu();
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
$('a[rel="#overlay"]').click(function () {
var href = $(this).attr('href');
usaoverlay(href)
});
//Setta i valori dei campi e fa un fadeIn
coloraFiltri();
}
});
}
document.cookie = "ScreenSize=" + screen.width + "-" + screen.height;
function popupfull(mylink, windowname) {
popupwindow = window.open(mylink, windowname, "height=" + (window.screen.height - 60) + ", width=" + (window.screen.width - 10) + ", top=0, left=0,scrollbars=yes");
}
function ColoraRighe(tabella) {
var tabelle = document.getElementsByTagName("table");
for (i = 0; i < tabelle.length; i++) {
if (tabelle[i].className.indexOf(tabella) >= 0) {
trs = tabelle[i].tBodies[0].rows;
for (s = 1; s < trs.length; s += 1)
trs[s].className = "bianco";
for (j = 1; j < trs.length; j += 2)
trs[j].className = "grigio";
}
}
}
function Aggiorna() {
Richiesta('zzxy', '/admin/controlla_msg.asp', 'posta', 'no');
}
function AggiornaAllegati() {
Richiesta('zzxy', '/u/lista_materiale.asp', 'lista_materiale', '');
}
function change() {
intervalID = setInterval(Aggiorna, 2500);
}
function chiudiMsg(dove, cosa, classe)
{
document.getElementById(dove).style.visibility = "hidden";
document.getElementById(cosa).className = classe;
}
function upmessaggio(dove, cosa, classe) {
if (document.message.messaggio.value == "") {
alert("Inserire il messaggio");
document.message.messaggio.focus();
return false;
}
chiudiMsg(dove, cosa, classe);
document.message.submit();
}
function chiudiAggiorna(dove, variabile, doves, pagina)
{
document.getElementById(dove).style.visibility = "hidden";
Richiesta(variabile, pagina, doves);
}
function provatr(valore, variabile) {
$.ajax({
type: "GET",
url: "/admin/riga.asp",
data: "variabile=" + variabile,
success: function (response) {
$("#" + valore).each(function (i) {
$(this).attr('id', valore);
$(this).html(response)
});
}
});
}
function uptotale(valore, elemento)
{
//alert(elemento)
if (document.getElementById(elemento).checked) {
totale = parseInt(document.formecommerce.price.value) + parseInt(valore);
//alert(valore)
}
if (document.getElementById(elemento).checked == false) {
totale = parseInt(document.formecommerce.price.value) - parseInt(valore);
//alert(valore)
}
document.formecommerce.totale.value = totale
//alert(totale);
}
function deletepartecipante(variabile, pagina) {
$("#evento_corso").hide();
$.ajax({
type: "GET",
url: pagina,
data: variabile,
success: function (response) {
$("#evento_corso").html(response).slideDown();
$("#stato_iscrizioni").slideDown();
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
}
});
}
function aprimenu() {
$("#sx").show();
$('#dx').css('margin', '0px');
if (larghezzasito < 768)
{
$('#dx').hide()
} else {
$('#dx').css('width', larghezzasito - 270 + 'px');
}
$('#cmenu').css('display', 'block');
$('#amenu').css('display', 'none');
document.cookie = 'menu' + '=' + '';
}
function apri_div(div, maxdiv) {
var i = 1;
for (i = 1; i <= maxdiv; i++) {
//alert ('D'+i)
document.getElementById('D' + i).className = "chiuso_div"
}
document.getElementById(div).className = "vedi_div"
}
function prova(anchorname, variabile, dove, pagina) {
$(".bottone").removeClass("alert");
var str = anchorname;
var res = str.replace("anchor", "");
if (dove != "") {
$("#" + anchorname).addClass("alert");
document.getElementById(dove).style.visibility = "visible";
document.getElementById(dove).style.display = "block";
Richiesta(variabile, pagina, dove);
}
}
function chiudi(dove, divk, idev)
{
document.getElementById(dove).style.visibility = "hidden";
Richiesta(idev + '_' + divk, 'avvisi', divk);
}
function chiudiDiv(dove)
{
document.getElementById(dove).style.visibility = "hidden";
document.getElementById(dove).style.display = "none";
}
function controlDelete(div)
{
$('#' + div).remove();
}
function yummy(yommo) {
var kafka = "67"
recs = ""
stringa = yommo;
var arr_testo = stringa.split("");
var i = 0;
while (i < arr_testo.length) {
var rec = arr_testo[i]
recs = recs + (rec.charCodeAt(0) + kafka) + ","
i++;
}
return recs;
}
function upavviso() {
if (document.advice.avviso.value == "") {
alert("Inserire l'avviso");
document.advice.avviso.focus();
return false;
}
doves = document.advice.k.value
document.getElementById(doves).innerHTML = document.advice.avviso.value.slice(0, 60);
document.advice.submit();
}
//-->
function conferma() {
if (document.gloss.definizione.value == "") {
alert("Inserire la definizione");
document.gloss.definizione.focus();
return false;
}
if (document.gloss.testo.value == "") {
alert("Inserire il testo");
document.gloss.testo.focus();
return false;
}
Richiesta(document.gloss.definizione.value + '_' + document.gloss.testo.value + '_' + document.gloss.idcorso.value, 'insert_glossario.asp', 'glossario');
}
//-->
function modifica() {
if (document.gloss.definizione.value == "") {
alert("Inserire la definizione");
document.gloss.definizione.focus();
return false;
}
if (document.gloss.testo.value == "") {
alert("Inserire il testo");
document.gloss.testo.focus();
return false;
}
Richiesta(document.gloss.definizione.value + '_' + document.gloss.testo.value + '_' + document.gloss.idcorso.value + '_' + document.gloss.idglossario.value + '_' + document.gloss.idlezione.value, 'update_glossario.asp', 'punti');
}
//-->
function showtr(t, cosa, s1, comp1, s2, comp2) {
document.getElementById(s1).style.display = comp1;
document.getElementById(s2).style.display = comp2;
var colore = document.getElementById(t);
var IE = (window.navigator.userAgent.indexOf('MSIE') > -1) ? 1 : 0;
if (t == 'tab') {
colore.style.display = (IE) ? 'block' : 'table-row';
} else {
colore.style.display = cosa;
}
}
function insavviso(dove, t, cosa, s1, comp1, s2, comp2) {
if (document.advice.avviso.value == "") {
alert("Inserire l'avviso");
document.advice.avviso.focus();
return false;
}
document.advice.submit();
}
function DropDownMenu(entered) {
// ********** DROP DOWN MENU (c) Henrik Petersen / NetKontoret - All rights reserved ****************
// The script is explained along with other useful scripts at: http://www.echoecho.com/javascript.htm
// You may freely use this script as long as you do not remove this line and the 2 lines above.
with (entered) {
ref = options[selectedIndex].value;
splitcharacter = ref.lastIndexOf("$");
if (splitcharacter != -1) {
loc = ref.substring(0, splitcharacter);
target = ref.substring(splitcharacter + 1, 1000).toLowerCase();
} else {
loc = ref;
target = "_self";
}
lowloc = loc.toLowerCase();
if (lowloc == "false")
return;
if (target == "_self") {
document.location = loc;
} else {
if (target == "_top")
top.location = loc;
else {
if (target == "_blank")
window.open(loc);
else {
if (target == "_parent")
parent.location = loc;
else
parent.frames[target].location = loc;
}
}
}
}
}
function cercaaziendaAtt() {
$.ajax({
url: "/admin/lista_attestati.asp",
data: $("#inviaazienda").serialize(),
success: function (result) {
$("#spaziomsg").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
$(".idr").change(function () {
if ($('.idr').prop('checked')) {
id = $(this).val()
creaattestatoAll(id, 0, '')
} else {
//alert('no')
}
});
}
});
}
function removeid(id) {
$("#" + id).remove();
}
function creafile(url, div, file) {
$("#" + div).html('
');
$.get(url, function (data, status) {
$.get('/admin/reportonline.asp?urlcompleto=' + url + '&filecompleto=' + file + '&div=' + div, function (data, status) {
$("#" + div).html('ok');
});
});
}
function senddatimail(email, id) {
if (email == '')
{
//$("#result").html(JSON.stringify(data))
allarme('email' + id, 'Inserire il numero di telefono ')
} else {
$.ajax({
url: "/ideastudio/sendutente.asp?idregistrazione_corso=" + id + "&email=" + email,
success: function (result) {
allarme('email' + id, result)
}
});
}
}
function checknuovasub() {
valore = $('#questasub').val()
if (valore == "nuovanuova")
{
$("#questasub").hide();
$("#nuovasub").show();
} else
{
$("#questasub").show();
$("#nuovasub").hide();
}
}
function trovasub(idazienda, idsegnalato, id) {
$("#sublocation" + id).html('
');
idagenzia = $('#idagenzia' + id).val()
$.ajax({
url: "/u/trovasub.asp?idazienda=" + idazienda + "&idsegnalato=" + idsegnalato + "&idagenzia=" + idagenzia,
success: function (result) {
$("#sublocation" + id).html(result);
}
});
}
function senddatiwa(telefono, id, prefisso) {
if (telefono == '')
{
//$("#result").html(JSON.stringify(data))
allarme('telefono' + id, 'Inserire il numero di telefono ')
} else {
$.ajax({
url: "/ideastudio/sendwa.asp?idregistrazione_corso=" + id + "&telefono=" + prefisso + telefono,
success: function (result) {
allarme('telefono' + id, '
OK')
},
error: function () {
allarme('telefono' + id, '
KO')
}
});
}
}
function sendWA(id, cosa, tel, messaggio) {
var customer;
console.log(tel + ' ' + messaggio)
if (cosa == "sendFile") {
var allegapdf = $("#" + id + " #allegapdf").val();
if (allegapdf == "si") {
phone = $("#" + id + " #numero").val(),
testo = $("#" + id + " #link").val(),
filename = $("#" + id + " #file").val()
$.ajax({
url: "/wa/default.asp?testo=" + testo + "&numero=" + phone + "&filename=" + filename,
success: function (data) {
$("#result").html("OK")
},
error: function () {
$("#result").html("KO")
}
});
}
}
phone = $("#" + id + " #numero").val(),
testo = $("#" + id + " #messaggio").val()
$.ajax({
url: "/wa/default.asp?testo=" + testo + "&numero=" + phone,
contentType: "application/json",
success: function (data) {
$("#result").html("ok")
},
error: function () {
$("#result").html("ko")
}
});
}
function addeventopercorso() {
idpercorsoformativo_eventi = $("#idpercorsoformativo_eventi").val()
if (idpercorsoformativo_eventi == "999999999") {
$('#eventocorso').show();
}
}
function cercaaziendaRep() {
$.ajax({
url: "lista_rep.asp",
data: $("#inviaazienda").serialize(),
success: function (result) {
$("#spaziomsg").html(result);
$(".data").datepicker();
$("table").addClass('tablesorter')
$('tr:odd').addClass('grigio');
$('tr:even').addClass('bianco');
$('div.clear:odd').addClass('grigio');
$('div.clear:even').addClass('bianco');
$("select").select2();
$(".select2-container").css("max-width", "350px");
$(".select2-container").css("min-width", "120px");
$("#linguas").select2('destroy');
$(".cosas").select2('destroy');
$(".idr").change(function () {
if ($('.idr').prop('checked')) {
id = $(this).val()
creaattestatoAll(id, 0, '')
} else {
//alert('no')
}
});
}
});
}
function ciao() {
for (var key in SCHEDULED_REQUEST) {
postRequest(SCHEDULED_REQUEST); /* post and empty SCHEDULED_REQUEST object */
for (var i = 0; i < 1000; i++) {
/* do something unnoticable but time consuming like writing a lot to console */
console.log('buying some time to finish saving data');
console.log('ciao');
$.ajax({
url: "/admin/log-out.asp?idanagrafica=" + tIdAnagrafica,
type: "GET",
success: function (result) {},
error: function (richiesta, stato, errori) {}
});
}
break;
}
}
$(document).ready(function () {
$(".allarga").mouseover(function () {
//$(this).css("background-color", "yellow");
var newWidth = parseInt($(this).width()) * 2;
$(this).width(newWidth);
//console.log($(this).width());
});
$(".allarga").mouseout(function () {
//$(this).css("background-color", "white");
$(this).width($(this).width() / 2);
});
});
function coloraFiltri() {
$(".select2-selection__rendered").each(function () {
var text = $(this).text();
if (text.indexOf(tScegli) < 0 && text.indexOf(tTutti) < 0 && text.indexOf('--') < 0) {
$(this).css("background-color", "LightBlue");
//$(this).css("color", "white");
}
});
}
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
document.addEventListener('DOMContentLoaded', function () {
const fileInput = document.getElementById('fileInput');
const fileSizeInfo = document.getElementById('fileSizeInfo');
const errorMessage = document.getElementById('errorMessage');
const submitButton = document.getElementById('submitButton');
const maxSizeInMB = 100; // Set maximum file size to 100 MB
if (!fileInput || !fileSizeInfo || !errorMessage || !submitButton) {
console.log("Required elements are missing from the DOM.");
return;
}
fileInput.addEventListener('change', function (event) {
// Get the selected file
const file = event.target.files[0];
if (file) {
// Get the file size in bytes
const fileSize = file.size;
// Convert the file size to megabytes (MB)
const fileSizeInMB = (fileSize / (1024 * 1024)).toFixed(2);
// Show the file size to the user
fileSizeInfo.textContent = `File size: ${fileSizeInMB} MB`;
// Check if the file size exceeds the maximum limit
if (fileSize > maxSizeInMB * 1024 * 1024) {
errorMessage.textContent = `The selected file is too large. The maximum allowed size is ${maxSizeInMB} MB.`;
// Reset the file input
event.target.value = '';
submitButton.disabled = true; // Disable the submit button
} else {
errorMessage.textContent = ''; // Clear any previous error messages
submitButton.disabled = false; // Enable the submit button
}
} else {
fileSizeInfo.textContent = '';
submitButton.disabled = true; // Disable the submit button
}
});
document.getElementById('uploadForm').addEventListener('submit', function (event) {
const file = fileInput.files[0];
if (file) {
// Verify the file size again before submitting the form
if (file.size > maxSizeInMB * 1024 * 1024) {
errorMessage.textContent = `The selected file is too large. The maximum allowed size is ${maxSizeInMB} MB.`;
event.preventDefault(); // Prevent the form from submitting
}
} else {
errorMessage.textContent = 'Please select a file before submitting the form.';
nooscura()
event.preventDefault(); // Prevent the form from submitting
}
});
});
function decodeHtmlEntities(text) {
// Definisci una regex per trovare i caratteri del tipo '
;' e ';'
const regex = /(?:x([a-fA-F\d]+)|(\d+));/g;
return text.replace(regex, (match, hex, decimal) => {
// Converti il codice esadecimale o decimale in un carattere
if (hex) {
return String.fromCharCode(parseInt(hex, 16));
} else {
return String.fromCharCode(parseInt(decimal, 10));
}
});
}