{"id":125,"date":"2026-08-04T22:33:16","date_gmt":"2026-08-04T22:33:16","guid":{"rendered":"https:\/\/xn--marcha-fva.com\/?page_id=125"},"modified":"2026-08-04T22:33:21","modified_gmt":"2026-08-04T22:33:21","slug":"sinscrire","status":"publish","type":"page","link":"https:\/\/xn--marcha-fva.com\/ht\/sinscrire\/","title":{"rendered":"s&rsquo;inscrire"},"content":{"rendered":"\n<div id=\"haid-manager-box\" style=\"border: 2px solid #00a859; padding: 20px; border-radius: 8px; background: #ffffff;\">\n    <h3 style=\"color:#00a859; margin-top:0;\">\ud83d\udccd Adressage Num\u00e9rique National (HAID \/ CPHN)<\/h3>\n    <p><small>S\u00e9lectionnez ou g\u00e9olocalisez votre b\u00e2timent pour enregistrer son adresse unique permanente.<\/small><\/p>\n\n    <!-- Bouton D\u00e9tection GPS -->\n    <button type=\"button\" onclick=\"capturerGPSLocal()\" style=\"background:#00a859; color:white; border:none; padding:12px 20px; border-radius:5px; cursor:pointer; font-weight:bold;\">\n        \ud83c\udfaf D\u00e9tecter Ma Position Exacte (GPS)\n    <\/button>\n    \n    <div id=\"gps-status\" style=\"margin-top:10px; font-weight:bold; font-size:14px;\"><\/div>\n\n    <!-- Formulaire d'Adresse Harmonis\u00e9 -->\n    <div style=\"display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-top:15px;\">\n        <div>\n            <label><b>D\u00e9partement :<\/b><\/label><br>\n            <select id=\"haid_dept\" style=\"width:100%; padding:8px;\" onchange=\"actualiserAdresse()\">\n                <option value=\"SD\">Sud (SD)<\/option>\n                <option value=\"OU\">Ouest (OU)<\/option>\n                <option value=\"NO\">Nord (NO)<\/option>\n            <\/select>\n        <\/div>\n        <div>\n            <label><b>Commune :<\/b><\/label><br>\n            <select id=\"haid_commune\" style=\"width:100%; padding:8px;\" onchange=\"actualiserAdresse()\">\n                <option value=\"LCY\">Les Cayes (LCY)<\/option>\n                <option value=\"PAP\">Port-au-Prince (PAP)<\/option>\n            <\/select>\n        <\/div>\n        <div>\n            <label><b>Quartier \/ Zone (CPHN) :<\/b><\/label><br>\n            <input type=\"text\" id=\"haid_zone\" value=\"001\" placeholder=\"Ex: 001 pour Centre-Ville\" style=\"width:100%; padding:8px;\" oninput=\"actualiserAdresse()\">\n        <\/div>\n        <div>\n            <label><b>Rue :<\/b><\/label><br>\n            <input type=\"text\" id=\"haid_street\" placeholder=\"Ex: Rue Prosp\u00e8re Faure\" style=\"width:100%; padding:8px;\" oninput=\"actualiserAdresse()\">\n        <\/div>\n        <div>\n            <label><b>Num\u00e9ro de B\u00e2timent :<\/b><\/label><br>\n            <input type=\"text\" id=\"haid_number\" placeholder=\"Ex: 55\" style=\"width:100%; padding:8px;\" oninput=\"actualiserAdresse()\">\n        <\/div>\n        <div>\n            <label><b>Suffixe (Entr\u00e9e\/Appartement) :<\/b><\/label><br>\n            <select id=\"haid_suffix\" style=\"width:100%; padding:8px;\" onchange=\"actualiserAdresse()\">\n                <option value=\"A\">Entr\u00e9e A<\/option>\n                <option value=\"B\">Entr\u00e9e B<\/option>\n                <option value=\"C\">Entr\u00e9e C<\/option>\n            <\/select>\n        <\/div>\n    <\/div>\n\n    <!-- R\u00e9sultat dynamique HAID -->\n    <div style=\"margin-top:15px; padding:12px; background:#f0f9f4; border-left:5px solid #00a859;\">\n        <div><strong>Adresse affich\u00e9e :<\/strong> <span id=\"preview-adresse\">Veuillez saisir votre rue et num\u00e9ro<\/span><\/div>\n        <div><strong>CPHN :<\/strong> <span id=\"preview-cphn\">&#8212;<\/span><\/div>\n        <div><strong>HAID :<\/strong> <span id=\"preview-haid\" style=\"font-weight:bold; color:#00a859;\">&#8212;<\/span><\/div>\n    <\/div>\n<\/div>\n\n<script>\nlet userLat = 0;\nlet userLng = 0;\n\nfunction capturerGPSLocal() {\n    const status = document.getElementById('gps-status');\n    status.innerHTML = \"\u23f3 Analyse du signal GPS en cours...\";\n\n    if (navigator.geolocation) {\n        navigator.geolocation.getCurrentPosition((pos) => {\n            userLat = pos.coords.latitude;\n            userLng = pos.coords.longitude;\n            status.innerHTML = `\u2705 Coordonn\u00e9es valid\u00e9es : Lat ${userLat.toFixed(5)}, Lng ${userLng.toFixed(5)}`;\n            verifierDoublonGPS(userLat, userLng);\n        }, () => {\n            status.style.color = \"red\";\n            status.innerHTML = \"\u274c Activez la g\u00e9olocalisation sur votre appareil.\";\n        });\n    }\n}\n\nfunction actualiserAdresse() {\n    const dept = document.getElementById('haid_dept').value;\n    const commune = document.getElementById('haid_commune').value;\n    const zone = document.getElementById('haid_zone').value || '001';\n    const street = document.getElementById('haid_street').value || '[Nom de Rue]';\n    const number = document.getElementById('haid_number').value || '0';\n    const suffix = document.getElementById('haid_suffix').value;\n\n    \/\/ D\u00e9termination des codes de rue simples\n    const streetCode = street.substring(0,2).toUpperCase();\n\n    const cphnCode = `${dept}-${commune}-${zone}`;\n    const haidCode = `HT-${dept}-${commune}${zone}-${streetCode}-${number.padStart(4, '0')}-${suffix}`;\n\n    document.getElementById('preview-adresse').innerText = `${number}-${suffix} ${street}, Zone ${zone}, ${commune}, ${dept}`;\n    document.getElementById('preview-cphn').innerText = cphnCode;\n    document.getElementById('preview-haid').innerText = haidCode;\n}\n\nasync function verifierDoublonGPS(lat, lng) {\n    fetch(`${SUPABASE_URL}\/rest\/v1\/rpc\/find_nearby_haid`, {\n        method: 'POST',\n        headers: { 'apikey': SUPABASE_KEY, 'Content-Type': 'application\/json' },\n        body: JSON.stringify({ lat: lat, lng: lng })\n    })\n    .then(res => res.json())\n    .then(data => {\n        if (data && data.length > 0) {\n            alert(`\u26a0\ufe0f Attention : Un b\u00e2timent a \u00e9t\u00e9 d\u00e9tect\u00e9 \u00e0 moins de 5m (${data[0].full_address}). Veuillez choisir le Suffixe B, C ou D pour ajouter une nouvelle entr\u00e9e.`);\n        }\n    });\n}\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udccd Adressage Num\u00e9rique National (HAID \/ CPHN) S\u00e9lectionnez ou g\u00e9olocalisez votre b\u00e2timent pour enregistrer son adresse unique permanente. \ud83c\udfaf D\u00e9tecter [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-125","page","type-page","status-publish","hentry"],"_hostinger_reach_plugin_has_subscription_block":false,"_hostinger_reach_plugin_is_elementor":false,"_links":{"self":[{"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/pages\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":1,"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/pages\/125\/revisions"}],"predecessor-version":[{"id":126,"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/pages\/125\/revisions\/126"}],"wp:attachment":[{"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/media?parent=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}