function setInnerHtml(http_request,elem_id) {
/*
readyState:
0 (uninitialized)
1 (loading)
2 (loaded)
3 (interactive)
4 (complete)
*/
if (http_request.readyState == 1) {
if(document.getElementById("ajax_loading")) {
document.getElementById("ajax_loading").style.display="block";
}
}
if (http_request.readyState == 4) {
if(document.getElementById("ajax_loading")) {
document.getElementById("ajax_loading").style.display="none";
}
if (http_request.status == 200) {
var el = document.getElementById(elem_id);
el.innerHTML = http_request.responseText;
//alert(elem_id + ' ' + http_request.responseText)
} else {
alert('Chyba ajaxu!');
}
}
}
function vygeneruj_prvek_podle_podminky(elem_id,funkce_ajax,podminka,hodnota) {
var http_request = false;
var request = 'f=' + funkce_ajax + '&' + podminka + '=' + hodnota;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
}
http_request.onreadystatechange = function() {
setInnerHtml(http_request,elem_id);
};
http_request.open('POST', 'https://www.interconsult.cz/js/ajax.php?' + request, true);
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http_request.send(request);
}
function obnovAjaxRS(ElemId, RecordsetName, FieldNames, SearchFieldValue, SearchFieldName) {
var http_request = false;
var request = 'f=obnovAjaxRS&RS=' + RecordsetName + '&FieldNames=' + FieldNames + '&SearchFieldValue=' + encodeURIComponent(SearchFieldValue) + '&SearchFieldName=' + SearchFieldName;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
}
http_request.onreadystatechange = function() {
setInnerHtml(http_request,ElemId);
};
http_request.open('POST', 'https://www.interconsult.cz/js/ajax.php?' + request, true);
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http_request.send(request);
}
function setridAjaxRS(ElemId, RecordsetName, OrderBy, OrderDirection) {
var http_request = false;
var request = 'f=obnovAjaxRS&RS=' + RecordsetName + '&OrderBy=' + OrderBy + '&OrderDirection=' + OrderDirection;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
}
http_request.onreadystatechange = function() {
setInnerHtml(http_request,ElemId);
};
http_request.open('POST', 'https://www.interconsult.cz/js/ajax.php?' + request, true);
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http_request.send(request);
}
/*********/
/* eshop */
/*********/
function nastav_platbu_dle_dopravy_ajax(elem_id,id_dopravy) {
var http_request = false;
var request = 'f=nastav_platbu_dle_dopravy&id_dopravy=' + id_dopravy;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
}
http_request.onreadystatechange = function() {
setInnerHtml(http_request,elem_id);
};
http_request.open('POST', 'https://www.interconsult.cz/js/ajax.php?' + request, true);
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http_request.send(request);
}
function vygeneruj_prvek_podle_podminky(elem_id,funkce_ajax,podminka,hodnota) {
var http_request = false;
var request = 'f=' + funkce_ajax + '&' + podminka + '=' + hodnota;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
}
http_request.onreadystatechange = function() {
setInnerHtml(http_request,elem_id);
};
http_request.open('POST', 'https://www.interconsult.cz/js/ajax.php?' + request, true);
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http_request.send(request);
}
function zkontroluj_platnost_slevoveho_kuponu(kod,url) {
var http_request = false;
var request = 'f=zkontroluj_platnost_slevoveho_kuponu&kod=' + kod + '&url=' + url;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
}
http_request.onreadystatechange = function() {
setInnerHtml(http_request,'div_cart_discount_voucher');
};
http_request.open('POST', 'https://www.interconsult.cz/js/ajax.php?' + request, true);
http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http_request.send(request);
}
/***************/
/* eshop konec */
/***************/