/* Set a cookie */ function fc_setCookie(cookieName, cookieValue, nDays, samesite="lax") { var today = new Date(); var expire = new Date(); var path = window.location.hostname; if (nDays==null || nDays<0) nDays=0; if (nDays) { expire.setTime(today.getTime() + 3600000*24*nDays); document.cookie = cookieName+"="+encodeURIComponent(cookieValue) + ";samesite=" + samesite + ";path=" + path + ";expires=" + expire.toGMTString(); } else { document.cookie = cookieName+"="+encodeURIComponent(cookieValue) + ";samesite=" + samesite + ";path=" + path; } //alert(cookieName+"="+encodeURIComponent(cookieValue) + ";path=" + path); } /* Get a cookie */ function fc_getCookie(cookieName) { let matched = document.cookie.match(new RegExp('(^|;\\s*)' + cookieName + '=([^;]+)')); return matched ? decodeURIComponent(matched[2]) : ''; } function tableOrdering( order, dir, task ) { var form = document.getElementById("adminForm"); form.filter_order.value = order; form.filter_order_Dir.value = dir; var form = document.getElementById("adminForm"); adminFormPrepare(form, 2, task); } function getSEFurl(loader_el, loader_html, form, url_to_load, autosubmit_msg, autosubmit) { jQuery('#'+loader_el).html(loader_html); jQuery.ajax({ type: 'GET', url: url_to_load, dataType: "text", data: { }, success: function( responseText ) { form.action=responseText; var fcform = jQuery(form); fcform.attr('data-fcform_action', responseText); if (autosubmit) { jQuery('#'+loader_el).append(autosubmit_msg); adminFormPrepare(form, 2); } else { jQuery('#'+loader_el).html(''); } }, error: function (xhr, ajaxOptions, thrownError) { alert('Error status: ' + xhr.status + ' , Error text: ' + thrownError); } }); } function adminFormPrepare(form, postprep, task) { var extra_action = ''; var fcform = jQuery(form); var fcform_action = fcform.attr('data-fcform_action'); if ( typeof fcform_action === "undefined" || fcform_action === null ) { fcform_action = fcform.attr('action'); fcform.attr('data-fcform_action', fcform_action); } var var_sep = fcform_action.match(/\?/) ? '&' : '?'; for (i=0; i