{"id":28169,"date":"2025-08-07T19:27:44","date_gmt":"2025-08-07T19:27:44","guid":{"rendered":"https:\/\/eadmais.online\/?page_id=28169"},"modified":"2025-08-07T20:08:35","modified_gmt":"2025-08-07T20:08:35","slug":"phase-2-sends-data","status":"publish","type":"page","link":"https:\/\/eadmais.online\/es\/phase-2-sends-data\/","title":{"rendered":"PHASE 2 SENDS DATA"},"content":{"rendered":"<p><\/p>\n\n\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  \n  \n  <title>Submit your data for the selection<\/title>\n  <link rel=\"preconnect\" href=\"https:\/\/fonts.googleapis.com\"\/>\n  <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;600&#038;display=swap\" rel=\"stylesheet\"\/>\n  <style>\n    body { margin:0; background:#fafafa; color:#222; font-family:\"Inter\", Arial, sans-serif; }\n    .container { max-width:500px; margin:0 auto; padding:32px 12px; }\n    .card { background:#fff; border-radius:16px; box-shadow:0 8px 32px rgba(0,0,0,0.08); padding:2rem 1.5rem; text-align:center; }\n    h1 { font-size:1.55rem; margin:0 0 0.7rem; color:#004e92;}\n    p { font-size:1rem; margin:0 0 1.3rem 0;}\n    form { display:flex; flex-direction:column; gap:1rem; margin-top:0.8rem;}\n    input { padding:0.72rem 1rem; font-size:1rem; border:2px solid #e2e8f0; border-radius:8px; transition:border-color 0.2s; }\n    input:focus { outline:none; border-color:#004e92; }\n    .btn {\n      display:inline-block; background:#004e92; color:#fff; font-weight:600; border:none; border-radius:8px;\n      padding:0.72rem 1.8rem; font-size:1.09rem; text-decoration:none; transition:background 0.18s; cursor:pointer;\n      margin-top:6px;\n    }\n    .btn:disabled,\n    .btn.disabled { opacity:.55; pointer-events:none; }\n    .btn:not(.disabled):hover { background:#00386b; }\n    .success, .error { display:none; }\n    .success { color:#16a34a; font-weight:600; margin-top:1rem; }\n    .error { color:#dc2626; font-weight:500; margin-top:1rem; }\n    footer { color:#666; font-size:.87rem; margin-top:2.2rem; text-align:center;}\n  <\/style>\n  <script>\n    const API_URL = 'https:\/\/dihviral.com\/wp-json\/dihviral\/v1\/lead';\n    const redirectUrl = 'https:\/\/eadmais.online\/thank-you\/';\n\n    function isValidPhone(phone) {\n      const cleaned = phone.replace(\/\\s+\/g, '');\n      return \/^(\\+?\\d{10,15})$\/.test(cleaned);\n    }\n\n    async function handleSubmit(e) {\n      e.preventDefault();\n\n      const name  = document.getElementById('name').value.trim();\n      const email = document.getElementById('email').value.trim();\n      const phone = document.getElementById('phone').value.trim();\n\n      if (!name || !email || !phone) {\n        alert('Please fill out all fields.');\n        return;\n      }\n      if (!isValidPhone(phone)) {\n        alert('Enter a valid number with international prefix (e.g., +971501234567)');\n        return;\n      }\n\n      const [first_name, ...rest] = name.split(' ');\n      const last_name = rest.join(' ');\n\n      const payload = {\n        phone: phone.replace(\/\\s+\/g, ''),\n        email: email,\n        first_name: first_name,\n        last_name: last_name,\n        actions: [\n          { action: 'add_tag', tag_name: 'PHASE_2_SELECTION_PROCESS' },\n          { action: 'set_field_value', field_name: 'PHASE_2_SELECTION_PROCESS', value: 'EAD_MAIS' }\n        ]\n      };\n\n      try {\n        const res = await fetch(API_URL, {\n          method: 'POST',\n          headers: { 'Content-Type': 'application\/json' },\n          body: JSON.stringify(payload)\n        });\n\n        if (!res.ok) throw new Error(`API responded ${res.status}`);\n        window.location.href = redirectUrl;\n      } catch (err) {\n        document.getElementById('error').style.display = 'block';\n      }\n    }\n\n    window.onload = function() {\n      const btn = document.getElementById('send-btn');\n      btn.addEventListener('click', function(e) {\n        handleSubmit(e);\n      });\n    }\n  <\/script>\n<\/head>\n<body>\n  <div class=\"container\">\n    <div class=\"card\">\n      <h1>Submit your information for the second phase<\/h1>\n      <p>\n        Complete the required fields. The data will be securely transmitted to the company to continue the evaluation.\n      <\/p>\n\n      <!-- AD INSERTER BLOCK -->\n      <div class='code-block code-block-2' style='margin: 8px auto; text-align: center; display: block; clear: both;'>\n<div style=\"position: sticky; top: 15px;\">\n<div class=\"code-block-label\">anuncios<\/div>\n<script>\n   window.googletag = window.googletag || {cmd: []};\n   googletag.cmd.push(function() {\n     googletag.defineSlot(\"\/22883653243\/eadmais.online\/eadmais.online_mw_content2_02032023\", [[250, 250], [336, 280], [300, 250]], \"div-gpt-ad-1606164528122-0\").addService(googletag.pubads());\n         googletag.pubads().enableLazyLoad({\n                    fetchMarginPercent: 20,\n                    renderMarginPercent: 10,\n                    mobileScaling: 2.0\n                });\n     googletag.enableServices();\n   });\n<\/script>\n<div id=\"div-gpt-ad-1606164528122-0\">\n   <script>\n      googletag.cmd.push(function() { googletag.display(\"div-gpt-ad-1606164528122-0\"); });\n   <\/script>\n<\/div><\/div>\n<div style=\" height: 150px;\"><\/div>\n<\/div>\n\n\n      <form id=\"form\" action=\"\">\n        <input id=\"name\"  name=\"name\"  type=\"text\"  placeholder=\"Full name\" required \/>\n        <input id=\"email\" name=\"email\" type=\"email\" placeholder=\"Email address\" required \/>\n        <input id=\"phone\" name=\"phone\" type=\"tel\"   placeholder=\"Example: +971501234567\" required \/>\n        <a href=\"#\" id=\"send-btn\" class=\"btn\">Submit \u279c<\/a>\n      <input type=\"hidden\" name=\"trp-form-language\" value=\"es\"\/><\/form>\n      <div id=\"success\" class=\"success\">Thank you! Data sent successfully.<\/div>\n      <div id=\"error\" class=\"error\">An error occurred. Please try again in a few minutes.<\/div>\n    <\/div>\n    <footer>\n      <p><strong>Privacy:<\/strong> Your data will be used exclusively for the selection process and shared only with the partner company.<\/p>\n      <p>\u00a9 2025 \u2013 All rights reserved<\/p>\n    <\/footer>\n  <\/div>\n<\/body>\n<\/html>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Submit your data for the selection Submit your information for the second phase Complete the required fields. The data will be securely transmitted to the company to continue the evaluation. Submit \u279c Thank you! Data sent successfully. An error occurred. Please try again in a few minutes. Privacy: Your data will be used exclusively for&#8230;<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-28169","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/eadmais.online\/es\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Submit your data for the selection Submit your information for the second phase Complete the required fields. The data will be securely transmitted to the company to continue the evaluation. Submit \u279c Thank you! Data sent successfully. An error occurred. Please try again in a few minutes. Privacy: Your data will be used exclusively for...","_links":{"self":[{"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/pages\/28169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/comments?post=28169"}],"version-history":[{"count":3,"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/pages\/28169\/revisions"}],"predecessor-version":[{"id":28179,"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/pages\/28169\/revisions\/28179"}],"wp:attachment":[{"href":"https:\/\/eadmais.online\/es\/wp-json\/wp\/v2\/media?parent=28169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}