{"id":5737,"date":"2020-03-16T10:25:33","date_gmt":"2020-03-16T10:25:33","guid":{"rendered":"https:\/\/www.ats-teconomy.com\/unsubscribe\/"},"modified":"2020-03-16T12:44:37","modified_gmt":"2020-03-16T12:44:37","slug":"unsubscribe","status":"publish","type":"page","link":"https:\/\/www.ats-teconomy.com\/nl\/unsubscribe\/","title":{"rendered":"Unsubscribe"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><style>\n.popupstyle {\n    position: absolute;\n    clear: both;\n    right: 552px;\n    left: 0px;\n    bottom: 81px;\n    margin-left: auto;\n    margin-right: auto;\n    width: 55%;\n    background: #eae2e2;\n    font-size: 14px;\n    display: none;\n}\n<\/style>\n<script>\nvar ajax = function(link, func) {\n  var xhttp = new XMLHttpRequest();\n\n  xhttp.onreadystatechange = function() {\n    if (xhttp.readyState == 4 && xhttp.status == 200) {\n      func(xhttp.responseText);\n    }\n  };\n  xhttp.open(\"GET\", link, true);\n  xhttp.send();\n\n  return xhttp;\n}\n\nvar subscribeResponse = function(html) {\n  var r = JSON.parse(html);\n  console.log(r);\n  if (rb = document.getElementById(\"ResultBox\")) {\n    if (r.Result == \"OK\") {\n      if (r.value == 1) {\n        rb.innerHTML = \"You have been successfully unsubscribed.\";\n      } else {\n        rb.innerHTML = \"You have been successfully unsubscribed..\";\n      }\n    } else {\n      rb.innerHTML = \"You have been successfully unsubscribed...\";\n    }\n \nvar popup=document.getElementById(\"popup\");\npopup.classList.add(\"popupstyle\");\n\npopup.style.display=\"block\";\npopup.style.backgroundColor =\"white\";\npopup.innerHTML='<div id=\"closebtn\" style=\"position: absolute; right: 30px; top: 10px;cursor:pointer\" >Close X<\/div>'+rb.innerHTML;\npopup.style.borderRadius =\"25px\";\npopup.style.padding=\"20px\";\npopup.style.boxShadow = \"10px 20px 30px grey\";\n  }\ndocument.getElementById('closebtn').addEventListener(\"click\", myFunction);\nfunction myFunction() {\n  document.getElementById(\"popup\").style.display=\"none\";\n}\n  setTimeout(function() {\n    if (rb = document.getElementById(\"ResultBox\")) {\n     \/\/ rb.parentNode.removeChild(rb);\n    }\n  }, 4000);\n}\n<\/script><div class=\"fusion-text fusion-text-1\"><div>\n<p><span style=\"font-size: 20px;\">We vinden het jammer om u te zien gaan.<\/span><\/p>\n<div id=\"popup\" style=\"display: none;\"><\/div>\n<p>U Staat bij ons ingeschreven onder dit e-mail adres: <span id=\"em_address\"><\/span><br \/>\nWilt u zich echt afmelden? <\/p>\n<\/div>\n<form id=\"unsubscribe\" class=\"unsubscribe_form\" action=\"#\"><input id=\"inputEmail\" name=\"email\" type=\"hidden\" \/><br \/>\n<input id=\"check_unsub\" name=\"unsubscribe\" required=\"required\" type=\"checkbox\" value=\"1\" \/><label for=\"check_unsub\">Ja. ik meld mij af. <\/label><br \/>\n<input id=\"submit-unsub\" name=\"submit\" type=\"submit\" value=\"Verzenden\" \/><\/form>\n<p><script>\ndocument.getElementById(\"submit-unsub\").addEventListener(\"click\", function(event){\n  event.preventDefault();});\n  var url_string = window.location.href;\n  var url = new URL(url_string);\n  var mailaddress = url.searchParams.get(\"email\");\nif(mailaddress) document.getElementById(\"em_address\").innerText = mailaddress;\ndocument.getElementById(\"submit-unsub\").addEventListener(\"click\", function(){\ndocument.getElementById(\"preloader\").style.display = \"block\";\n  if(mailaddress) document.getElementById(\"em_address\").innerText = mailaddress\n  var input = document.getElementById(\"check_unsub\");\nif(!input.checked)\n{document.getElementById(\"ResultBox\").innerHTML=\"<span style='color:red'>Please check the checkbox<\/span>\";\n setTimeout(location.reload(),9000);\nreturn false;\n}\nif(!mailaddress)\n{document.getElementById(\"ResultBox\").innerHTML=\"<span style='color:red'>Please provide email address<\/span>\";\nsetTimeout(location.reload(),9000);\nreturn false;\n}\n  if (input.checked && mailaddress){\n    ajax(\"https:\/\/www.ats-teconomy.com\/wp-content\/uploads\/2020\/03\/ajx_unsubscribe.php?do=it&email=\" + mailaddress + \"&checked=0\", subscribeResponse);\n  } else if (!input.checked && mailaddress){\n ajax(\"https:\/\/www.ats-teconomy.com\/wp-content\/uploads\/2020\/03\/ajx_unsubscribe.php?do=it&email=\" + mailaddress + \"&checked=1\", subscribeResponse)\n  }  else return false;\n});\n<\/script><\/p>\n<div id=\"ResultBox\"><img decoding=\"async\" id=\"preloader\" style=\"position: absolute; top: 20px; display: none;\" src=\"https:\/\/www.ats-teconomy.com\/loading\/\" \/><\/div>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5737","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ats-teconomy.com\/nl\/wp-json\/wp\/v2\/pages\/5737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ats-teconomy.com\/nl\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ats-teconomy.com\/nl\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ats-teconomy.com\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ats-teconomy.com\/nl\/wp-json\/wp\/v2\/comments?post=5737"}],"version-history":[{"count":0,"href":"https:\/\/www.ats-teconomy.com\/nl\/wp-json\/wp\/v2\/pages\/5737\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ats-teconomy.com\/nl\/wp-json\/wp\/v2\/media?parent=5737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}