function GetXmlHttpObject(handler) { var objXmlHttp=null if (navigator.userAgent.indexOf("Opera")>=0) { alert("This example doesn't work in Opera") return } if (navigator.userAgent.indexOf("MSIE")>=0) { var strName="Msxml2.XMLHTTP" if (navigator.appVersion.indexOf("MSIE 5.5")>=0) { strName="Microsoft.XMLHTTP" } try { objXmlHttp=new ActiveXObject(strName) objXmlHttp.onreadystatechange=handler return objXmlHttp } catch(e) { alert("Error. Scripting for ActiveX might be disabled") return } } if (navigator.userAgent.indexOf("Mozilla")>=0) { objXmlHttp=new XMLHttpRequest() objXmlHttp.onload=handler objXmlHttp.onerror=handler return objXmlHttp } }function getagents(column,direc,end) { if(!end){ end = 0; } var myRandom=parseInt(Math.random()*99999999); // cache buster xmlHttp=GetXmlHttpObject(handleHttpResponse); xmlHttp.open("GET",url + "param=" + escape(column) + "&end="+ end+ "&mode=list&dir=" + direc + "&rand=" + myRandom, true); xmlHttp.send(null); }function spassera(column,direc,end){ var myRandom=parseInt(Math.random()*99999999); // cache buster xmlHttp=GetXmlHttpObject(handleHttpResponse); xmlHttp.open("GET",url + "param=" + escape(column) + "&end="+ end + "&mode=list&dir=" + direc + "&rand=" + myRandom, true); xmlHttp.send(null); }function saveRecord(mode,id,param,dir,end) { imie_i_nazwisko = document.getElementById("txtimie_i_nazwisko").value; login = document.getElementById("txtlogin").value; haslo = document.getElementById("txthaslo").value; telefon = document.getElementById("txttelefon").value; email = document.getElementById("txtemail").value; rejestracja = document.getElementById("txtrejestracja").value; ostatnio = document.getElementById("txtostatnio").value; uprawnienia = document.getElementById("txtuprawnienia").value; var myRandom=parseInt(Math.random()*99999999); // cache buster xmlHttp=GetXmlHttpObject(handleHttpResponse);xmlHttp.open("GET",url + "id="+id+"&imie_i_nazwisko="+imie_i_nazwisko+"&login="+login+"&haslo="+haslo+"&telefon="+telefon+"&email="+email+"&rejestracja="+rejestracja+"&ostatnio="+ostatnio+"&uprawnienia="+uprawnienia+"&end="+end+"&mode="+mode+"¶m="+escape(param)+"&dir="+dir+"&rand="+myRandom, true);xmlHttp.send(null); }function saveNewRecord(mode,param,dir,end) {imie_i_nazwisko = document.getElementById("txtimie_i_nazwisko").value; login = document.getElementById("txtlogin").value; haslo = document.getElementById("txthaslo").value; telefon = document.getElementById("txttelefon").value; email = document.getElementById("txtemail").value; rejestracja = document.getElementById("txtrejestracja").value; ostatnio = document.getElementById("txtostatnio").value; uprawnienia = document.getElementById("txtuprawnienia").value; if ( imie_i_nazwisko.length == 0 || login.length == 0 || haslo.length == 0 || telefon.length == 0 || email.length == 0 || rejestracja.length == 0 || ostatnio.length == 0 || uprawnienia.length == 0 ){ alert("Proszę wpisać wartość dla wszystkich pól"); } else { if(!end){ end = 0; } var myRandom=parseInt(Math.random()*99999999); // cache buster xmlHttp=GetXmlHttpObject(handleHttpResponse); xmlHttp.open("GET",url + "imie_i_nazwisko="+imie_i_nazwisko+"&login="+login+"&haslo="+haslo+"&telefon="+telefon+"&email="+email+"&rejestracja="+rejestracja+"&ostatnio="+ostatnio+"&uprawnienia="+uprawnienia+"&end="+end+"&mode="+mode+"¶m="+escape(param)+"&dir="+dir+"&rand="+myRandom, true);xmlHttp.send(null); } }function newRecord(mode,param,dir,end) { var myRandom=parseInt(Math.random()*99999999); // cache buster xmlHttp=GetXmlHttpObject(handleHttpResponse); xmlHttp.open("GET",url+"mode="+mode+ "&end="+ end +"¶m=" + escape(param) + "&dir=" + dir + "&rand=" + myRandom, true); xmlHttp.send(null); } function manipulateRecord(mode,id,param,dir,end) { if(mode=='delete') { if ( confirm("Czy jesteś pewien, że chcesz usunąć tego użytkownika ?") != 1 ) { return false; } } var myRandom=parseInt(Math.random()*99999999); // cache buster xmlHttp=GetXmlHttpObject(handleHttpResponse); xmlHttp.open("GET",url+"id="+id+ "&end="+ end+"&mode="+mode+"¶m=" + escape(param) + "&dir=" + dir + "&rand=" + myRandom, true); xmlHttp.send(null); }function handleHttpResponse() { if (xmlHttp.readyState == 4) { document.getElementById("hiddenDIV").style.visibility="visible"; document.getElementById("hiddenDIV").innerHTML=''; document.getElementById("hiddenDIV").innerHTML=xmlHttp.responseText; } }