{"id":11,"date":"2026-05-22T05:01:45","date_gmt":"2026-05-22T05:01:45","guid":{"rendered":"https:\/\/meli.weblab.md\/?page_id=11"},"modified":"2026-05-22T05:01:45","modified_gmt":"2026-05-22T05:01:45","slug":"rezervari","status":"publish","type":"page","link":"https:\/\/meli.weblab.md\/?page_id=11","title":{"rendered":"Rezerv\u0103ri"},"content":{"rendered":"    <div class=\"veronai-reservation-form\">\n        <h2>Rezerv\u0103 o mas\u0103<\/h2>\n\n        <div class=\"veronai-form-grid\">\n            <div>\n                <label>Data<\/label>\n                <input type=\"date\" id=\"vr-date\" min=\"2026-06-10\" value=\"2026-06-10\">\n            <\/div>\n            <div>\n                <label>Persoane<\/label>\n                <select id=\"vr-party\">\n                    <option value='1'>1<\/option><option value='2'>2<\/option><option value='3'>3<\/option><option value='4'>4<\/option><option value='5'>5<\/option><option value='6'>6<\/option><option value='7'>7<\/option><option value='8'>8<\/option><option value='9'>9<\/option><option value='10'>10<\/option><option value='11'>11<\/option><option value='12'>12<\/option><option value='13'>13<\/option><option value='14'>14<\/option><option value='15'>15<\/option><option value='16'>16<\/option><option value='17'>17<\/option><option value='18'>18<\/option><option value='19'>19<\/option><option value='20'>20<\/option>                <\/select>\n            <\/div>\n        <\/div>\n\n        <div id=\"vr-slots\" style=\"margin:16px 0\">\n            <button id=\"vr-check-availability\" class=\"button\" style=\"background:#1E3A5F;color:#fff;border-color:#1E3A5F\">\n                Verific\u0103 disponibilitate            <\/button>\n        <\/div>\n\n        <div id=\"vr-slot-list\" style=\"display:none\">\n            <h3>Ore disponibile<\/h3>\n            <div id=\"vr-slot-btns\" class=\"veronai-slot-grid\"><\/div>\n        <\/div>\n\n        <input type=\"hidden\" id=\"vr-time\" value=\"\">\n\n        <div class=\"veronai-form-grid\" style=\"margin-top:16px\">\n            <div><label>Nume<\/label>\n                <input type=\"text\" id=\"vr-name\" value=\"\"><\/div>\n            <div><label>Email<\/label>\n                <input type=\"email\" id=\"vr-email\" value=\"\"><\/div>\n            <div><label>Telefon<\/label>\n                <input type=\"tel\" id=\"vr-phone\"><\/div>\n        <\/div>\n\n        <label>Cereri speciale<\/label>\n        <textarea id=\"vr-requests\" rows=\"3\" style=\"width:100%\"><\/textarea>\n\n        <label><input type=\"checkbox\" id=\"vr-recurring\"> Rezervare recurent\u0103<\/label>\n        <div id=\"vr-recurring-type\" style=\"display:none;margin-top:8px\">\n            <select><option value=\"weekly\">S\u0103pt\u0103m\u00e2nal<\/option><option value=\"monthly\">Lunar<\/option><\/select>\n        <\/div>\n\n        <button id=\"vr-submit\" class=\"veronai-btn\" style=\"background:#1E3A5F;width:100%;padding:14px;margin-top:16px\" data-nonce=\"2f4f4ba87e\">\n            Confirm\u0103 rezervarea        <\/button>\n        <p id=\"vr-msg\"><\/p>\n    <\/div>\n\n    <script>\n    (function(){\n        var nonce = '2f4f4ba87e';\n        var ajax  = 'https:\/\/meli.weblab.md\/wp-admin\/admin-ajax.php';\n\n        document.getElementById('vr-check-availability').addEventListener('click', function(){\n            var date  = document.getElementById('vr-date').value;\n            var party = document.getElementById('vr-party').value;\n            fetch(ajax,{method:'POST',headers:{'Content-Type':'application\/x-www-form-urlencoded'},\n                body:'action=veronai_get_availability&nonce='+nonce+'&date='+encodeURIComponent(date)+'&party_size='+party\n            }).then(r=>r.json()).then(d=>{\n                var slotList = document.getElementById('vr-slot-list');\n                var btns     = document.getElementById('vr-slot-btns');\n                slotList.style.display = '';\n                var slots = d.data?.slots || d.data || [];\n                btns.innerHTML = Array.isArray(slots) ? slots.map(function(s){\n                    return '<button class=\"veronai-slot-btn button\" data-time=\"'+s+'\">'+s+'<\/button>';\n                }).join('') : '<p><\/p>';\n                document.querySelectorAll('.veronai-slot-btn').forEach(function(btn){\n                    btn.addEventListener('click',function(){\n                        document.querySelectorAll('.veronai-slot-btn').forEach(b=>b.classList.remove('active'));\n                        this.classList.add('active');\n                        document.getElementById('vr-time').value = this.dataset.time;\n                    });\n                });\n            });\n        });\n\n        document.getElementById('vr-recurring').addEventListener('change', function(){\n            document.getElementById('vr-recurring-type').style.display = this.checked ? '' : 'none';\n        });\n\n        document.getElementById('vr-submit').addEventListener('click', function(){\n            var time = document.getElementById('vr-time').value;\n            var msg  = document.getElementById('vr-msg');\n            if (!time) { msg.textContent=''; return; }\n            fetch(ajax,{method:'POST',headers:{'Content-Type':'application\/x-www-form-urlencoded'},\n                body:'action=veronai_create_reservation&nonce='+this.dataset.nonce\n                +'&date='+encodeURIComponent(document.getElementById('vr-date').value)\n                +'&time='+encodeURIComponent(time)\n                +'&party_size='+encodeURIComponent(document.getElementById('vr-party').value)\n                +'&customer_name='+encodeURIComponent(document.getElementById('vr-name').value)\n                +'&customer_email='+encodeURIComponent(document.getElementById('vr-email').value)\n                +'&customer_phone='+encodeURIComponent(document.getElementById('vr-phone').value)\n                +'&special_requests='+encodeURIComponent(document.getElementById('vr-requests').value)\n            }).then(r=>r.json()).then(d=>{\n                msg.style.color = d.success ? 'green' : 'red';\n                msg.textContent = d.success ? '' : (d.data||'Eroare');\n                if (d.success) document.getElementById('vr-submit').disabled=true;\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":{"footnotes":""},"class_list":["post-11","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/meli.weblab.md\/index.php?rest_route=\/wp\/v2\/pages\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meli.weblab.md\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/meli.weblab.md\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/meli.weblab.md\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/meli.weblab.md\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11"}],"version-history":[{"count":1,"href":"https:\/\/meli.weblab.md\/index.php?rest_route=\/wp\/v2\/pages\/11\/revisions"}],"predecessor-version":[{"id":75,"href":"https:\/\/meli.weblab.md\/index.php?rest_route=\/wp\/v2\/pages\/11\/revisions\/75"}],"wp:attachment":[{"href":"https:\/\/meli.weblab.md\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}