{"id":83,"date":"2026-08-04T04:28:44","date_gmt":"2026-08-04T04:28:44","guid":{"rendered":"https:\/\/xn--marcha-fva.com\/?page_id=83"},"modified":"2026-08-04T22:37:42","modified_gmt":"2026-08-04T22:37:42","slug":"publier","status":"publish","type":"page","link":"https:\/\/xn--marcha-fva.com\/ht\/publier\/","title":{"rendered":"Publier une annonce"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"83\" class=\"elementor elementor-83\">\n\t\t\t\t<div class=\"elementor-element elementor-element-13803711 e-flex e-con-boxed e-con e-parent\" data-id=\"13803711\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-25d59904 elementor-widget elementor-widget-text-editor\" data-id=\"25d59904\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<div id=\"haid-manager-box\" style=\"border: 2px solid #00a859; padding: 20px; border-radius: 8px; background: #ffffff;\"><h3 style=\"color: #00a859; margin-top: 0;\">\ud83d\udccd Adressage Num\u00e9rique National (HAID \/ CPHN)<\/h3><p><small>S\u00e9lectionnez ou g\u00e9olocalisez votre b\u00e2timent pour enregistrer son adresse unique permanente.<\/small><\/p><p><!-- Bouton D\u00e9tection GPS --><br \/><button style=\"background: #00a859; color: white; border: none; padding: 12px 20px; border-radius: 5px; cursor: pointer; font-weight: bold;\" type=\"button\"><br \/>\ud83c\udfaf D\u00e9tecter Ma Position Exacte (GPS)<br \/><\/button><\/p><div id=\"gps-status\" style=\"margin-top: 10px; font-weight: bold; font-size: 14px;\">\u00a0<\/div><p><!-- Formulaire d'Adresse Harmonis\u00e9 --><\/p><div style=\"display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px;\"><div><label><b>D\u00e9partement :<\/b><\/label><br \/><select id=\"haid_dept\" style=\"width: 100%; padding: 8px;\" onchange=\"actualiserAdresse()\"><option value=\"SD\">Sud (SD)<\/option><option value=\"OU\">Ouest (OU)<\/option><option value=\"NO\">Nord (NO)<\/option><\/select><\/div><div><label><b>Commune :<\/b><\/label><br \/><select id=\"haid_commune\" style=\"width: 100%; padding: 8px;\" onchange=\"actualiserAdresse()\"><option value=\"LCY\">Les Cayes (LCY)<\/option><option value=\"PAP\">Port-au-Prince (PAP)<\/option><\/select><\/div><div><label><b>Quartier \/ Zone (CPHN) :<\/b><\/label><br \/><input id=\"haid_zone\" style=\"width: 100%; padding: 8px;\" type=\"text\" value=\"001\" placeholder=\"Ex: 001 pour Centre-Ville\" \/><\/div><div><label><b>Rue :<\/b><\/label><br \/><input id=\"haid_street\" style=\"width: 100%; padding: 8px;\" type=\"text\" placeholder=\"Ex: Rue Prosp\u00e8re Faure\" \/><\/div><div><label><b>Num\u00e9ro de B\u00e2timent :<\/b><\/label><br \/><input id=\"haid_number\" style=\"width: 100%; padding: 8px;\" type=\"text\" placeholder=\"Ex: 55\" \/><\/div><div><label><b>Suffixe (Entr\u00e9e\/Appartement) :<\/b><\/label><br \/><select id=\"haid_suffix\" style=\"width: 100%; padding: 8px;\" onchange=\"actualiserAdresse()\"><option value=\"A\">Entr\u00e9e A<\/option><option value=\"B\">Entr\u00e9e B<\/option><option value=\"C\">Entr\u00e9e C<\/option><\/select><\/div><\/div><p><!-- R\u00e9sultat dynamique HAID --><\/p><div style=\"margin-top: 15px; padding: 12px; background: #f0f9f4; border-left: 5px solid #00a859;\"><div><strong>Adresse affich\u00e9e :<\/strong> <span id=\"preview-adresse\">Veuillez saisir votre rue et num\u00e9ro<\/span><\/div><div><strong>CPHN :<\/strong> <span id=\"preview-cphn\">&#8212;<\/span><\/div><div><strong>HAID :<\/strong> <span id=\"preview-haid\" style=\"font-weight: bold; color: #00a859;\">&#8212;<\/span><\/div><\/div><\/div><p><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><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","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":"left-sidebar","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-83","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\/83","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=83"}],"version-history":[{"count":11,"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/pages\/83\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/pages\/83\/revisions\/133"}],"wp:attachment":[{"href":"https:\/\/xn--marcha-fva.com\/ht\/wp-json\/wp\/v2\/media?parent=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}