{"id":47,"date":"2026-04-12T16:12:04","date_gmt":"2026-04-12T16:12:04","guid":{"rendered":"https:\/\/templatecreator.online\/?page_id=47"},"modified":"2026-04-12T16:36:48","modified_gmt":"2026-04-12T16:36:48","slug":"test-car-list","status":"publish","type":"page","link":"https:\/\/templatecreator.online\/index.php\/test-car-list\/","title":{"rendered":"Test Car List"},"content":{"rendered":"<div class=\"et_pb_section_0 et_pb_section et_section_regular et_flex_section\">\n<div class=\"et_pb_row_0 et_pb_row et_flex_row\">\n<div class=\"et_pb_column_0 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24\">\n<div class=\"et_pb_code_0 et_pb_code et_pb_module\"><div class=\"et_pb_code_inner\"><div id=\"cars\">Loading&#8230;<\/div>\n\n<script>\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n\nfetch('\/wp-json\/turev\/v1\/cars')\n.then(response => response.json())\n.then(data => {\n\n    let html = '';\n\n    data.forEach(car => {\n        html += `\n            <div style=\"border:1px solid #ccc; padding:15px; margin:10px;\">\n                <h3>${car.car_name}<\/h3>\n                <p>Prijs: ${car.total_rental} TL<\/p>\n                <p>Brand: ${car.brand}<\/p>\n                <p>Transmission: ${car.transmission}<\/p>\n\n                <button onclick=\"selectCar('${car.group_id}', '${car.cars_park_id}')\">\n                    Selecteer deze auto\n                <\/button>\n            <\/div>\n        `;\n    });\n\n    document.getElementById('cars').innerHTML = html;\n\n})\n.catch(error => {\n    document.getElementById('cars').innerHTML = \"Error loading cars\";\n    console.log(error);\n});\n\n});\n\nfunction selectCar(groupId, carParkId) {\n\n    \/\/ Stap 1: opslaan in browser\n    localStorage.setItem('selected_group_id', groupId);\n    localStorage.setItem('selected_carpark_id', carParkId);\n\n    \/\/ Stap 2: naar formulier pagina sturen\n    window.location.href = \"\/index.php\/free-car-rental-reservation-izmir-airport\/\"; \/\/ <-- pas aan naar jouw pagina\n}\n<\/script><\/div><\/div>\n<\/div>\n<\/div>\n<\/div>","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-47","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/pages\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":6,"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/pages\/47\/revisions"}],"predecessor-version":[{"id":55,"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/pages\/47\/revisions\/55"}],"wp:attachment":[{"href":"https:\/\/templatecreator.online\/index.php\/wp-json\/wp\/v2\/media?parent=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}