{"id":36,"date":"2025-01-08T07:52:07","date_gmt":"2025-01-08T07:52:07","guid":{"rendered":"https:\/\/laurens.informatica.gsf.nl\/?page_id=36"},"modified":"2025-03-21T10:25:22","modified_gmt":"2025-03-21T10:25:22","slug":"swipen","status":"publish","type":"page","link":"https:\/\/laurens.informatica.gsf.nl\/?page_id=36","title":{"rendered":"Swipen"},"content":{"rendered":"    <div id=\"profiel-container\">\n        <h2 id=\"profiel-naam\"><\/h2>\n        <p id=\"profiel-info\"><\/p>\n        <button onclick=\"beoordeelProfiel(true)\">Leuk<\/button>\n        <button onclick=\"beoordeelProfiel(false)\">Niet Leuk<\/button>\n    <\/div>\n\n    <script>\n        let profielen = [{\"id\":1,\"naam\":\"pary Kick\"},{\"id\":2,\"naam\":\"Duncan Boterham\"},{\"id\":3,\"naam\":\"Lands61\"},{\"id\":4,\"naam\":\"Thijmen van wijngaarden\"},{\"id\":5,\"naam\":\"Deluukman\"},{\"id\":6,\"naam\":\"Sem Louwerse\"},{\"id\":7,\"naam\":\"Marius aan het roer\"},{\"id\":8,\"naam\":\"Nathan\"},{\"id\":9,\"naam\":\"finn\"},{\"id\":10,\"naam\":\"mennie\"},{\"id\":11,\"naam\":\"196505\"},{\"id\":12,\"naam\":\"Joris\"},{\"id\":13,\"naam\":\"Koen\"},{\"id\":14,\"naam\":\"Kwantum\"},{\"id\":15,\"naam\":\"Pietjan\"},{\"id\":16,\"naam\":\"dogking53\"},{\"id\":19,\"naam\":\"Olivier_Padt\"},{\"id\":23,\"naam\":\"Laurens2\"},{\"id\":24,\"naam\":\"Claudia\"},{\"id\":25,\"naam\":\"dickdestroyer123\"},{\"id\":26,\"naam\":\"eric\"}];\n        let huidigeIndex = 0;\n\n        function toonProfiel() {\n            if (huidigeIndex >= profielen.length) {\n                document.getElementById('profiel-container').innerHTML = \"Geen profielen meer beschikbaar.\";\n                return;\n            }\n            let profiel = profielen[huidigeIndex];\n            document.getElementById('profiel-naam').textContent = profiel.naam;\n            document.getElementById('profiel-info').textContent = profiel.info;\n        }\n\n        function beoordeelProfiel(leuk) {\n    if (huidigeIndex >= profielen.length) return; \/\/ Controleert of er nog profielen zijn\n\n    let profiel = profielen[huidigeIndex]; \/\/ Haalt het huidige profiel op\n    let data = new FormData();\n    data.append('action', 'pb_sla_voorkeur_op'); \/\/ Actie die WordPress herkent\n    data.append('profiel_id', profiel.id); \/\/ Het ID van het profiel\n    data.append('leuk', leuk ? '1' : '0'); \/\/ Zet \"1\" voor leuk en \"0\" voor niet leuk\n\n    fetch(\"https:\/\/laurens.informatica.gsf.nl\/wp-admin\/admin-ajax.php\", {\n        method: \"POST\",\n        body: data\n    })\n    .then(response => response.json()) \/\/ Converteer antwoord naar JSON\n    .then(result => {\n        console.log(result); \/\/ Bekijk de serverrespons in de console\n        huidigeIndex++; \/\/ Ga naar het volgende profiel\n        toonProfiel(); \/\/ Laad het nieuwe profiel in\n    })\n    .catch(error => console.error('Fout bij verzenden:', error)); \/\/ Laat fouten zien\n}\n\n        document.addEventListener(\"DOMContentLoaded\", toonProfiel);\n    <\/script>\n    \n\n\n\n<p><\/p>\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-36","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=\/wp\/v2\/pages\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36"}],"version-history":[{"count":7,"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=\/wp\/v2\/pages\/36\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=\/wp\/v2\/pages\/36\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/laurens.informatica.gsf.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}