//zmienne publiczne
var http = getHttpObj();
var base_path = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname.split('/')[1];
function getHttpObj() {
return (navigator.appName == "Microsoft Internet Explorer") ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
function isLetter (pword) {
return ( ((pword >= "a") && (pword <= "z")) || ((pword >= "A") && (pword <= "Z")) )
}
function isDigit (pword ) {
return ((pword >= "0") && (pword <= "9"))
}
function isNumeric(sText) {
if (sText) {
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
var k;
for (k = 0; k < sText.length && IsNumber == true; k++)
{
Char = sText.charAt(k);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
} else IsNumber = false;
return IsNumber;
}
/**
* zwraca wartosc (value) danej zmiennej (varname)
* z żądania GET
*/
function getValue(url,varname) {
var i = 0;
var value = false;
// Firts, split the url by the ?
var qparts = url.split("?");
// Check that there is a querystring
if (qparts.length > 1) {
// Then find the querystring, everything after the ?
var query = qparts[1];
// Split the query string into variables (separates by &s)
var vars = query.split("&");
// Iterate through vars, checking each one for varname
for (i=0;i
Nazwa użytkownika: | |
Hasło: |
Logowanie zakończone sukcesem
'; $('#msgDiv').fadeIn('fast'); //wykonaj przekazaną funkcję po zalogowaniu if (nextToDo != 'undefined' ) { try { eval(nextToDo); } catch(err) { window.alert("Wystąpił błąd wewnętrzny systemu \n jeśli jesteś w trakcie zamówienia ponów próbę"); } } else setTimeout("$('#msgDiv').fadeOut('slow',$.unblockUI())",1000); } else if (http.responseText == -2) { document.getElementById('msgDiv').innerHTML = 'Konto zablokowane - skontaktuj się z pracownikiem OZK
'; $('#msgDiv').fadeIn('fast'); } else { document.getElementById('msgDiv').innerHTML = 'Nieprawidłowe hasło lub/i login użytkownika
'; $('#msgDiv').fadeIn('fast'); setTimeout("$('#msgDiv').fadeOut('slow')",1000); } } } // modyfikujemy nagłówek http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); //tego już przeglądarka zabrania robić //http.setRequestHeader("Content-length", ciag.length); http.send(ciag); } } function submitEnter(e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return false; if (keycode == 13) { login(); return true; } else return false; } function logout() { var ciag='action=logout'; http.abort(); //resetuje dotychczasowe funcje obslugi if(navigator.appName != "Microsoft Internet Explorer") http.onreadystatechange = null; http.open("POST", base_path + "/engine/common.php", true); http.onreadystatechange=function() { if(http.readyState == 4) { //tutaj obsługa prawidłowego logowania if (http.responseText == 1) { $.blockUI({ message: "Zostałeś(-aś) prawidłowo wylogowany
Nie jesteś już zalogowany
sesja wygasła wcześniej.
Nowe zamówienie
'; orderDiv += '"' + title + '"
'; orderDiv += 'Akceptuję Regulamin zamówień'; orderDiv += 'Zamówienie przyjęte.
'; confMsg += 'Pamiętaj, że masz teraz 3 dni robocze na odbiór zamówienia!
'; confMsg += 'Próba zamówienia mapy przez użytkownika o uprawnieniach redaktora.
Proszę zalogować się ponownie na konto czytelnika.
Próba zamówienia kolejnej pozycji ponad obowiązujący limit zamówień.
'; } else if (http.responseText == -4) { document.getElementById('msgDiv').innerHTML = 'Z zalogowanym obecnie kontem redaktora nie jest powiązane żadne konto czytelnika.
'; } else { document.getElementById('msgDiv').innerHTML = 'Wystąpił nieobsługiwany wyjątek
'; } } } // modyfikujemy nagłówek http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(ciag); } } function showMyAccount() { var userDiv = 'Zmiana hasła ';
userDiv += 'wprowadź stare hasło: ';
userDiv += 'wprowadź nowe hasło: ';
userDiv += 'wprowadź powtórnie nowe hasło:
Brak zamówień
'; $("#tab2").hide(); $("#l2").removeClass("curr"); $("#l2").addClass("other"); $("#l1").removeClass("other"); $("#l1").addClass("curr"); $("#tab1").show(); $("#tab1").html(userDiv); } } // modyfikujemy nagłówek http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(ciag); } //TODO: przetestować function changeUserPasswd() { var oldPass = $("#tbxOldPass").val(); var newPass = $("#tbxNewPass").val(); var newPass2 = $("#tbxNewPass2").val(); var errMsg = false; if ((!newPass) || (!newPass2)) errMsg = 'Nie wprowadziłeś nowego hasłaHasło zmienione pomyślnie
'; $('#msgDiv').fadeIn('fast'); setTimeout("$('#msgDiv').fadeOut('slow')",1000); } else if (http.responseText == -10) { document.getElementById('msgDiv').innerHTML = 'Podałeś nieprawidłowe dotychczasowe (stare) hasło
'; $('#msgDiv').fadeIn('fast'); setTimeout("$('#msgDiv').fadeOut('slow')",1000); } else { document.getElementById('msgDiv').innerHTML = 'Podałeś nieprawidłowe dotychczasowe (stare) hasło
'; $('#msgDiv').fadeIn('fast'); setTimeout("$('#msgDiv').fadeOut('slow')",1000); } } } // modyfikujemy nagłówek http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); //tego już przeglądarka zabrania robić //http.setRequestHeader("Content-length", ciag.length); http.send(ciag); } else { document.getElementById('msgDiv').innerHTML = '' + errMsg + '
'; $('#msgDiv').fadeIn('fast'); setTimeout("$('#msgDiv').fadeOut('slow')",1000); } } //TODO: przetestować function getLocations() { var ciag='action=getLocations'; http.abort(); //resetuje dotychczasowe funcje obslugi if(navigator.appName != "Microsoft Internet Explorer") http.onreadystatechange = null; http.open("POST", base_path + "/engine/common.php", true); http.onreadystatechange=function() { if(http.readyState == 4) { if (http.responseText != '-1') { var cont = ''; var response = eval("(" + http.responseText + ")"); for (var i in response) { cont += '' + response[i][1]; } if (document.getElementById('lokalizacje')) document.getElementById('lokalizacje').innerHTML = cont; } } } // modyfikujemy nagłówek http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); //tego już przeglądarka zabrania robić //http.setRequestHeader("Content-length", ciag.length); http.send(ciag); } //ustawione na sztywno //setTimeout("getLocations();","500");