{"id":2358,"date":"2026-02-05T22:10:18","date_gmt":"2026-02-05T15:40:18","guid":{"rendered":"https:\/\/test.sdssmyanmar.org\/blood-donors\/"},"modified":"2026-04-25T19:31:02","modified_gmt":"2026-04-25T13:01:02","slug":"blood-donors","status":"publish","type":"page","link":"https:\/\/test.sdssmyanmar.org\/en\/blood-donors\/","title":{"rendered":"Blood Donors"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"2358\" class=\"elementor elementor-2358\">\n\t\t\t\t<div class=\"elementor-element elementor-element-96ef80e e-flex e-con-boxed e-con e-parent\" data-id=\"96ef80e\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-4c888f4 e-con-full e-flex e-con e-child\" data-id=\"4c888f4\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-75a43cf elementor-widget elementor-widget-text-editor\" data-id=\"75a43cf\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Blood Donor Finder &#8211; Hindu Blood Donors<\/title>\n    <style>\n        body {\n            font-family: 'Segoe UI', Arial, sans-serif;\n            max-width: 1200px;\n            margin: 0 auto;\n            padding: 20px;\n            background: #f5f5f5;\n        }\n        \n        @media (max-width: 768px) {\n            body { padding: 12px; }\n            .filters { flex-direction: column !important; }\n            .filters select, .filters button { width: 100% !important; margin: 5px 0 !important; }\n            th, td { padding: 8px 6px; font-size: 12px; }\n            .table-wrapper { overflow-x: auto; }\n            table { min-width: 550px; }\n        }\n        \n        h1 { color: #c00; margin-bottom: 5px; }\n        .subtitle { color: #666; margin-bottom: 20px; }\n        \n        .filters {\n            background: white;\n            padding: 15px;\n            border-radius: 8px;\n            margin-bottom: 20px;\n            display: flex;\n            gap: 15px;\n            flex-wrap: wrap;\n            align-items: center;\n            box-shadow: 0 2px 5px rgba(0,0,0,0.1);\n        }\n        \n        select, button {\n            padding: 10px 16px;\n            font-size: 16px;\n            border-radius: 6px;\n            border: 1px solid #ddd;\n        }\n        \n        .refresh-btn {\n            background: #007bff;\n            color: white;\n            border: none;\n            cursor: pointer;\n        }\n        \n        .refresh-btn:hover { background: #0056b3; }\n        \n        .table-wrapper { overflow-x: auto; border-radius: 8px; }\n        table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }\n        th, td { border: 1px solid #ddd; padding: 12px 10px; text-align: left; }\n        th { background: #c00; color: white; }\n        .available { color: #2e7d32; font-weight: bold; }\n        .unavailable { color: #999; }\n        .phone-link { color: #0066cc; text-decoration: none; }\n        .phone-link:hover { text-decoration: underline; }\n        .stats { margin: 15px 0; padding: 10px; background: #e8f5e9; border-radius: 6px; text-align: center; font-weight: bold; }\n        .blood-badge { background: #ffebee; color: #c00; padding: 4px 10px; border-radius: 20px; font-weight: bold; display: inline-block; font-size: 13px; }\n        .loading { text-align: center; padding: 40px; color: #666; }\n        .error { color: #c00; text-align: center; padding: 20px; background: #ffebee; border-radius: 8px; }\n        .last-updated { font-size: 12px; color: #666; margin-top: 10px; text-align: center; }\n    <\/style>\n<\/head>\n<body>\n\n<h1>\ud83e\ude78 Hindu Blood Donor Finder<\/h1>\n<div class=\"subtitle\">Live data from Google Sheets &#8211; Updated automatically<\/div>\n\n<div class=\"filters\">\n    <label><strong>\ud83e\ude78 Blood Type:<\/strong><\/label>\n    <select id=\"bloodFilter\">\n        <option value=\"all\">All Types<\/option>\n        <option value=\"A+\">A+<\/option>\n        <option value=\"A\">A<\/option>\n        <option value=\"B+\">B+<\/option>\n        <option value=\"B\">B<\/option>\n        <option value=\"O+\">O+<\/option>\n        <option value=\"O\">O<\/option>\n        <option value=\"O-\">O-<\/option>\n        <option value=\"AB+\">AB+<\/option>\n        <option value=\"AB\">AB<\/option>\n    <\/select>\n\n    <label><strong>\u2705 Availability:<\/strong><\/label>\n    <select id=\"availFilter\">\n        <option value=\"all\">All Donors<\/option>\n        <option value=\"yes\">Available Now Only<\/option>\n    <\/select>\n    \n    <label><strong>\ud83d\udccd Township:<\/strong><\/label>\n    <select id=\"townshipFilter\">\n        <option value=\"all\">All Townships<\/option>\n    <\/select>\n    \n    <button id=\"refreshBtn\" class=\"refresh-btn\">\ud83d\udd04 Refresh Data<\/button>\n<\/div>\n\n<div id=\"stats\" class=\"stats\">Loading data from Google Sheets&#8230;<\/div>\n<div id=\"lastUpdated\" class=\"last-updated\"><\/div>\n\n<div class=\"table-wrapper\">\n    <table id=\"donorTable\">\n        <thead>\n            <tr>\n                <th>Name<\/th>\n                <th>Hindu Name<\/th>\n                <th>Blood Type<\/th>\n                <th>Township<\/th>\n                <th>Phone<\/th>\n                <th>Email<\/th>\n                <th>Status<\/th>\n            <\/tr>\n        <\/thead>\n        <tbody id=\"tableBody\">\n            <tr><td colspan=\"7\" class=\"loading\">\ud83d\udd04 Loading from Google Sheets&#8230;<br><br>\ud83d\udccc Make sure your Google Sheet is published to web<\/td<\/tr>\n        <\/tbody>\n    \u00a0\n<\/div>\n\n<script>\n\/\/ =============================================\n\/\/ YOUR GOOGLE SHEET ID (from published URL)\n\/\/ =============================================\nconst GOOGLE_SHEET_ID = \"2PACX-1vT07-EKgIO3t3nRiGwK6T4PeFXetW8WIYqR0fiRmwQzq6Ul7x04teRRSDKwgm1NP03fDSxhNgX1A7zl\";\n\n\/\/ =============================================\n\/\/ DON'T EDIT BELOW THIS LINE\n\/\/ =============================================\n\nlet donors = [];\nlet townshipsSet = new Set();\n\nasync function loadFromGoogleSheets() {\n    try {\n        document.getElementById('stats').innerHTML = '\ud83d\udd04 Loading from Google Sheets...';\n        document.getElementById('tableBody').innerHTML = '<tr><td colspan=\"7\" class=\"loading\">\ud83d\udce5 Fetching live data...<br><br>\u23f3 Please wait<\/td<\/tr>';\n        \n        \/\/ Use the published CSV export URL\n        const url = `https:\/\/docs.google.com\/spreadsheets\/d\/e\/${GOOGLE_SHEET_ID}\/pub?output=csv`;\n        const response = await fetch(url);\n        \n        if (!response.ok) {\n            throw new Error(`HTTP ${response.status}`);\n        }\n        \n        const csvText = await response.text();\n        parseCSVData(csvText);\n        \n        \/\/ Show last updated time\n        const now = new Date();\n        document.getElementById('lastUpdated').innerHTML = `\ud83d\udcc5 Last updated: ${now.toLocaleString()}`;\n        \n    } catch (error) {\n        console.error(\"Error:\", error);\n        document.getElementById('tableBody').innerHTML = `\n            <tr><td colspan=\"7\" class=\"error\">\n                \u274c Error loading from Google Sheets<br><br>\n                <strong>Please complete these steps:<\/strong><br><br>\n                1\ufe0f\u20e3 Open your Google Sheet<br>\n                2\ufe0f\u20e3 Click <strong>File \u2192 Share \u2192 Publish to web<\/strong><br>\n                3\ufe0f\u20e3 Click <strong>\"Publish\"<\/strong><br>\n                4\ufe0f\u20e3 Click <strong>OK<\/strong><br><br>\n                <strong>Error details:<\/strong> ${error.message}\n            <\/td><\/tr>\n        `;\n        document.getElementById('stats').innerHTML = '\u274c Failed to load data';\n    }\n}\n\nfunction parseCSVData(csvText) {\n    const lines = csvText.split('\\n').filter(line => line.trim().length > 0);\n    \n    if (lines.length < 2) {\n        document.getElementById('tableBody').innerHTML = '<tr><td colspan=\"7\" class=\"error\">No data found in Google Sheet<\/td<\/tr>';\n        return;\n    }\n    \n    \/\/ Get headers\n    const headers = lines[0].split(',').map(h => h.trim().toLowerCase());\n    \n    \/\/ Find column indices\n    const nameIdx = headers.findIndex(h => h === 'name');\n    const hinduIdx = headers.findIndex(h => h === 'hindu name');\n    const phoneIdx = headers.findIndex(h => h === 'phone');\n    const emailIdx = headers.findIndex(h => h === 'email');\n    const bloodIdx = headers.findIndex(h => h === 'blood type');\n    const donateIdx = headers.findIndex(h => h === 'blood donate');\n    const townshipIdx = headers.findIndex(h => h === 'township');\n    \n    if (nameIdx === -1) {\n        document.getElementById('tableBody').innerHTML = `<tr><td colspan=\"7\" class=\"error\">Column 'Name' not found. Found: ${headers.join(', ')}<\/td<\/tr>`;\n        return;\n    }\n    \n    donors = [];\n    townshipsSet.clear();\n    \n    for (let i = 1; i < lines.length; i++) {\n        const values = lines[i].split(',').map(v => v.trim());\n        if (values.length < 3) continue;\n        \n        const name = values[nameIdx];\n        if (!name || name === '' || name === 'Timestamp') continue;\n        \n        \/\/ Check availability\n        let isAvailable = true;\n        if (donateIdx !== -1 &#038;&#038; values[donateIdx]) {\n            const donateValue = values[donateIdx].toLowerCase();\n            isAvailable = donateValue.includes('yes') || donateValue.includes('y') || donateValue === 'true';\n        }\n        \n        const township = townshipIdx !== -1 ? values[townshipIdx] : '';\n        if (township &#038;&#038; township !== '') townshipsSet.add(township);\n        \n        donors.push({\n            name: name,\n            hinduName: (hinduIdx !== -1 &#038;&#038; values[hinduIdx]) ? values[hinduIdx] : '-',\n            phone: (phoneIdx !== -1 &#038;&#038; values[phoneIdx]) ? values[phoneIdx] : '-',\n            email: (emailIdx !== -1 &#038;&#038; values[emailIdx]) ? values[emailIdx] : '-',\n            bloodType: (bloodIdx !== -1 &#038;&#038; values[bloodIdx]) ? values[bloodIdx].replace(\/[^A-Za-z+-]\/g, '') : 'Unknown',\n            township: township,\n            available: isAvailable\n        });\n    }\n    \n    \/\/ Update township filter\n    const townshipSelect = document.getElementById('townshipFilter');\n    townshipSelect.innerHTML = '<option value=\"all\">All Townships<\/option>';\n    [...townshipsSet].sort().forEach(township => {\n        const option = document.createElement('option');\n        option.value = township;\n        option.textContent = township;\n        townshipSelect.appendChild(option);\n    });\n    \n    displayDonors();\n}\n\nfunction displayDonors() {\n    let filtered = [...donors];\n    \n    const bloodType = document.getElementById('bloodFilter').value;\n    if (bloodType !== 'all') {\n        filtered = filtered.filter(d => d.bloodType === bloodType);\n    }\n    \n    const avail = document.getElementById('availFilter').value;\n    if (avail === 'yes') {\n        filtered = filtered.filter(d => d.available === true);\n    }\n    \n    const township = document.getElementById('townshipFilter').value;\n    if (township !== 'all') {\n        filtered = filtered.filter(d => d.township === township);\n    }\n    \n    const total = donors.length;\n    const availableCount = donors.filter(d => d.available).length;\n    const showing = filtered.length;\n    \n    document.getElementById('stats').innerHTML = `\ud83d\udcca Total Donors: ${total} | \ud83e\ude78 Available: ${availableCount} | \ud83d\udccd Showing: ${showing}`;\n    \n    if (filtered.length === 0) {\n        document.getElementById('tableBody').innerHTML = '<tr><td colspan=\"7\" style=\"text-align:center;\">No donors match your filters. Try different criteria. <\/td<\/tr>';\n        return;\n    }\n    \n    const html = filtered.map(d => `\n        <tr>\n            <td><strong>${escapeHtml(d.name)}<\/strong><\/td>\n            <td>${escapeHtml(d.hinduName)}<\/td>\n            <td><span class=\"blood-badge\">${escapeHtml(d.bloodType)}<\/span><\/td>\n            <td>${escapeHtml(d.township)}<\/td>\n            <td>${d.phone !== '-' ? `<a href=\"tel:${d.phone}\" class=\"phone-link\">\ud83d\udcde ${d.phone}<\/a>` : '-'}<\/td>\n            <td>${d.email !== '-' ? `<a href=\"mailto:${d.email}\">${d.email}<\/a>` : '-'}<\/td>\n            <td class=\"${d.available ? 'available' : 'unavailable'}\">\n                ${d.available ? '\u2705 Available' : '\u23f8\ufe0f Not Available'}\n            <\/td>\n        <\/tr>\n    `).join('');\n    \n    document.getElementById('tableBody').innerHTML = html;\n}\n\nfunction escapeHtml(str) {\n    if (!str) return '';\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\/\/ Event listeners\ndocument.getElementById('bloodFilter').addEventListener('change', displayDonors);\ndocument.getElementById('availFilter').addEventListener('change', displayDonors);\ndocument.getElementById('townshipFilter').addEventListener('change', displayDonors);\ndocument.getElementById('refreshBtn').addEventListener('click', loadFromGoogleSheets);\n\n\/\/ Load data on page load\nloadFromGoogleSheets();\n\n\/\/ Auto-refresh every 5 minutes\nsetInterval(loadFromGoogleSheets, 300000);\n<\/script>\n<\/body>\n<\/html>\t\t\t\t\t\t\t\t<\/div>\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":"<p>Blood Donor Finder &#8211; Hindu Blood Donors \ud83e\ude78 Hindu Blood Donor Finder Live data from Google Sheets &#8211; Updated automatically \ud83e\ude78 Blood Type: All TypesA+AB+BO+OO-AB+AB \u2705 Availability: All DonorsAvailable Now Only \ud83d\udccd Township: All Townships \ud83d\udd04 Refresh Data Loading data from Google Sheets&#8230; Name Hindu Name Blood Type Township Phone Email Status \ud83d\udd04 Loading from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-2358","page","type-page","status-publish","hentry","entry"],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false,"ocean-thumb-m":false,"ocean-thumb-ml":false,"ocean-thumb-l":false,"psacp-medium":false},"uagb_author_info":{"display_name":"info.sdssmmr@gmail.com","author_link":"https:\/\/test.sdssmyanmar.org\/en\/author\/info-sdssmmrgmail-com\/"},"uagb_comment_info":0,"uagb_excerpt":"Blood Donor Finder &#8211; Hindu Blood Donors \ud83e\ude78 Hindu Blood Donor Finder Live data from Google Sheets &#8211; Updated automatically \ud83e\ude78 Blood Type: All TypesA+AB+BO+OO-AB+AB \u2705 Availability: All DonorsAvailable Now Only \ud83d\udccd Township: All Townships \ud83d\udd04 Refresh Data Loading data from Google Sheets&#8230; Name Hindu Name Blood Type Township Phone Email Status \ud83d\udd04 Loading from&hellip;","_links":{"self":[{"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/pages\/2358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/comments?post=2358"}],"version-history":[{"count":25,"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/pages\/2358\/revisions"}],"predecessor-version":[{"id":2394,"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/pages\/2358\/revisions\/2394"}],"wp:attachment":[{"href":"https:\/\/test.sdssmyanmar.org\/en\/wp-json\/wp\/v2\/media?parent=2358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}