{"id":20525,"date":"2024-12-17T11:26:01","date_gmt":"2024-12-17T11:26:01","guid":{"rendered":"https:\/\/lara-app.com\/?page_id=20525"},"modified":"2025-06-10T13:36:51","modified_gmt":"2025-06-10T13:36:51","slug":"registre","status":"publish","type":"page","link":"https:\/\/lara-app.com\/fr\/registre\/","title":{"rendered":"Registre"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column width=&#8221;1\/2&#8243;][vc_column_text css=&#8221;&#8221;]            <form id=\"d4-lara-login-form\">\n                <div class=\"d4-lara-from-field-container\">\n                    <label for=\"d4-lara-login-form-field-email\">E-Mail-Adresse:<\/label>\n                    <input type=\"email\" id=\"d4-lara-login-form-field-email\" name=\"email\" required>\n                <\/div>\n\n                <div class=\"d4-lara-from-field-container\">\n                    <label for=\"d4-lara-login-form-field-password\">Passwort:<\/label>\n                    <input type=\"password\" id=\"d4-lara-login-form-field-password\" name=\"password\" required>\n                <\/div>\n\n                <button class=\"d4-lara-button\" type=\"submit\">Anmelden<\/button>\n            <\/form>\n            <div id=\"d4-lara-login-form-response\"><\/div>\n\n            <script type=\"text\/javascript\">\n                document.addEventListener('DOMContentLoaded', function () {\n                    const form = document.getElementById('d4-lara-login-form');\n                    const responseDiv = document.getElementById('d4-lara-login-form-response');\n\n                    form.addEventListener('submit', function (e) {\n                        e.preventDefault();\n\n                        const email = document.getElementById('d4-lara-login-form-field-email').value;\n                        const password = document.getElementById('d4-lara-login-form-field-password').value;\n\n                        const xhr = new XMLHttpRequest();\n                        xhr.open('POST', 'https:\/\/lara-app.com\/wp-admin\/admin-ajax.php', true);\n                        xhr.setRequestHeader('Content-Type', 'application\/x-www-form-urlencoded');\n\n                        xhr.onreadystatechange = function () {\n                            if (xhr.readyState === XMLHttpRequest.DONE) {\n                                if (xhr.status === 200) {\n                                    const response = JSON.parse(xhr.responseText);\n                                    if (response.success) {\n                                        responseDiv.innerHTML = `<p>${response.data.message}<\/p>`;\n                                        responseDiv.classList.remove('fade');\n                                        responseDiv.classList.remove('hidden');\n                                        responseDiv.classList.remove('d4-lara-form-response-fail');\n                                        responseDiv.classList.add('d4-lara-form-response-success');\n                                        setTimeout(() => {\n                                            responseDiv.classList.add('fade')\n                                        }, 1000);\n                                        setTimeout(() => {\n                                            responseDiv.classList.add('hidden');\n                                        }, 1500);\n                                        setTimeout(() => {\n                                            window.location.href = response.data.redirect;\n                                        }, 2000);\n                                    } else {\n                                        responseDiv.innerHTML = `<p>${response.data.message}<\/p>`;\n                                        responseDiv.classList.remove('fade');\n                                        responseDiv.classList.remove('hidden');\n                                        responseDiv.classList.remove('d4-lara-form-response-success');\n                                        responseDiv.classList.add('d4-lara-form-response-fail');\n                                        setTimeout(() => {\n                                            responseDiv.classList.add('fade')\n                                        }, 5000);\n                                        setTimeout(() => {\n                                            responseDiv.classList.add('hidden');\n                                        }, 5500);\n                                    }\n                                } else {\n                                    responseDiv.innerHTML = '<p>Es ist ein Fehler aufgetreten.<\/p>';\n                                    responseDiv.classList.remove('fade');\n                                    responseDiv.classList.remove('hidden');\n                                    responseDiv.classList.remove('d4-lara-form-response-success');\n                                    responseDiv.classList.add('d4-lara-form-response-fail');\n                                    setTimeout(() => {\n                                        responseDiv.classList.add('fade')\n                                    }, 5000);\n                                    setTimeout(() => {\n                                        responseDiv.classList.add('hidden');\n                                    }, 5500);\n                                }\n                            }\n                        };\n\n                        const params = new URLSearchParams();\n                        params.append('action', 'd4_lara_login_call');\n                        params.append('email', email);\n                        params.append('password', password);\n\n                        xhr.send(params.toString());\n                    });\n                });\n\n            <\/script>\n        [\/vc_column_text][\/vc_column][vc_column width=&#8221;1\/2&#8243;][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column width=&#8221;1\/2&#8243;][vc_column_text css=&#8221;&#8221;][\/vc_column_text][\/vc_column][vc_column width=&#8221;1\/2&#8243;][\/vc_column][\/vc_row]<\/p>\n","protected":false},"author":6,"featured_media":20387,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-20525","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/pages\/20525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/comments?post=20525"}],"version-history":[{"count":0,"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/pages\/20525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/media\/20387"}],"wp:attachment":[{"href":"https:\/\/lara-app.com\/fr\/wp-json\/wp\/v2\/media?parent=20525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}