function getOccurrencesOfScript(url) { var occurrences = 0; var scripts = document.getElementsByTagName('script'); for (var i = scripts.length; i--;) { if (scripts[i].src=="") { continue; } if (String(scripts[i].src).startsWith(url)) { occurrences++; console.log("Plugin GDPR finded "+occurrences); } } return occurrences; } var gdprReferenceRequest = "46"; var gdprReferenceSession = "46"; if (gdprReferenceSession=="") { alert("Parametri insufficienti per il plugin GDPR."); } var gdprId = "343658595a313936384058595a3139363821"; var gdprNome = "Giuseppe"; var gdprCognome = "Savarino"; var gdprSocieta = "Auto Trucks S.r.l."; var gdprEmail = "amministrazione@autotrucksmodica.it"; var gdprPEC = ""; var gdprSitoWeb = "www.autotrucksmodica.it/"; var gdprIndirizzo = "S.S 115 Modica/Ispica KM 345,00 snc 97015, Modica"; var gdprCellulare = "+39 0932 906719"; var gdprCodiceFiscale = "01301490882"; var gdprPartitaIVA = "01301490882"; var gdprIconaVisibile = "N"; if (gdprSocieta=="") { gdprSocieta = gdprNome+" "+gdprCognome; } var gdprPrefixCookie = "DG_GDPR_COOKIE_"; var gdprIdCategoryNecessario = "1"; var gdprHead; var gdprBody; var dg_gdpr_cookie_not_setting = 0; var dg_gdpr_cookie_required_not_setting = 0; var dg_gdpr_cookie_not_required_not_setting = 0; var dg_gdpr_cookie_category = {}; window.addEventListener("load", function(evt) { document.addEventListener("click", function(e) { e = e || window.event; var target = e.target || e.srcElement; if (target.id=="ID_DIV_GDPR_DIALOG") { gdprHideDialog(document.getElementById("ID_DIV_GDPR_DIALOG")); } else if (target.id=="ID_DIV_GDPR_DIALOG_REFUSE_COMUNICATION") { gdprHideDialog(document.getElementById("ID_DIV_GDPR_DIALOG_REFUSE_COMUNICATION")); } }, false); gdprHead = document.getElementsByTagName("head")[0]; gdprBody = document.getElementsByTagName("body")[0]; gdprOnReadyCode(); }); function gdprAlert() { var divPrincipalClass="col-sm-12-dggdpr col-md-12-dggdpr offset-lg-2-dggdpr col-lg-8-dggdpr"; var rowPaddingColCategory = "padding-right:0px;padding-left:2px;white-space:nowrap;"; var html = '' + ''; return html; } function gdprRiempiGDPRDialog() { var elementTemp = document.getElementById("ID_DIV_GDPR_DIALOG").getElementsByClassName("modal-body-dggdpr")[0].getElementsByClassName("row-dggdpr")[0]; elementTemp.innerHTML = ""; gdprAppend( elementTemp, "", gdprSigleBlockGDPRDialog( "CONSENSO ALLA PRIVACY", "Accetta il consenso alla nuova Privacy Europea GDPR. Se non hai letto ancora le condizione entra.", "DG_GDPR_COOKIE_CONSENT", gdprGetCookie("DG_GDPR_COOKIE_CONSENT"), "gdprConsentPage", "fa-check-square-dggdpr" ) ); gdprAppend( elementTemp, "", gdprSigleBlockGDPRDialog( "PRIVACY SITI TERZE PARTI", "Entra in quest'area per accettare o rifiutare i cookie di funzionalita' che sono inserite nel sito.", "", "", "gdprPrivacySettingsPage", "fa-user-secret-dggdpr" ) ); gdprAppend( elementTemp, "", gdprSigleBlockGDPRDialog( "CONTATTA IL MANAGER", "Entra in quest'area e contatta il tuo Manager per ogni tipo di richiesta fra' quelle nell'elenco.", "", "", "gdprContactDPOPage", "fa-envelope-dggdpr" ) ); } function gdprLoadPageIntoDialog(content,key,value) { var elementTemp = document.getElementById("ID_DIV_GDPR_DIALOG").getElementsByClassName("modal-body-dggdpr")[0].getElementsByClassName("row-dggdpr")[0]; elementTemp.innerHTML = window[content].apply(null, [key,value]); } function gdprManageUsernameInFormRequestContact(this_,id) { if (this_.classList.contains("text-success-dggdpr")) { gdprShowElement(document.getElementById(id),"1.0"); document.getElementById(id).querySelectorAll("input[name='SIGNED']")[0].value = "1"; document.getElementById(id).querySelectorAll("input[name='USERNAME']")[0].required = true; } else { gdprHideElement(document.getElementById(id)); document.getElementById(id).querySelectorAll("input[name='SIGNED']")[0].value = "0"; document.getElementById(id).querySelectorAll("input[name='USERNAME']")[0].required = false; } } function gdprSendToServerCookieCategorySeletion() { var cookieCategoryForUrl = ""; for (var key in dg_gdpr_cookie_category) { var idTemp = dg_gdpr_cookie_category[key]["ID_CATEGORIA"]; var nomeTemp = dg_gdpr_cookie_category[key]["NOME_CATEGORIA"]; cookieCategoryForUrl += gdprPrefixCookie+"CATEGORY_"+idTemp+"_"+nomeTemp.toUpperCase()+"-"+gdprGetCookie(gdprPrefixCookie+"CATEGORY_"+idTemp+"_"+nomeTemp.toUpperCase())+"_COKSEP_"; } var xhttp = new XMLHttpRequest(); var d = new Date(); var urlTemp = "//www.piattaformasicura.it/DigitingMainProject/MainProject/php/ajax_external_action.php?"+ "IP=54.242.193.41&"+ "UUID="+gdprGetCookie("DG_GDPR_COOKIE_UUID")+"&"+ "DATA="+d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate()+" "+d.getHours()+"_"+d.getMinutes()+"_"+d.getSeconds()+"&"+ "ID_USER=" + gdprId + "&" + "CONFIG=3658595a313936384058595a3139363821&" + "PATH=6a7765626d6f646963612f58595a313936384058595a3139363821&" + "job=register_cookie_category_selection_from_gdpr_plugin&"+ "cookieCategory="+cookieCategoryForUrl; xhttp.open("POST", urlTemp, true); xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xhttp.onreadystatechange = function() { if(xhttp.readyState == 4 && xhttp.status == 200) { sendCookieToServer(false); } } xhttp.send(); }