{"id":5,"date":"2025-01-09T16:22:55","date_gmt":"2025-01-09T16:22:55","guid":{"rendered":"https:\/\/cirilo.me\/?page_id=5"},"modified":"2025-01-09T16:22:55","modified_gmt":"2025-01-09T16:22:55","slug":"family-v-001","status":"publish","type":"page","link":"https:\/\/cirilo.me\/index.php\/family-v-001\/","title":{"rendered":"Family V.001"},"content":{"rendered":"\n<div id=\"family-points-app\">\n    <h1>Family Points System<\/h1>\n    <form id=\"awardPointsForm\">\n        <label>Recipient Name:<\/label>\n        <input type=\"text\" id=\"recipient\" placeholder=\"Recipient Name\" required \/>\n        <label>Points:<\/label>\n        <input type=\"number\" id=\"points\" placeholder=\"Points\" required \/>\n        <label>Awarded By:<\/label>\n        <input type=\"text\" id=\"awardedBy\" placeholder=\"Awarded By\" required \/>\n        <button type=\"submit\">Award Points<\/button>\n    <\/form>\n    <div id=\"responseMessage\"><\/div>\n<\/div>\n\n<script>\n    document.getElementById('awardPointsForm').addEventListener('submit', function(event) {\n        event.preventDefault();\n\n        const recipient = document.getElementById('recipient').value;\n        const points = parseInt(document.getElementById('points').value);\n        const awardedBy = document.getElementById('awardedBy').value;\n\n        fetch('http:\/\/cirilo.me\/award_points', {\n            method: 'POST',\n            headers: { 'Content-Type': 'application\/json' },\n            body: JSON.stringify({ recipient, points, awarded_by: awardedBy })\n        })\n        .then(response => response.json())\n        .then(data => {\n            const responseMessage = document.getElementById('responseMessage');\n            responseMessage.innerHTML = `<p>${data.message}<\/p>`;\n        })\n        .catch(error => {\n            const responseMessage = document.getElementById('responseMessage');\n            responseMessage.innerHTML = `<p style=\"color:red;\">Error: Unable to award points.<\/p>`;\n            console.error('Error:', error);\n        });\n    });\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>Family Points System Recipient Name: Points: Awarded By: Award Points<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/pages\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":1,"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/pages\/5\/revisions"}],"predecessor-version":[{"id":7,"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/pages\/5\/revisions\/7"}],"wp:attachment":[{"href":"https:\/\/cirilo.me\/index.php\/wp-json\/wp\/v2\/media?parent=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}