{"id":2,"date":"2026-10-27T17:42:44","date_gmt":"2026-10-27T16:42:44","guid":{"rendered":"https:\/\/test.pfesch.at\/?page_id=2"},"modified":"2026-11-01T11:31:46","modified_gmt":"2026-11-01T10:31:46","slug":"beispielseite","status":"publish","type":"page","link":"https:\/\/buchung.pfesch.at\/?page_id=2","title":{"rendered":"Beispielseite"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n    <style>\n        .pfesch-box { max-width: 600px; margin: 20px auto; font-family: sans-serif; background: #f9f9f9; padding: 20px; border-radius: 8px; border: 1px solid #ccc; color: #222; }\n        .pfesch-header-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }\n        .pfesch-nav-btn { background: #0073aa; color: #fff; padding: 6px 12px; border-radius: 4px; border: none; cursor: pointer; font-weight: bold; }\n        .pfesch-nav-btn:hover { background: #005177; }\n        .pfesch-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 20px; text-align: center; }\n        .pfesch-day { padding: 10px 2px; border-radius: 4px; font-weight: bold; cursor: pointer; min-height: 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; }\n        .pfesch-day.empty { background: transparent; cursor: default; }\n        .pfesch-day.free { background-color: #28a745; color: #fff; }\n        .pfesch-day.free:hover { background-color: #218838; }\n        .pfesch-day.partial { background-color: #fd7e14; color: #fff; }\n        .pfesch-day.partial:hover { background-color: #e86800; }\n        .pfesch-day.booked { background-color: #dc3545; color: #fff; cursor: not-allowed; opacity: 0.6; }\n        .pfesch-day.disabled-days { background-color: #6c757d; color: #fff; cursor: not-allowed; opacity: 0.6; }\n        .pfesch-day.head { background: transparent; color: #333; cursor: default; font-weight: bold; min-height: auto; padding: 5px 0; }\n        .pfesch-field { margin-bottom: 12px; }\n        .pfesch-row { display: flex; gap: 10px; }\n        .pfesch-row .pfesch-field { flex: 1; }\n        .pfesch-field label { display: block; font-weight: bold; margin-bottom: 4px; font-size: 0.95em; }\n        .pfesch-field input, .pfesch-field select, .pfesch-field textarea { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 1em; }\n        .pfesch-btn { background: #0073aa; color: #fff; border: none; padding: 12px; font-size: 16px; border-radius: 4px; cursor: pointer; width: 100%; font-weight: bold; }\n        .pfesch-btn:hover { background: #005177; }\n        #pfesch-form-modal { display: none; margin-top: 15px; padding-top: 15px; border-top: 2px solid #ddd; }\n        #pfesch-response-msg { margin-bottom: 15px; font-weight: bold; }\n    <\/style>\n\n    <div class=\"pfesch-box\">\n        <div id=\"pfesch-response-msg\"><\/div>\n        <div id=\"pfesch-calendar-container\">\n                <div class=\"pfesch-header-nav\" data-year=\"2026\" data-month=\"11\">\n                    <span><\/span>\n                <h3 style=\"margin: 0;\">November 2026<\/h3>\n        <button type=\"button\" class=\"pfesch-nav-btn\" onclick=\"loadPfeschMonth(2026, 12)\">Vor \u25b6<\/button>\n    <\/div>\n\n    <div style=\"margin-bottom: 15px; font-size: 0.85em; text-align: center;\">\n        <span style=\"color:#28a745;\">\u25a0 Frei<\/span> \u00a0|\u00a0 \n        <span style=\"color:#fd7e14;\">\u25a0 Teilweise frei<\/span> \u00a0|\u00a0 \n        <span style=\"color:#dc3545;\">\u25a0 Belegt \/ Gesperrt<\/span> \u00a0|\u00a0 \n        <span style=\"color:#6c757d;\">\u25a0 < 5 Tage<\/span>\n    <\/div>\n\n    <div class=\"pfesch-grid\">\n        <div class=\"pfesch-day head\">Mo<\/div><div class=\"pfesch-day head\">Di<\/div><div class=\"pfesch-day head\">Mi<\/div>\n        <div class=\"pfesch-day head\">Do<\/div><div class=\"pfesch-day head\">Fr<\/div><div class=\"pfesch-day head\">Sa<\/div><div class=\"pfesch-day head\">So<\/div>\n        \n        <div class='pfesch-day empty'><\/div><div class='pfesch-day empty'><\/div><div class='pfesch-day empty'><\/div><div class='pfesch-day empty'><\/div><div class='pfesch-day empty'><\/div><div class='pfesch-day empty'><\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>1<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>2<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>3<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>4<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>5<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>6<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>7<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>8<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>9<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>10<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>11<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>12<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>13<\/div><div class='pfesch-day disabled-days' title='Mindestens 5 Tage Vorlauf'>14<\/div><div class='pfesch-day booked' title='Ausgebucht \/ Gesperrt'>15<\/div><div class='pfesch-day booked' title='Ausgebucht \/ Gesperrt'>16<\/div><div class='pfesch-day partial' title='Teilweise verf\u00fcgbar' onclick='clickPfeschDate(\"2026-11-17\")'>17<\/div><div class='pfesch-day partial' title='Teilweise verf\u00fcgbar' onclick='clickPfeschDate(\"2026-11-18\")'>18<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-19\")'>19<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-20\")'>20<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-21\")'>21<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-22\")'>22<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-23\")'>23<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-24\")'>24<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-25\")'>25<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-26\")'>26<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-27\")'>27<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-28\")'>28<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-29\")'>29<\/div><div class='pfesch-day free' title='Frei' onclick='clickPfeschDate(\"2026-11-30\")'>30<\/div>    <\/div>\n            <\/div>\n\n        <div id=\"pfesch-form-modal\">\n            <h4 style=\"color: #0073aa; border-bottom: 1px solid #ddd; padding-bottom: 8px;\">Anfrage f\u00fcr den <span id=\"pfesch-date-show\"><\/span><\/h4>\n            <form id=\"pfesch-booking-form\">\n                <input type=\"hidden\" name=\"action\" value=\"pfesch_submit_booking\">\n                <input type=\"hidden\" name=\"datum\" id=\"pfesch-date-input\">\n                \n                <div class=\"pfesch-field\">\n                    <label>Gew\u00fcnschtes Erlebnis:<\/label>\n                    <select name=\"erlebnis\" id=\"pfesch-erlebnis-select\" required onchange=\"onErlebnisChange()\">\n                        <!-- Dynamisch bef\u00fcllt -->\n                    <\/select>\n                <\/div>\n\n                <div class=\"pfesch-row\">\n                    <div class=\"pfesch-field\">\n                        <label>Gew\u00fcnschte Uhrzeit (Beginn):<\/label>\n                        <select name=\"uhrzeit\" id=\"pfesch-time-select\" required>\n                            <!-- Dynamisch bef\u00fcllt -->\n                        <\/select>\n                    <\/div>\n                    <div class=\"pfesch-field\">\n                        <label id=\"personen-label\">Personenanzahl:<\/label>\n                        <input type=\"number\" name=\"personen\" id=\"pfesch-personen-input\" min=\"1\" max=\"60\" required placeholder=\"max. 60\">\n                    <\/div>\n                <\/div>\n\n                <div class=\"pfesch-row\">\n                    <div class=\"pfesch-field\">\n                        <label>Vorname:<\/label>\n                        <input type=\"text\" name=\"vorname\" required placeholder=\"Vorname\">\n                    <\/div>\n                    <div class=\"pfesch-field\">\n                        <label>Nachname:<\/label>\n                        <input type=\"text\" name=\"nachname\" required placeholder=\"Nachname\">\n                    <\/div>\n                <\/div>\n\n                <div class=\"pfesch-field\">\n                    <label>Stra\u00dfe und Hausnummer:<\/label>\n                    <input type=\"text\" name=\"strasse\" required placeholder=\"Musterstra\u00dfe 12\">\n                <\/div>\n\n                <div class=\"pfesch-row\">\n                    <div class=\"pfesch-field\" style=\"flex: 0 0 120px;\">\n                        <label>PLZ:<\/label>\n                        <input type=\"text\" name=\"plz\" required placeholder=\"4020\">\n                    <\/div>\n                    <div class=\"pfesch-field\">\n                        <label>Ort:<\/label>\n                        <input type=\"text\" name=\"ort\" required placeholder=\"Linz\">\n                    <\/div>\n                <\/div>\n\n                <div class=\"pfesch-field\">\n                    <label>Telefonnummer:<\/label>\n                    <input type=\"tel\" name=\"telefon\" placeholder=\"+43 ...\">\n                <\/div>\n\n                <div class=\"pfesch-field\">\n                    <label>E-Mail-Adresse:<\/label>\n                    <input type=\"email\" name=\"email\" required placeholder=\"name@beispiel.at\">\n                <\/div>\n\n                <div class=\"pfesch-field\">\n                    <label>Sonstige Info und Fragen:<\/label>\n                    <textarea name=\"notizen\" rows=\"3\" placeholder=\"Ihre Nachricht oder Sonderw\u00fcnsche...\"><\/textarea>\n                <\/div>\n\n                <button type=\"submit\" class=\"pfesch-btn\" id=\"pfesch-submit-btn\">Anfrage kostenfrei absenden<\/button>\n            <\/form>\n        <\/div>\n    <\/div>\n\n    <script>\n    var currentDaySlots = {};\n\n    function loadPfeschMonth(year, month) {\n        var formData = new FormData();\n        formData.append('action', 'pfesch_load_month');\n        formData.append('year', year);\n        formData.append('month', month);\n\n        fetch('https:\/\/buchung.pfesch.at\/wp-admin\/admin-ajax.php', { method: 'POST', body: formData })\n        .then(response => response.text())\n        .then(html => { document.getElementById('pfesch-calendar-container').innerHTML = html; });\n    }\n\n    function clickPfeschDate(d) {\n        document.getElementById('pfesch-date-input').value = d;\n        \n        var parts = d.split('-');\n        var dateObj = new Date(parts[0], parts[1] - 1, parts[2]);\n        var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };\n        document.getElementById('pfesch-date-show').innerText = dateObj.toLocaleDateString('de-DE', options);\n\n        var formData = new FormData();\n        formData.append('action', 'pfesch_get_day_slots');\n        formData.append('datum', d);\n\n        fetch('https:\/\/buchung.pfesch.at\/wp-admin\/admin-ajax.php', { method: 'POST', body: formData })\n        .then(response => response.json())\n        .then(data => {\n            if(data.success) {\n                currentDaySlots = data.data;\n                var erlebnisSelect = document.getElementById('pfesch-erlebnis-select');\n                erlebnisSelect.innerHTML = '';\n\n                for (var title in currentDaySlots) {\n                    var opt = document.createElement('option');\n                    opt.value = title;\n                    opt.innerText = title;\n                    erlebnisSelect.appendChild(opt);\n                }\n\n                onErlebnisChange();\n                document.getElementById('pfesch-form-modal').style.display = 'block';\n            }\n        });\n    }\n\n    function onErlebnisChange() {\n        var erlebnisSelect = document.getElementById('pfesch-erlebnis-select');\n        var timeSelect = document.getElementById('pfesch-time-select');\n        var personenInput = document.getElementById('pfesch-personen-input');\n        var personenLabel = document.getElementById('personen-label');\n        var selectedTitle = erlebnisSelect.value;\n        \n        timeSelect.innerHTML = '';\n        var slotData = currentDaySlots[selectedTitle] || { hours: [], max_personen: 60 };\n        \n        slotData.hours.forEach(function(t) {\n            var opt = document.createElement('option');\n            opt.value = t;\n            opt.innerText = t + ' Uhr';\n            timeSelect.appendChild(opt);\n        });\n\n        personenInput.max = slotData.max_personen;\n        personenLabel.innerText = 'Personenanzahl (max. ' + slotData.max_personen + '):';\n    }\n\n    document.getElementById('pfesch-booking-form').addEventListener('submit', function(e) {\n        e.preventDefault();\n        var erlebnisSelect = document.getElementById('pfesch-erlebnis-select');\n        var personenInput = document.getElementById('pfesch-personen-input');\n        var slotData = currentDaySlots[erlebnisSelect.value];\n\n        if (slotData && parseInt(personenInput.value) > slotData.max_personen) {\n            alert('Die maximale Personenanzahl f\u00fcr dieses Erlebnis betr\u00e4gt ' + slotData.max_personen + '.');\n            return;\n        }\n\n        var btn = document.getElementById('pfesch-submit-btn');\n        var msgDiv = document.getElementById('pfesch-response-msg');\n        btn.disabled = true;\n        btn.innerText = 'Wird gesendet...';\n\n        var formData = new FormData(this);\n\n        fetch('https:\/\/buchung.pfesch.at\/wp-admin\/admin-ajax.php', { method: 'POST', body: formData })\n        .then(response => response.json())\n        .then(data => {\n            btn.disabled = false;\n            btn.innerText = 'Anfrage kostenfrei absenden';\n            if(data.success) {\n                msgDiv.innerHTML = '<p style=\"color:green; font-size:1.1em;\">' + data.data + '<\/p>';\n                document.getElementById('pfesch-booking-form').reset();\n                document.getElementById('pfesch-form-modal').style.display = 'none';\n\n                var headerNav = document.querySelector('.pfesch-header-nav');\n                if (headerNav) {\n                    loadPfeschMonth(headerNav.getAttribute('data-year'), headerNav.getAttribute('data-month'));\n                }\n            } else {\n                msgDiv.innerHTML = '<p style=\"color:red;\">' + data.data + '<\/p>';\n            }\n        })\n        .catch(error => {\n            btn.disabled = false;\n            btn.innerText = 'Anfrage kostenfrei absenden';\n            msgDiv.innerHTML = '<p style=\"color:red;\">Es ist ein Fehler aufgetreten. Bitte versuche es erneut.<\/p>';\n        });\n    });\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-2","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=\/wp\/v2\/pages\/2","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2"}],"version-history":[{"count":2,"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=\/wp\/v2\/pages\/2\/revisions"}],"predecessor-version":[{"id":9,"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=\/wp\/v2\/pages\/2\/revisions\/9"}],"wp:attachment":[{"href":"https:\/\/buchung.pfesch.at\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}