"; txt += ""; txt += ""; txt += "
"; txt += "
"; txt += "
"; $("#customerinfo").html(txt); $("#inputformsubmit").button({ disabled: false }); //$("#inputformsubmit").prop('disabled', false); $("#inputformchoice").hide(); $("#inputformform").css('visibility', 'visible'); this.persontype = "p"; } else if (ptype == "ju") { var txt = "
"; txt += "
"; // txt += "
"; txt += ""; txt += "
"; txt += "
"; txt += "
"; $("#customerinfo").html(txt); $("#inputformsubmit").button({ disabled: false }); //$("#inputformsubmit").prop('disabled', false); $("#inputformchoice").hide(); $("#inputformform").css('visibility', 'visible'); this.persontype = "j"; } else if (ptype == "sc") { var txt = "
"; txt += "
"; // txt += "
"; txt += ""; txt += "
"; txt += "
"; txt += "
"; txt += "
"; $("#customerinfo").html(txt); $("#inputformsubmit").button({ disabled: false }); //$("#inputformsubmit").prop('disabled', false); $("#inputformchoice").hide(); $("#inputformform").css('visibility', 'visible'); this.persontype = "s"; } else { $("#inputformform").css('visibility', 'hidden'); $("#customerinfo").html(""); $("#inputformsubmit").button({ disabled: true }); //$("#inputformsubmit").prop('disabled', true); this.persontype = ""; $("#inputformchoice").show(); } } // Zamknout a odemknout údaje zákazníka pro editaci InputForm.prototype.lockCustomer = function(lock) { $("#name").prop("readonly",lock); $("#address").prop("readonly",lock); $("#phone").prop("readonly",lock); $("#email").prop("readonly",lock); if (!lock) { this.cid = ""; } } InputForm.prototype.toggleLockCustomer = function() { $("#remember").prop("checked", !$("#remember").prop("checked")); if (!$("#remember").prop("checked")) { this.lockCustomer(false); } } function showConfirmation(data) { loader(false); if (data.val!=false) { $("#confirmation h1").html("The reservation has been sent"); $("#confirmation h1").removeClass("warning"); } else { $("#confirmation h1").html("The reservation could not be sent"); $("#confirmation h1").addClass("warning"); } $("#confirmation p").html(data.msg); $("#confirmation").dialog("open"); } function showMessage(data, title) { if (typeof title === "undefined") { var title = ""; } $("#confirmation h1").html(title); $("#confirmation h1").addClass("warning"); $("#confirmation p").html(data); $("#confirmation").dialog("open"); } function closeConfirmation() { $("#confirmation").dialog("close"); cal.onChange(); } function openCancellation(id) { $('#cancellation').dialog('open'); $('#cancellationid').val(id); $("#cancellationemail").val(""); } function closeCancellation() { $("#cancellation").dialog("close"); } function confirmCancellation() { var id = $("#cancellationid").val(); var email = $("#cancellationemail").val(); if (email == "") { return false; } $("#cancellationemail").hide(); $("#cancellationconfirmbutton").hide(); $("#cancellationemail").val(""); $("#cancellationid").val(""); loader(true); $.ajax( { url: "query.php", type: "POST", data: { c:"cancel_reservation", id: id, email: email }, dataType: "json", success: function (data) { loader(false); if (data.val) { $("#cancellation p").html(ls.cancellationdone); cal.changeMonth(data.date.substr(3,2)*1); } else { $("#cancellation p").html(""+ls.cancellationerror+""); } }, error: function () { loader(false); $("#cancellation p").html(""+ls.cancellationerror+""); } } ); } function validateEmail(value) { var input = document.createElement('input'); input.type = 'email'; input.value = value; return typeof input.checkValidity == 'function' ? input.checkValidity() : /\S+@\S+\.\S+/.test(value); } function validatePhone(value) { var re = new RegExp('^[\\d\\+\\-\\s\\.,]*(?:l|line|linka)?[\\d\\s\\.\\-]*$', 'i'); return re.test(value); }