var timCounterMinute = 0; var timCounterTen = 0; var timCounterHour = 0; function setCookie(cname, cvalue, exdays) { 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 getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i '+json.response.message+'').show(); $("#thepanel").show(); if (json.response.result == 1) { alert("Tischreservierung erfolgreich durchgeführt!"); } else if (json.response.result == 1) { alert("Bestätigung eines Nachrückerplatzes für den Basar!"); } } ); } }); $('#checkdatatime').click(function() { $.getJSON("rest.php?action=3&tablecode="+$('#datatablecode').val()+"&uid="+getuid(), function(json) { $("#paneltime").html(json.response.message).show(); $("#thepanel").show(); }); }); $(document).ready(function() { document.getElementById("checkrefresh").click(); }); $('#formdata').keypress(function(e) { if(e.which == 13) { e.preventDefault(); jQuery('#checkdata').focus().click(); } }); function onSecond() { if ($('#forminforefresher').val() == -1) { if ($('#thepanel').is(":visible")) { if ($('#checkrefresh').is(":hidden")) { jQuery('#checkrefresh').focus().click(); } } } }; function onTenSeconds() { if ($('#forminforefresher').val() == 0) { if ($('#thepanel').is(":visible")) { if ($('#checkrefresh').is(":hidden")) { jQuery('#checkrefresh').focus().click(); } } } if ($('#formdata').is(":visible")) { jQuery('#checkdatatime').focus().click(); } if ($('#checkbook').is(":visible")) { $.getJSON("rest.php?action=5", function(json) { $('#checkprogress').css('width', json.response.statresult.bookings.percentfree+'%').attr('aria-valuenow', json.response.statresult.bookings.percentfree); $("#checkprogress").show(); $("#checkprogressbar").text(json.response.statresult.bookings.countfree+' Tische frei'); }); } }; function onMinute() { if ($('#forminforefresher').val() == 1) { if ($('#thepanel').is(":visible")) { if ($('#checkrefresh').is(":hidden")) { jQuery('#checkrefresh').focus().click(); } } } }; function onHour() { }; setInterval(function () { onSecond(); timCounterMinute = timCounterMinute + 1; if (timCounterMinute > 59) { onMinute(); timCounterMinute = 0; } timCounterTen = timCounterTen + 1; if (timCounterTen > 9) { onTenSeconds(); timCounterTen = 0; } timCounterHour = timCounterHour + 1; if (timCounterHour > 3599) { onHour(); timCounterHour = 0; } }, 1000); $( "#datamail" ) .focusout(function() { $.getJSON("rest.php?action=6&mail="+$('#datamail').val(), function(json) { if (json.response.code == 403) { alert(json.response.message); $('#datamail').val(""); $('#datamail').focus(); }; }); }); $( "#dataagain" ) .focusout(function(e) { if (!($('#datamail').val() == "")) { if (!($('#datamail').val() == $('#dataagain').val())) { alert("Erneute Mailadresseingabe stimmt nicht mit der Mailadresse überein, bitte Eingabe prüfen!"); $.getJSON("rest.php?action=6&mail="+$('#datamail').val(), function(json) { $('#dataagain').val(""); $('#dataagain').focus(); }); } } });