
{"id":4029,"date":"2026-04-26T20:26:47","date_gmt":"2026-04-26T18:26:47","guid":{"rendered":"https:\/\/mairiecome.bj\/?page_id=4029"},"modified":"2026-05-07T12:18:55","modified_gmt":"2026-05-07T10:18:55","slug":"budget-et-documents","status":"publish","type":"page","link":"https:\/\/mairiecome.bj\/index.php\/budget-et-documents\/","title":{"rendered":"budget et documents"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"4029\" class=\"elementor elementor-4029\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8646ef7 e-flex e-con-boxed e-con e-parent\" data-id=\"8646ef7\" 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-581dcaf elementor-widget elementor-widget-wp-widget-budget_document_widget\" data-id=\"581dcaf\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"wp-widget-budget_document_widget.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\n        <style>\n            .bd-widget-container { --primary-color: #0056b3; --bg-color: #f4f7f9; --text-main: #2c3e50; --border-color: #dcdfe3; font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text-main); }\n            .bd-search-container { margin-bottom: 30px; text-align: center; }\n            .bd-search-input { width: 100%; max-width: 500px; padding: 12px 20px; border-radius: 25px; border: 2px solid var(--border-color); font-size: 16px; outline: none; transition: border-color 0.3s; }\n            .bd-search-input:focus { border-color: var(--primary-color); }\n            .bd-document-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 15px; min-height: 200px; }\n            .bd-doc-card { background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; display: flex; align-items: flex-start; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }\n            .bd-doc-icon { margin-right: 15px; flex-shrink: 0; font-size: 24px; }\n            .bd-doc-content { flex-grow: 1; word-break: break-all; }\n            .bd-doc-title { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; line-height: 1.4; }\n            .bd-doc-meta { font-size: 12px; color: #7f8c8d; }\n            .bd-doc-actions { display: flex; flex-direction: column; gap: 6px; margin-left: 10px; }\n            .bd-btn { padding: 5px 12px; border-radius: 4px; font-size: 12px; text-decoration: none; text-align: center; font-weight: 500; border: 1px solid var(--border-color); cursor: pointer; display: inline-block; }\n            .bd-btn-view { background: #fff; color: var(--text-main); }\n            .bd-btn-download { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }\n            .bd-pagination { margin-top: 40px; display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }\n            .bd-page-btn { padding: 8px 14px; border: 1px solid var(--border-color); background: white; cursor: pointer; border-radius: 4px; transition: 0.2s; }\n            .bd-page-btn.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }\n            .bd-page-btn:hover:not(.active) { background-color: #e9ecef; }\n            .bd-no-result { grid-column: 1 \/ -1; text-align: center; padding: 50px; color: #7f8c8d; }\n\n            \/* Styles pour la modale *\/\n            .bd-modal {\n                display: none;\n                position: fixed;\n                z-index: 1000;\n                left: 0;\n                top: 0;\n                width: 100%;\n                height: 100%;\n                background-color: rgba(0,0,0,0.8);\n                overflow: auto;\n            }\n            .bd-modal-content {\n                background-color: #fefefe;\n                margin: 5% auto;\n                padding: 20px;\n                border-radius: 8px;\n                width: 90%;\n                max-width: 1200px;\n                height: 85%;\n                position: relative;\n                display: flex;\n                flex-direction: column;\n            }\n            .bd-modal-header {\n                display: flex;\n                justify-content: space-between;\n                align-items: center;\n                padding-bottom: 10px;\n                border-bottom: 1px solid #ddd;\n                margin-bottom: 15px;\n            }\n            .bd-modal-title {\n                font-size: 1.2em;\n                font-weight: bold;\n            }\n            .bd-modal-close {\n                color: #aaa;\n                font-size: 28px;\n                font-weight: bold;\n                cursor: pointer;\n            }\n            .bd-modal-close:hover {\n                color: black;\n            }\n            .bd-modal-iframe {\n                width: 100%;\n                height: 100%;\n                border: none;\n                flex-grow: 1;\n            }\n        <\/style>\n\n        <div class=\"bd-widget-container\">\n            <div class=\"bd-search-container\">\n                <h2 style=\"margin-bottom:15px;\">Documents Administratifs<\/h2>\n                <input type=\"text\" id=\"bdSearchInput\" class=\"bd-search-input\" placeholder=\"Rechercher par nom de document...\">\n            <\/div>\n\n            <div id=\"bdDocumentGrid\" class=\"bd-document-grid\"><\/div>\n            <div id=\"bdPagination\" class=\"bd-pagination\"><\/div>\n        <\/div>\n\n        <!-- Modale pour l'affichage du PDF -->\n        <div id=\"bdModal\" class=\"bd-modal\">\n            <div class=\"bd-modal-content\">\n                <div class=\"bd-modal-header\">\n                    <span class=\"bd-modal-title\" id=\"bdModalTitle\">Document<\/span>\n                    <span class=\"bd-modal-close\" id=\"bdModalClose\">&times;<\/span>\n                <\/div>\n                <iframe id=\"bdModalIframe\" class=\"bd-modal-iframe\" src=\"\"><\/iframe>\n            <\/div>\n        <\/div>\n\n        <script>\n        (function() {\n            const allDocs = [];\n            let filteredDocs = [...allDocs];\n            const itemsPerPage = 12;\n            let currentPage = 1;\n\n            const grid = document.getElementById('bdDocumentGrid');\n            const pagin = document.getElementById('bdPagination');\n            const search = document.getElementById('bdSearchInput');\n\n            \/\/ \u00c9l\u00e9ments de la modale\n            const modal = document.getElementById('bdModal');\n            const modalTitle = document.getElementById('bdModalTitle');\n            const modalIframe = document.getElementById('bdModalIframe');\n            const modalClose = document.getElementById('bdModalClose');\n\n            function openModal(url, title) {\n                modalIframe.src = url;\n                modalTitle.textContent = title;\n                modal.style.display = 'block';\n                document.body.style.overflow = 'hidden'; \/\/ Emp\u00eache le scroll derri\u00e8re\n            }\n\n            function closeModal() {\n                modal.style.display = 'none';\n                modalIframe.src = ''; \/\/ Vide l'iframe\n                document.body.style.overflow = '';\n            }\n\n            modalClose.onclick = closeModal;\n            window.onclick = function(event) {\n                if (event.target === modal) {\n                    closeModal();\n                }\n            };\n\n            function render() {\n                grid.innerHTML = \"\";\n                const start = (currentPage - 1) * itemsPerPage;\n                const paginated = filteredDocs.slice(start, start + itemsPerPage);\n\n                if (paginated.length === 0) {\n                    grid.innerHTML = `<div class=\"bd-no-result\">Aucun document trouv\u00e9.<\/div>`;\n                    renderPagin();\n                    return;\n                }\n\n                paginated.forEach(doc => {\n                    const card = document.createElement('div');\n                    card.className = 'bd-doc-card';\n                    card.innerHTML = `\n                        <div class=\"bd-doc-icon\">\ud83d\udcc4<\/div>\n                        <div class=\"bd-doc-content\">\n                            <span class=\"bd-doc-title\">${escapeHtml(doc.name)}<\/span>\n                            <div class=\"bd-doc-meta\">Date: ${doc.date}<\/div>\n                        <\/div>\n                        <div class=\"bd-doc-actions\">\n                            <button class=\"bd-btn bd-btn-view\" data-url=\"${doc.url}\" data-name=\"${escapeHtml(doc.name)}\">Voir<\/button>\n                            <a href=\"${doc.url}\" class=\"bd-btn bd-btn-download\" download>T\u00e9l\u00e9charger<\/a>\n                        <\/div>\n                    `;\n                    const viewBtn = card.querySelector('.bd-btn-view');\n                    viewBtn.addEventListener('click', (e) => {\n                        e.preventDefault();\n                        openModal(viewBtn.getAttribute('data-url'), viewBtn.getAttribute('data-name'));\n                    });\n                    grid.appendChild(card);\n                });\n                renderPagin();\n            }\n\n            function renderPagin() {\n                pagin.innerHTML = \"\";\n                const count = Math.ceil(filteredDocs.length \/ itemsPerPage);\n                if (count <= 1) return;\n                for (let i = 1; i <= count; i++) {\n                    const btn = document.createElement('button');\n                    btn.innerText = i;\n                    btn.className = `bd-page-btn ${i === currentPage ? 'active' : ''}`;\n                    btn.onclick = () => { currentPage = i; render(); window.scrollTo({top: grid.offsetTop - 100, behavior: 'smooth'}); };\n                    pagin.appendChild(btn);\n                }\n            }\n\n            function escapeHtml(str) {\n                return str.replace(\/[&<>]\/g, function(m) {\n                    if (m === '&') return '&amp;';\n                    if (m === '<') return '&lt;';\n                    if (m === '>') return '&gt;';\n                    return m;\n                });\n            }\n\n            search.oninput = (e) => {\n                const term = e.target.value.toLowerCase();\n                filteredDocs = allDocs.filter(d => d.name.toLowerCase().includes(term));\n                currentPage = 1;\n                render();\n            };\n\n            render();\n        })();\n        <\/script>\n        \t\t\t\t<\/div>\n\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":"","protected":false},"author":1,"featured_media":4035,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4029","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/pages\/4029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/comments?post=4029"}],"version-history":[{"count":13,"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/pages\/4029\/revisions"}],"predecessor-version":[{"id":4086,"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/pages\/4029\/revisions\/4086"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/media\/4035"}],"wp:attachment":[{"href":"https:\/\/mairiecome.bj\/index.php\/wp-json\/wp\/v2\/media?parent=4029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}