// Function for set the cookie for days
function tekGdprSetCookie(cname, cvalue, exdays) { //create js cookie
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires=" + d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function sendTheDatatandc()
{
var formId = document.getElementById('TandC_Data');
if(document.querySelector('#t-and-c--checkbox:checked')!==null) {
var set = 2;
var postData = $('#TandC_Data').serialize()+'&gdpraccepttandc=submit';
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
set = this.responseText;
}
};
xhttp.open("POST", "https://plusmodel.wpenginepowered.com/wp-content/plugins/wpgdpr_g8zuDP/update.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(postData);
tekGdprSetCookie('WP-GDPR-Compliance-tandc','1.0',3650);
window.location='https://www.plus-model-mag.com'; }
else {
alert("Please check the checkbox");
}
}
// Hit the file update.php to work it without refresh with XMLHttp
function gdrpSetCookie(name, cookieName) { //ajax and js cookie function call
var set = 2;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
set = this.responseText;
}
};
xhttp.open("POST", "https://plusmodel.wpenginepowered.com/wp-content/plugins/wpgdpr_g8zuDP/update.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(name);
}
// Function to check the cookie exist or not
function getGdprCookieCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) {
return parts.pop().split(";").shift();
} else {
return null;
}
}
// get cookie value
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i
lang="en-US">
Right to Be Forgotten - PLUS Model Magazine