{"id":1377,"date":"2025-08-26T18:53:41","date_gmt":"2025-08-26T18:53:41","guid":{"rendered":"https:\/\/paulweaferphotography.com\/w\/?page_id=1377"},"modified":"2025-08-26T18:53:41","modified_gmt":"2025-08-26T18:53:41","slug":"booking","status":"publish","type":"page","link":"https:\/\/paulweaferphotography.com\/w\/booking\/","title":{"rendered":"booking"},"content":{"rendered":"    <form method=\"post\" id=\"pw-booking-form\">\n        <p><input type=\"text\" name=\"pw_name\" placeholder=\"Your Name\" required><\/p>\n        <p><input type=\"email\" name=\"pw_email\" placeholder=\"Your Email\" required><\/p>\n        <p><input type=\"text\" name=\"pw_phone\" placeholder=\"Your Phone\"><\/p>\n        <p><input type=\"text\" id=\"pw_date\" name=\"pw_date\" placeholder=\"Select Date\" required readonly><\/p>\n        <p>\n            <select name=\"pw_time\" id=\"pw_time\" required>\n                <option value=\"\">Select Time<\/option>\n                <option value=\"10:00\">10:00<\/option>\n                <option value=\"12:00\">12:00<\/option>\n                <option value=\"14:00\">14:00<\/option>\n                <option value=\"16:00\">16:00<\/option>\n            <\/select>\n        <\/p>\n        <p><input type=\"submit\" name=\"pw_submit\" value=\"Book Now\"><\/p>\n    <\/form>\n\n    <script src=\"https:\/\/code.jquery.com\/jquery-3.6.0.min.js\"><\/script>\n    <script src=\"https:\/\/code.jquery.com\/ui\/1.13.2\/jquery-ui.min.js\"><\/script>\n    <link rel=\"stylesheet\" href=\"https:\/\/code.jquery.com\/ui\/1.13.2\/themes\/smoothness\/jquery-ui.css\">\n\n    <script>\n    jQuery(document).ready(function($) {\n        var bookings = {\"2025-08-26\":[\"16:00\",\"14:00\"],\"2025-08-28\":[\"16:00\"],\"2025-08-30\":[\"10:00\"]};\n\n        \/\/ Datepicker with disabled dates\n        $(\"#pw_date\").datepicker({\n            dateFormat: \"yy-mm-dd\",\n            beforeShowDay: function(date) {\n                var d = $.datepicker.formatDate('yy-mm-dd', date);\n                if (bookings[d] && bookings[d].length >= 4) {\n                    return [false, \"\", \"Fully booked\"];\n                }\n                return [true, \"\", \"Available\"];\n            },\n            minDate: 0\n        });\n\n        \/\/ Disable booked times dynamically\n        $(\"#pw_date\").on(\"change\", function() {\n            var selectedDate = $(this).val();\n            var timesBooked = bookings[selectedDate] || [];\n\n            $(\"#pw_time option\").each(function() {\n                var val = $(this).val();\n                if (timesBooked.includes(val)) {\n                    $(this).attr(\"disabled\", \"disabled\").text(val + \" (Booked)\");\n                } else {\n                    $(this).removeAttr(\"disabled\").text(val);\n                }\n            });\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":"closed","template":"","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-1377","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/pages\/1377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/comments?post=1377"}],"version-history":[{"count":1,"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/pages\/1377\/revisions"}],"predecessor-version":[{"id":1378,"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/pages\/1377\/revisions\/1378"}],"wp:attachment":[{"href":"https:\/\/paulweaferphotography.com\/w\/wp-json\/wp\/v2\/media?parent=1377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}