{"id":22451,"date":"2025-09-27T11:50:39","date_gmt":"2025-09-27T04:50:39","guid":{"rendered":"https:\/\/bba.rmutsv.ac.th\/ruts\/?page_id=22451"},"modified":"2025-09-27T12:42:26","modified_gmt":"2025-09-27T05:42:26","slug":"%e0%b8%a3%e0%b8%b0%e0%b8%9a%e0%b8%9a%e0%b8%88%e0%b8%b1%e0%b8%94%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%aa%e0%b8%a7%e0%b8%b1%e0%b8%aa%e0%b8%94%e0%b8%b4%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%9a%e0%b8%b8%e0%b8%84","status":"publish","type":"page","link":"https:\/\/bba.rmutsv.ac.th\/ruts\/%e0%b8%a3%e0%b8%b0%e0%b8%9a%e0%b8%9a%e0%b8%88%e0%b8%b1%e0%b8%94%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%aa%e0%b8%a7%e0%b8%b1%e0%b8%aa%e0%b8%94%e0%b8%b4%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%9a%e0%b8%b8%e0%b8%84\/","title":{"rendered":"\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"th\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23<\/title>\n    <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/sweetalert2@11\"><\/script>\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/xlsx\/0.18.5\/xlsx.full.min.js\"><\/script>\n    <!-- Firebase v9 SDK -->\n    <script type=\"module\">\n        import { initializeApp } from 'https:\/\/www.gstatic.com\/firebasejs\/9.23.0\/firebase-app.js';\n        import { getDatabase, ref, push, set, get, remove, onValue, off } from 'https:\/\/www.gstatic.com\/firebasejs\/9.23.0\/firebase-database.js';\n        import { getAnalytics } from 'https:\/\/www.gstatic.com\/firebasejs\/9.23.0\/firebase-analytics.js';\n\n        \/\/ Firebase configuration\n        const firebaseConfig = {\n            apiKey: \"AIzaSyBu_YDj0ixkwEnLx1MUXMdsHHa5YxXnSG0\",\n            authDomain: \"benefitsfbaruts.firebaseapp.com\",\n            databaseURL: \"https:\/\/benefitsfbaruts-default-rtdb.asia-southeast1.firebasedatabase.app\",\n            projectId: \"benefitsfbaruts\",\n            storageBucket: \"benefitsfbaruts.firebasestorage.app\",\n            messagingSenderId: \"123456789\",\n            appId: \"1:123456789:web:8ac2bccd1c8012fe9375bc\",\n            measurementId: \"G-2C53W97BVE\"\n        };\n\n        \/\/ Initialize Firebase\n        const app = initializeApp(firebaseConfig);\n        const database = getDatabase(app);\n        const analytics = getAnalytics(app);\n\n        \/\/ Make Firebase functions available globally\n        window.firebaseDB = {\n            database,\n            ref,\n            push,\n            set,\n            get,\n            remove,\n            onValue,\n            off\n        };\n\n        \/\/ Initialize the app after Firebase is ready\n        window.initializeFirebaseApp();\n    <\/script>\n    <style>\n        @import url('https:\/\/fonts.googleapis.com\/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');\n        body { font-family: 'Sarabun', sans-serif; }\n        .fade-in { animation: fadeIn 0.3s ease-in; }\n        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }\n        .loading { \n            display: inline-block; \n            width: 20px; \n            height: 20px; \n            border: 3px solid #f3f3f3; \n            border-top: 3px solid #3498db; \n            border-radius: 50%; \n            animation: spin 1s linear infinite; \n        }\n        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n        .delete-btn {\n            transition: all 0.2s ease;\n        }\n        .delete-btn:hover {\n            transform: scale(1.1);\n            background-color: #dc2626 !important;\n        }\n    <\/style>\n<\/head>\n<body class=\"bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen\">\n    <!-- Login Screen -->\n    <div id=\"loginScreen\" class=\"min-h-screen flex items-center justify-center px-4\">\n        <div class=\"bg-white rounded-2xl shadow-2xl p-8 w-full max-w-md\">\n            <div class=\"text-center mb-8\">\n                <div class=\"text-6xl mb-4\">\ud83d\udd10<\/div>\n                <h1 class=\"text-2xl font-bold text-gray-800 mb-2\">\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a<\/h1>\n                <p class=\"text-gray-600\">\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23<\/p>\n            <\/div>\n            \n            <form id=\"loginForm\" class=\"space-y-6\">\n                <div>\n                    <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e0a\u0e37\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49<\/label>\n                    <div class=\"relative\">\n                        <input type=\"text\" id=\"username\" class=\"w-full px-4 py-3 pl-12 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition duration-200\" placeholder=\"\u0e01\u0e23\u0e2d\u0e01\u0e0a\u0e37\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\" required>\n                        <div class=\"absolute left-4 top-1\/2 transform -translate-y-1\/2 text-gray-400\">\n                            \ud83d\udc64\n                        <\/div>\n                    <\/div>\n                <\/div>\n                \n                <div>\n                    <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19<\/label>\n                    <div class=\"relative\">\n                        <input type=\"password\" id=\"password\" class=\"w-full px-4 py-3 pl-12 pr-12 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent transition duration-200\" placeholder=\"\u0e01\u0e23\u0e2d\u0e01\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19\" required>\n                        <div class=\"absolute left-4 top-1\/2 transform -translate-y-1\/2 text-gray-400\">\n                            \ud83d\udd12\n                        <\/div>\n                        <button type=\"button\" onclick=\"togglePassword()\" class=\"absolute right-4 top-1\/2 transform -translate-y-1\/2 text-gray-400 hover:text-gray-600 transition duration-200\">\n                            \ud83d\udc41\ufe0f\n                        <\/button>\n                    <\/div>\n                <\/div>\n                \n                <div class=\"flex items-center justify-between\">\n                    <label class=\"flex items-center\">\n                        <input type=\"checkbox\" id=\"rememberMe\" class=\"rounded border-gray-300 text-blue-600 focus:ring-blue-500\">\n                        <span class=\"ml-2 text-sm text-gray-600\">\u0e08\u0e14\u0e08\u0e33\u0e01\u0e32\u0e23\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a<\/span>\n                    <\/label>\n                <\/div>\n                \n                <button type=\"submit\" class=\"w-full bg-gradient-to-r from-blue-600 to-blue-700 text-white py-3 px-4 rounded-lg hover:from-blue-700 hover:to-blue-800 transition duration-200 font-medium shadow-lg transform hover:scale-105\" id=\"loginBtn\">\n                    \u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a\n                <\/button>\n            <\/form>\n            \n\n            \n            <div class=\"mt-6 text-center\">\n                <p class=\"text-xs text-gray-500\">\n                    \ud83d\udd12 \u0e23\u0e30\u0e1a\u0e1a\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22 | \ud83d\udd25 Firebase Database | \ud83d\udcca Export Excel\n                <\/p>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <!-- Main Application (Hidden by default) -->\n    <div id=\"mainApp\" class=\"container mx-auto px-4 py-8\" style=\"display: none;\">\n        <!-- Header -->\n        <div class=\"bg-white rounded-xl shadow-lg p-6 mb-8\">\n            <div class=\"flex items-center justify-between\">\n                <div>\n                    <h1 class=\"text-3xl font-bold text-gray-800\">\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23<\/h1>\n                    <p class=\"text-gray-600 mt-2\">\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e01\u0e32\u0e23\u0e40\u0e1a\u0e34\u0e01\u0e08\u0e48\u0e32\u0e22\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\u0e41\u0e25\u0e30\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23<\/p>\n                    <div class=\"mt-3 p-3 bg-blue-50 rounded-lg\">\n                        <p class=\"text-sm text-blue-800\">\n                            \ud83d\udd25 <strong>Firebase Database:<\/strong> \u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e40\u0e01\u0e47\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1a\u0e19 Cloud \u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e0b\u0e34\u0e07\u0e04\u0e4c\u0e41\u0e1a\u0e1a Real-time \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16 Export \u0e40\u0e1b\u0e47\u0e19 Excel \u0e44\u0e14\u0e49\n                        <\/p>\n                    <\/div>\n                <\/div>\n                <div class=\"text-right\">\n                    <div class=\"text-sm text-gray-500\">\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48<\/div>\n                    <div class=\"text-lg font-semibold text-gray-800\" id=\"currentDate\"><\/div>\n                    <div class=\"mt-2 space-x-2 flex flex-wrap gap-2\">\n                        <button onclick=\"refreshData()\" class=\"bg-blue-500 text-white px-3 py-1 rounded text-sm hover:bg-blue-600 transition duration-200\">\n                            \ud83d\udd04 \u0e23\u0e35\u0e40\u0e1f\u0e23\u0e0a\n                        <\/button>\n                        <button onclick=\"exportToExcel()\" class=\"bg-green-500 text-white px-3 py-1 rounded text-sm hover:bg-green-600 transition duration-200\">\n                            \ud83d\udcca Export Excel\n                        <\/button>\n                        <button onclick=\"clearAllData()\" class=\"bg-red-500 text-white px-3 py-1 rounded text-sm hover:bg-red-600 transition duration-200\">\n                            \ud83d\uddd1\ufe0f \u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\n                        <\/button>\n                        <button onclick=\"logout()\" class=\"bg-gray-500 text-white px-3 py-1 rounded text-sm hover:bg-gray-600 transition duration-200\">\n                            \ud83d\udeaa \u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e23\u0e30\u0e1a\u0e1a\n                        <\/button>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Navigation Tabs -->\n        <div class=\"bg-white rounded-xl shadow-lg mb-8\">\n            <div class=\"flex border-b\">\n                <button onclick=\"showTab('dashboard')\" id=\"dashboardTab\" class=\"flex-1 py-4 px-6 text-center font-medium border-b-2 border-blue-500 text-blue-600 bg-blue-50\">\n                    \ud83d\udcca \u0e41\u0e14\u0e0a\u0e1a\u0e2d\u0e23\u0e4c\u0e14\n                <\/button>\n                <button onclick=\"showTab('medical')\" id=\"medicalTab\" class=\"flex-1 py-4 px-6 text-center font-medium border-b-2 border-transparent text-gray-500 hover:text-gray-700\">\n                    \ud83c\udfe5 \u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\n                <\/button>\n                <button onclick=\"showTab('education')\" id=\"educationTab\" class=\"flex-1 py-4 px-6 text-center font-medium border-b-2 border-transparent text-gray-500 hover:text-gray-700\">\n                    \ud83c\udf93 \u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\n                <\/button>\n                <button onclick=\"showTab('reports')\" id=\"reportsTab\" class=\"flex-1 py-4 px-6 text-center font-medium border-b-2 border-transparent text-gray-500 hover:text-gray-700\">\n                    \ud83d\udccb \u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\n                <\/button>\n            <\/div>\n        <\/div>\n\n        <!-- Dashboard Tab -->\n        <div id=\"dashboardContent\" class=\"tab-content\">\n            <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8\">\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <div class=\"flex items-center justify-between\">\n                        <div>\n                            <p class=\"text-sm text-gray-600\">\u0e22\u0e2d\u0e14\u0e40\u0e1a\u0e34\u0e01\u0e23\u0e27\u0e21\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e19\u0e35\u0e49<\/p>\n                            <p class=\"text-2xl font-bold text-blue-600\" id=\"totalThisMonth\">0 \u0e1a\u0e32\u0e17<\/p>\n                        <\/div>\n                        <div class=\"bg-blue-100 p-3 rounded-full\">\n                            \ud83d\udcb0\n                        <\/div>\n                    <\/div>\n                <\/div>\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <div class=\"flex items-center justify-between\">\n                        <div>\n                            <p class=\"text-sm text-gray-600\">\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25<\/p>\n                            <p class=\"text-2xl font-bold text-green-600\" id=\"medicalTotal\">0 \u0e1a\u0e32\u0e17<\/p>\n                        <\/div>\n                        <div class=\"bg-green-100 p-3 rounded-full\">\n                            \ud83c\udfe5\n                        <\/div>\n                    <\/div>\n                <\/div>\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <div class=\"flex items-center justify-between\">\n                        <div>\n                            <p class=\"text-sm text-gray-600\">\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23<\/p>\n                            <p class=\"text-2xl font-bold text-purple-600\" id=\"educationTotal\">0 \u0e1a\u0e32\u0e17<\/p>\n                        <\/div>\n                        <div class=\"bg-purple-100 p-3 rounded-full\">\n                            \ud83c\udf93\n                        <\/div>\n                    <\/div>\n                <\/div>\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <div class=\"flex items-center justify-between\">\n                        <div>\n                            <p class=\"text-sm text-gray-600\">\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/p>\n                            <p class=\"text-2xl font-bold text-orange-600\" id=\"pendingCount\">0<\/p>\n                        <\/div>\n                        <div class=\"bg-orange-100 p-3 rounded-full\">\n                            \u23f3\n                        <\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Recent Transactions -->\n            <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                <div class=\"flex justify-between items-center mb-4\">\n                    <h3 class=\"text-xl font-semibold text-gray-800\">\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14<\/h3>\n                    <div class=\"loading\" id=\"dashboardLoading\" style=\"display: none;\"><\/div>\n                <\/div>\n                <div id=\"recentTransactions\" class=\"space-y-3\">\n                    <div class=\"text-gray-500 text-center py-8\">\u0e01\u0e33\u0e25\u0e31\u0e07\u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25&#8230;<\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Medical Tab -->\n        <div id=\"medicalContent\" class=\"tab-content hidden\">\n            <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-8\">\n                <!-- Add Medical Claim Form -->\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <h3 class=\"text-xl font-semibold text-gray-800 mb-6\">\u0e40\u0e1a\u0e34\u0e01\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25<\/h3>\n                    <form id=\"medicalForm\" class=\"space-y-4\">\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e0a\u0e37\u0e48\u0e2d-\u0e2a\u0e01\u0e38\u0e25\u0e1c\u0e39\u0e49\u0e02\u0e2d\u0e40\u0e1a\u0e34\u0e01 *<\/label>\n                            <input type=\"text\" id=\"medicalRequesterName\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e0a\u0e37\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22 *<\/label>\n                            <input type=\"text\" id=\"medicalPatientName\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e31\u0e21\u0e1e\u0e31\u0e19\u0e18\u0e4c *<\/label>\n                            <select id=\"medicalRelation\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\" required>\n                                <option value=\"\">\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e31\u0e21\u0e1e\u0e31\u0e19\u0e18\u0e4c<\/option>\n                                <option value=\"\u0e15\u0e19\u0e40\u0e2d\u0e07\">\u0e15\u0e19\u0e40\u0e2d\u0e07<\/option>\n                                <option value=\"\u0e04\u0e39\u0e48\u0e2a\u0e21\u0e23\u0e2a\">\u0e04\u0e39\u0e48\u0e2a\u0e21\u0e23\u0e2a<\/option>\n                                <option value=\"\u0e1a\u0e38\u0e15\u0e23\">\u0e1a\u0e38\u0e15\u0e23<\/option>\n                                <option value=\"\u0e1a\u0e34\u0e14\u0e32\">\u0e1a\u0e34\u0e14\u0e32<\/option>\n                                <option value=\"\u0e21\u0e32\u0e23\u0e14\u0e32\">\u0e21\u0e32\u0e23\u0e14\u0e32<\/option>\n                            <\/select>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e42\u0e23\u0e07\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\/\u0e04\u0e25\u0e34\u0e19\u0e34\u0e01 *<\/label>\n                            <input type=\"text\" id=\"medicalHospital\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e23\u0e31\u0e01\u0e29\u0e32 *<\/label>\n                            <input type=\"date\" id=\"medicalDate\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e08\u0e33\u0e19\u0e27\u0e19\u0e40\u0e07\u0e34\u0e19 (\u0e1a\u0e32\u0e17) *<\/label>\n                            <input type=\"number\" id=\"medicalAmount\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\" min=\"0\" step=\"0.01\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e2b\u0e21\u0e32\u0e22\u0e40\u0e2b\u0e15\u0e38<\/label>\n                            <textarea id=\"medicalNote\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\" rows=\"3\" placeholder=\"\u0e23\u0e30\u0e1a\u0e38\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21 (\u0e16\u0e49\u0e32\u0e21\u0e35)\"><\/textarea>\n                        <\/div>\n                        <button type=\"submit\" class=\"w-full bg-blue-600 text-white py-3 px-4 rounded-lg hover:bg-blue-700 transition duration-200 font-medium\" id=\"medicalSubmitBtn\">\n                            \u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e01\u0e32\u0e23\u0e40\u0e1a\u0e34\u0e01\u0e08\u0e48\u0e32\u0e22\n                        <\/button>\n                    <\/form>\n                <\/div>\n\n                <!-- Medical Claims List -->\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <div class=\"flex justify-between items-center mb-6\">\n                        <h3 class=\"text-xl font-semibold text-gray-800\">\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25<\/h3>\n                        <div class=\"loading\" id=\"medicalLoading\" style=\"display: none;\"><\/div>\n                    <\/div>\n                    <div id=\"medicalList\" class=\"space-y-3 max-h-96 overflow-y-auto\">\n                        <div class=\"text-gray-500 text-center py-8\">\u0e01\u0e33\u0e25\u0e31\u0e07\u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25&#8230;<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Education Tab -->\n        <div id=\"educationContent\" class=\"tab-content hidden\">\n            <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-8\">\n                <!-- Add Education Claim Form -->\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <h3 class=\"text-xl font-semibold text-gray-800 mb-6\">\u0e40\u0e1a\u0e34\u0e01\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23<\/h3>\n                    <form id=\"educationForm\" class=\"space-y-4\">\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e0a\u0e37\u0e48\u0e2d-\u0e2a\u0e01\u0e38\u0e25\u0e1c\u0e39\u0e49\u0e02\u0e2d\u0e40\u0e1a\u0e34\u0e01 *<\/label>\n                            <input type=\"text\" id=\"educationRequesterName\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e0a\u0e37\u0e48\u0e2d\u0e1a\u0e38\u0e15\u0e23 *<\/label>\n                            <input type=\"text\" id=\"educationChildName\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e2a\u0e16\u0e32\u0e19\u0e28\u0e36\u0e01\u0e29\u0e32 *<\/label>\n                            <input type=\"text\" id=\"educationSchool\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e23\u0e30\u0e14\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e28\u0e36\u0e01\u0e29\u0e32 *<\/label>\n                            <select id=\"educationLevel\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent\" required>\n                                <option value=\"\">\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e23\u0e30\u0e14\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e28\u0e36\u0e01\u0e29\u0e32<\/option>\n                                <option value=\"\u0e2d\u0e19\u0e38\u0e1a\u0e32\u0e25\">\u0e2d\u0e19\u0e38\u0e1a\u0e32\u0e25<\/option>\n                                <option value=\"\u0e1b\u0e23\u0e30\u0e16\u0e21\u0e28\u0e36\u0e01\u0e29\u0e32\">\u0e1b\u0e23\u0e30\u0e16\u0e21\u0e28\u0e36\u0e01\u0e29\u0e32<\/option>\n                                <option value=\"\u0e21\u0e31\u0e18\u0e22\u0e21\u0e28\u0e36\u0e01\u0e29\u0e32\u0e15\u0e2d\u0e19\u0e15\u0e49\u0e19\">\u0e21\u0e31\u0e18\u0e22\u0e21\u0e28\u0e36\u0e01\u0e29\u0e32\u0e15\u0e2d\u0e19\u0e15\u0e49\u0e19<\/option>\n                                <option value=\"\u0e21\u0e31\u0e18\u0e22\u0e21\u0e28\u0e36\u0e01\u0e29\u0e32\u0e15\u0e2d\u0e19\u0e1b\u0e25\u0e32\u0e22\">\u0e21\u0e31\u0e18\u0e22\u0e21\u0e28\u0e36\u0e01\u0e29\u0e32\u0e15\u0e2d\u0e19\u0e1b\u0e25\u0e32\u0e22<\/option>\n                                <option value=\"\u0e1b\u0e27\u0e0a.\">\u0e1b\u0e27\u0e0a.<\/option>\n                                <option value=\"\u0e1b\u0e27\u0e2a.\">\u0e1b\u0e27\u0e2a.<\/option>\n                                <option value=\"\u0e1b\u0e23\u0e34\u0e0d\u0e0d\u0e32\u0e15\u0e23\u0e35\">\u0e1b\u0e23\u0e34\u0e0d\u0e0d\u0e32\u0e15\u0e23\u0e35<\/option>\n                                <option value=\"\u0e1b\u0e23\u0e34\u0e0d\u0e0d\u0e32\u0e42\u0e17\">\u0e1b\u0e23\u0e34\u0e0d\u0e0d\u0e32\u0e42\u0e17<\/option>\n                                <option value=\"\u0e1b\u0e23\u0e34\u0e0d\u0e0d\u0e32\u0e40\u0e2d\u0e01\">\u0e1b\u0e23\u0e34\u0e0d\u0e0d\u0e32\u0e40\u0e2d\u0e01<\/option>\n                            <\/select>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e20\u0e32\u0e04\u0e40\u0e23\u0e35\u0e22\u0e19\/\u0e1b\u0e35\u0e01\u0e32\u0e23\u0e28\u0e36\u0e01\u0e29\u0e32 *<\/label>\n                            <input type=\"text\" id=\"educationSemester\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent\" placeholder=\"\u0e40\u0e0a\u0e48\u0e19 \u0e20\u0e32\u0e04\u0e40\u0e23\u0e35\u0e22\u0e19\u0e17\u0e35\u0e48 1\/2567\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e08\u0e33\u0e19\u0e27\u0e19\u0e40\u0e07\u0e34\u0e19 (\u0e1a\u0e32\u0e17) *<\/label>\n                            <input type=\"number\" id=\"educationAmount\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent\" min=\"0\" step=\"0.01\" required>\n                        <\/div>\n                        <div>\n                            <label class=\"block text-sm font-medium text-gray-700 mb-2\">\u0e2b\u0e21\u0e32\u0e22\u0e40\u0e2b\u0e15\u0e38<\/label>\n                            <textarea id=\"educationNote\" class=\"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent\" rows=\"3\" placeholder=\"\u0e23\u0e30\u0e1a\u0e38\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21 (\u0e16\u0e49\u0e32\u0e21\u0e35)\"><\/textarea>\n                        <\/div>\n                        <button type=\"submit\" class=\"w-full bg-purple-600 text-white py-3 px-4 rounded-lg hover:bg-purple-700 transition duration-200 font-medium\" id=\"educationSubmitBtn\">\n                            \u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e01\u0e32\u0e23\u0e40\u0e1a\u0e34\u0e01\u0e08\u0e48\u0e32\u0e22\n                        <\/button>\n                    <\/form>\n                <\/div>\n\n                <!-- Education Claims List -->\n                <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                    <div class=\"flex justify-between items-center mb-6\">\n                        <h3 class=\"text-xl font-semibold text-gray-800\">\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23<\/h3>\n                        <div class=\"loading\" id=\"educationLoading\" style=\"display: none;\"><\/div>\n                    <\/div>\n                    <div id=\"educationList\" class=\"space-y-3 max-h-96 overflow-y-auto\">\n                        <div class=\"text-gray-500 text-center py-8\">\u0e01\u0e33\u0e25\u0e31\u0e07\u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25&#8230;<\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Reports Tab -->\n        <div id=\"reportsContent\" class=\"tab-content hidden\">\n            <div class=\"bg-white rounded-xl shadow-lg p-6\">\n                <div class=\"flex justify-between items-center mb-6\">\n                    <h3 class=\"text-xl font-semibold text-gray-800\">\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e2a\u0e23\u0e38\u0e1b<\/h3>\n                    <div class=\"flex space-x-4 flex-wrap gap-2\">\n                        <select id=\"reportMonth\" class=\"px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\">\n                            <option value=\"\">\u0e17\u0e38\u0e01\u0e40\u0e14\u0e37\u0e2d\u0e19<\/option>\n                            <option value=\"01\">\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21<\/option>\n                            <option value=\"02\">\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c<\/option>\n                            <option value=\"03\">\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21<\/option>\n                            <option value=\"04\">\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19<\/option>\n                            <option value=\"05\">\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21<\/option>\n                            <option value=\"06\">\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19<\/option>\n                            <option value=\"07\">\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21<\/option>\n                            <option value=\"08\">\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21<\/option>\n                            <option value=\"09\">\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19<\/option>\n                            <option value=\"10\">\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21<\/option>\n                            <option value=\"11\">\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19<\/option>\n                            <option value=\"12\">\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21<\/option>\n                        <\/select>\n                        <select id=\"reportPerson\" class=\"px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent\">\n                            <option value=\"\">\u0e17\u0e38\u0e01\u0e04\u0e19<\/option>\n                        <\/select>\n                        <button onclick=\"generateReport()\" class=\"bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition duration-200\">\n                            \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\n                        <\/button>\n                    <\/div>\n                <\/div>\n                \n                <div id=\"reportContent\" class=\"space-y-6\">\n                    <div class=\"text-gray-500 text-center py-8\">\u0e01\u0e23\u0e38\u0e13\u0e32\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e41\u0e25\u0e30\u0e01\u0e14\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19<\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        \/\/ Data storage\n        let medicalClaims = [];\n        let educationClaims = [];\n        let isFirebaseReady = false;\n\n        \/\/ Firebase database references\n        const DB_PATHS = {\n            MEDICAL: 'medical_claims',\n            EDUCATION: 'education_claims'\n        };\n\n        \/\/ Initialize Firebase App\n        window.initializeFirebaseApp = function() {\n            if (!window.firebaseDB) {\n                console.error('Firebase not ready yet');\n                return;\n            }\n            \n            isFirebaseReady = true;\n            console.log('Firebase initialized successfully');\n            \n            \/\/ Set up real-time listeners\n            setupFirebaseListeners();\n            \n            \/\/ Load initial data\n            loadFromFirebase();\n            \n            \/\/ Show welcome message\n            Swal.fire({\n                icon: 'success',\n                title: '\u0e23\u0e30\u0e1a\u0e1a\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19! \ud83c\udf89',\n                text: '\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d Firebase Database \u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08',\n                timer: 2000,\n                showConfirmButton: false,\n                timerProgressBar: true\n            });\n        };\n\n        \/\/ Login credentials\n        const VALID_USERNAME = 'admin';\n        const VALID_PASSWORD = '1234';\n        const LOGIN_KEY = 'welfare_system_login';\n\n        \/\/ Initialize when DOM is ready\n        document.addEventListener('DOMContentLoaded', function() {\n            \/\/ Check if user is already logged in\n            checkLoginStatus();\n            \n            updateCurrentDate();\n            setDefaultDate();\n            \n            \/\/ Setup login form\n            setupLoginForm();\n            \n            \/\/ If Firebase is already ready, initialize immediately\n            if (window.firebaseDB) {\n                window.initializeFirebaseApp();\n            }\n        });\n\n        \/\/ Check login status\n        function checkLoginStatus() {\n            const isLoggedIn = localStorage.getItem(LOGIN_KEY) === 'true' || \n                              sessionStorage.getItem(LOGIN_KEY) === 'true';\n            \n            if (isLoggedIn) {\n                showMainApp();\n            } else {\n                showLoginScreen();\n            }\n        }\n\n        \/\/ Setup login form\n        function setupLoginForm() {\n            const loginForm = document.getElementById('loginForm');\n            if (loginForm) {\n                loginForm.addEventListener('submit', handleLogin);\n            }\n        }\n\n        \/\/ Handle login\n        function handleLogin(e) {\n            e.preventDefault();\n            \n            const username = document.getElementById('username').value.trim();\n            const password = document.getElementById('password').value;\n            const rememberMe = document.getElementById('rememberMe').checked;\n            \n            \/\/ Show loading\n            const loginBtn = document.getElementById('loginBtn');\n            const originalText = loginBtn.textContent;\n            loginBtn.textContent = '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a...';\n            loginBtn.disabled = true;\n            \n            \/\/ Simulate login delay for better UX\n            setTimeout(() => {\n                if (username === VALID_USERNAME && password === VALID_PASSWORD) {\n                    \/\/ Successful login\n                    if (rememberMe) {\n                        localStorage.setItem(LOGIN_KEY, 'true');\n                    } else {\n                        sessionStorage.setItem(LOGIN_KEY, 'true');\n                    }\n                    \n                    Swal.fire({\n                        icon: 'success',\n                        title: '\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08! \ud83c\udf89',\n                        text: '\u0e22\u0e34\u0e19\u0e14\u0e35\u0e15\u0e49\u0e2d\u0e19\u0e23\u0e31\u0e1a\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23',\n                        timer: 2000,\n                        showConfirmButton: false,\n                        timerProgressBar: true\n                    }).then(() => {\n                        showMainApp();\n                    });\n                    \n                } else {\n                    \/\/ Failed login\n                    Swal.fire({\n                        icon: 'error',\n                        title: '\u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a\u0e44\u0e21\u0e48\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08! \u274c',\n                        text: '\u0e0a\u0e37\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e2b\u0e23\u0e37\u0e2d\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19\u0e44\u0e21\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07',\n                        confirmButtonText: '\u0e25\u0e2d\u0e07\u0e43\u0e2b\u0e21\u0e48',\n                        confirmButtonColor: '#dc2626'\n                    });\n                    \n                    \/\/ Clear password field\n                    document.getElementById('password').value = '';\n                    document.getElementById('password').focus();\n                }\n                \n                \/\/ Reset button\n                loginBtn.textContent = originalText;\n                loginBtn.disabled = false;\n                \n            }, 1000);\n        }\n\n        \/\/ Show login screen\n        function showLoginScreen() {\n            document.getElementById('loginScreen').style.display = 'flex';\n            document.getElementById('mainApp').style.display = 'none';\n            \n            \/\/ Focus on username field\n            setTimeout(() => {\n                const usernameField = document.getElementById('username');\n                if (usernameField) {\n                    usernameField.focus();\n                }\n            }, 100);\n        }\n\n        \/\/ Show main application\n        function showMainApp() {\n            document.getElementById('loginScreen').style.display = 'none';\n            document.getElementById('mainApp').style.display = 'block';\n            \n            \/\/ Initialize Firebase if ready\n            if (window.firebaseDB && !isFirebaseReady) {\n                window.initializeFirebaseApp();\n            }\n        }\n\n        \/\/ Logout function\n        function logout() {\n            Swal.fire({\n                title: '\u0e22\u0e37\u0e19\u0e22\u0e31\u0e19\u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e23\u0e30\u0e1a\u0e1a',\n                text: '\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e23\u0e30\u0e1a\u0e1a\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48?',\n                icon: 'question',\n                showCancelButton: true,\n                confirmButtonColor: '#6b7280',\n                cancelButtonColor: '#3085d6',\n                confirmButtonText: '\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e23\u0e30\u0e1a\u0e1a',\n                cancelButtonText: '\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01'\n            }).then((result) => {\n                if (result.isConfirmed) {\n                    \/\/ Clear login status\n                    localStorage.removeItem(LOGIN_KEY);\n                    sessionStorage.removeItem(LOGIN_KEY);\n                    \n                    \/\/ Clear form\n                    document.getElementById('loginForm').reset();\n                    \n                    \/\/ Show success message and redirect to login\n                    Swal.fire({\n                        icon: 'success',\n                        title: '\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01\u0e23\u0e30\u0e1a\u0e1a\u0e41\u0e25\u0e49\u0e27! \ud83d\udc4b',\n                        text: '\u0e02\u0e2d\u0e1a\u0e04\u0e38\u0e13\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e1a\u0e23\u0e34\u0e01\u0e32\u0e23',\n                        timer: 2000,\n                        showConfirmButton: false,\n                        timerProgressBar: true\n                    }).then(() => {\n                        showLoginScreen();\n                    });\n                }\n            });\n        }\n\n        \/\/ Toggle password visibility\n        function togglePassword() {\n            const passwordField = document.getElementById('password');\n            const toggleBtn = passwordField.nextElementSibling.nextElementSibling;\n            \n            if (passwordField.type === 'password') {\n                passwordField.type = 'text';\n                toggleBtn.textContent = '\ud83d\ude48';\n            } else {\n                passwordField.type = 'password';\n                toggleBtn.textContent = '\ud83d\udc41\ufe0f';\n            }\n        }\n\n        \/\/ Firebase Database functions\n        function setupFirebaseListeners() {\n            if (!isFirebaseReady) return;\n            \n            const { database, ref, onValue } = window.firebaseDB;\n            \n            \/\/ Listen for medical claims changes\n            const medicalRef = ref(database, DB_PATHS.MEDICAL);\n            onValue(medicalRef, (snapshot) => {\n                const data = snapshot.val();\n                medicalClaims = data ? Object.keys(data).map(key => ({...data[key], firebaseKey: key})) : [];\n                updateDashboard();\n                renderMedicalList();\n                renderRecentTransactions();\n                updatePersonList();\n            });\n            \n            \/\/ Listen for education claims changes\n            const educationRef = ref(database, DB_PATHS.EDUCATION);\n            onValue(educationRef, (snapshot) => {\n                const data = snapshot.val();\n                educationClaims = data ? Object.keys(data).map(key => ({...data[key], firebaseKey: key})) : [];\n                updateDashboard();\n                renderEducationList();\n                renderRecentTransactions();\n                updatePersonList();\n            });\n        }\n\n        async function loadFromFirebase() {\n            if (!isFirebaseReady) return;\n            \n            try {\n                showLoading(true);\n                const { database, ref, get } = window.firebaseDB;\n                \n                \/\/ Load medical claims\n                const medicalSnapshot = await get(ref(database, DB_PATHS.MEDICAL));\n                const medicalData = medicalSnapshot.val();\n                medicalClaims = medicalData ? Object.keys(medicalData).map(key => ({...medicalData[key], firebaseKey: key})) : [];\n                \n                \/\/ Load education claims\n                const educationSnapshot = await get(ref(database, DB_PATHS.EDUCATION));\n                const educationData = educationSnapshot.val();\n                educationClaims = educationData ? Object.keys(educationData).map(key => ({...educationData[key], firebaseKey: key})) : [];\n                \n                \/\/ Update UI\n                updateDashboard();\n                renderMedicalList();\n                renderEducationList();\n                renderRecentTransactions();\n                updatePersonList();\n                \n                console.log('Data loaded from Firebase successfully');\n                \n            } catch (error) {\n                console.error('Error loading from Firebase:', error);\n                Swal.fire({\n                    icon: 'error',\n                    title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14\u0e43\u0e19\u0e01\u0e32\u0e23\u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25',\n                    text: '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d Firebase \u0e44\u0e14\u0e49',\n                    confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                });\n            } finally {\n                showLoading(false);\n            }\n        }\n\n        async function saveToFirebase(type, data) {\n            if (!isFirebaseReady) {\n                throw new Error('Firebase \u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19');\n            }\n            \n            try {\n                const { database, ref, push } = window.firebaseDB;\n                const dbRef = ref(database, type === 'medical' ? DB_PATHS.MEDICAL : DB_PATHS.EDUCATION);\n                \n                await push(dbRef, data);\n                console.log(`${type} claim saved to Firebase successfully`);\n                \n            } catch (error) {\n                console.error('Error saving to Firebase:', error);\n                throw error;\n            }\n        }\n\n        async function updateFirebaseRecord(type, firebaseKey, data) {\n            if (!isFirebaseReady) {\n                throw new Error('Firebase \u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19');\n            }\n            \n            try {\n                const { database, ref, set } = window.firebaseDB;\n                const path = type === 'medical' ? DB_PATHS.MEDICAL : DB_PATHS.EDUCATION;\n                const dbRef = ref(database, `${path}\/${firebaseKey}`);\n                \n                await set(dbRef, data);\n                console.log(`${type} claim updated in Firebase successfully`);\n                \n            } catch (error) {\n                console.error('Error updating Firebase record:', error);\n                throw error;\n            }\n        }\n\n        async function deleteFromFirebase(type, firebaseKey) {\n            if (!isFirebaseReady) {\n                throw new Error('Firebase \u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19');\n            }\n            \n            try {\n                const { database, ref, remove } = window.firebaseDB;\n                const path = type === 'medical' ? DB_PATHS.MEDICAL : DB_PATHS.EDUCATION;\n                const dbRef = ref(database, `${path}\/${firebaseKey}`);\n                \n                await remove(dbRef);\n                console.log(`${type} claim deleted from Firebase successfully`);\n                \n            } catch (error) {\n                console.error('Error deleting from Firebase:', error);\n                throw error;\n            }\n        }\n\n        \/\/ Export to Excel function\n        function exportToExcel() {\n            if (medicalClaims.length === 0 && educationClaims.length === 0) {\n                Swal.fire({\n                    icon: 'warning',\n                    title: '\u0e44\u0e21\u0e48\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e2b\u0e49 Export',\n                    text: '\u0e01\u0e23\u0e38\u0e13\u0e32\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e01\u0e48\u0e2d\u0e19\u0e17\u0e33\u0e01\u0e32\u0e23 Export',\n                    confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                });\n                return;\n            }\n\n            try {\n                \/\/ Create CSV content\n                let csvContent = '';\n                \n                \/\/ Add BOM for UTF-8 encoding\n                csvContent = '\\uFEFF';\n                \n                \/\/ Medical claims section\n                if (medicalClaims.length > 0) {\n                    csvContent += '\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\\n';\n                    csvContent += '\u0e1c\u0e39\u0e49\u0e02\u0e2d\u0e40\u0e1a\u0e34\u0e01,\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22,\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e31\u0e21\u0e1e\u0e31\u0e19\u0e18\u0e4c,\u0e42\u0e23\u0e07\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\/\u0e04\u0e25\u0e34\u0e19\u0e34\u0e01,\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e23\u0e31\u0e01\u0e29\u0e32,\u0e08\u0e33\u0e19\u0e27\u0e19\u0e40\u0e07\u0e34\u0e19 (\u0e1a\u0e32\u0e17),\u0e2b\u0e21\u0e32\u0e22\u0e40\u0e2b\u0e15\u0e38,\u0e2a\u0e16\u0e32\u0e19\u0e30,\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\\n';\n                    \n                    medicalClaims.forEach(claim => {\n                        const row = [\n                            claim.requesterName || '',\n                            claim.patientName || '',\n                            claim.relation || '',\n                            claim.hospital || '',\n                            claim.date || '',\n                            parseFloat(claim.amount) || 0,\n                            claim.note || '',\n                            claim.status || '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23',\n                            claim.timestamp ? new Date(claim.timestamp).toLocaleDateString('th-TH') : ''\n                        ].map(field => `\"${String(field).replace(\/\"\/g, '\"\"')}\"`).join(',');\n                        csvContent += row + '\\n';\n                    });\n                    csvContent += '\\n';\n                }\n                \n                \/\/ Education claims section\n                if (educationClaims.length > 0) {\n                    csvContent += '\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\\n';\n                    csvContent += '\u0e1c\u0e39\u0e49\u0e02\u0e2d\u0e40\u0e1a\u0e34\u0e01,\u0e0a\u0e37\u0e48\u0e2d\u0e1a\u0e38\u0e15\u0e23,\u0e2a\u0e16\u0e32\u0e19\u0e28\u0e36\u0e01\u0e29\u0e32,\u0e23\u0e30\u0e14\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e28\u0e36\u0e01\u0e29\u0e32,\u0e20\u0e32\u0e04\u0e40\u0e23\u0e35\u0e22\u0e19\/\u0e1b\u0e35\u0e01\u0e32\u0e23\u0e28\u0e36\u0e01\u0e29\u0e32,\u0e08\u0e33\u0e19\u0e27\u0e19\u0e40\u0e07\u0e34\u0e19 (\u0e1a\u0e32\u0e17),\u0e2b\u0e21\u0e32\u0e22\u0e40\u0e2b\u0e15\u0e38,\u0e2a\u0e16\u0e32\u0e19\u0e30,\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\\n';\n                    \n                    educationClaims.forEach(claim => {\n                        const row = [\n                            claim.requesterName || '',\n                            claim.childName || '',\n                            claim.school || '',\n                            claim.level || '',\n                            claim.semester || '',\n                            parseFloat(claim.amount) || 0,\n                            claim.note || '',\n                            claim.status || '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23',\n                            claim.timestamp ? new Date(claim.timestamp).toLocaleDateString('th-TH') : ''\n                        ].map(field => `\"${String(field).replace(\/\"\/g, '\"\"')}\"`).join(',');\n                        csvContent += row + '\\n';\n                    });\n                    csvContent += '\\n';\n                }\n                \n                \/\/ Summary section\n                const totalMedical = medicalClaims.reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n                const totalEducation = educationClaims.reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n                \n                csvContent += '\u0e2a\u0e23\u0e38\u0e1b\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\\n';\n                csvContent += '\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23,\u0e08\u0e33\u0e19\u0e27\u0e19\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23,\u0e22\u0e2d\u0e14\u0e23\u0e27\u0e21 (\u0e1a\u0e32\u0e17)\\n';\n                csvContent += `\"\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\",\"${medicalClaims.length}\",\"${totalMedical}\"\\n`;\n                csvContent += `\"\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\",\"${educationClaims.length}\",\"${totalEducation}\"\\n`;\n                csvContent += `\"\u0e23\u0e27\u0e21\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\",\"${medicalClaims.length + educationClaims.length}\",\"${totalMedical + totalEducation}\"\\n`;\n                \n                \/\/ Generate filename with current date and time\n                const now = new Date();\n                const dateStr = now.getFullYear() + '-' + \n                              String(now.getMonth() + 1).padStart(2, '0') + '-' + \n                              String(now.getDate()).padStart(2, '0') + '_' +\n                              String(now.getHours()).padStart(2, '0') + '-' +\n                              String(now.getMinutes()).padStart(2, '0');\n                const filename = `\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23_${dateStr}.csv`;\n                \n                \/\/ Method 1: Try modern download approach\n                try {\n                    const blob = new Blob([csvContent], { \n                        type: 'text\/csv;charset=utf-8;' \n                    });\n                    \n                    \/\/ Create download link\n                    const downloadLink = document.createElement('a');\n                    downloadLink.href = URL.createObjectURL(blob);\n                    downloadLink.download = filename;\n                    downloadLink.style.display = 'none';\n                    \n                    \/\/ Add to DOM, click, and remove\n                    document.body.appendChild(downloadLink);\n                    downloadLink.click();\n                    document.body.removeChild(downloadLink);\n                    \n                    \/\/ Clean up object URL\n                    setTimeout(() => {\n                        URL.revokeObjectURL(downloadLink.href);\n                    }, 100);\n                    \n                    \/\/ Show success message\n                    Swal.fire({\n                        icon: 'success',\n                        title: '\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08! \ud83d\udcca',\n                        html: `\u0e44\u0e1f\u0e25\u0e4c <strong>${filename}<\/strong> \u0e16\u0e39\u0e01\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14\u0e41\u0e25\u0e49\u0e27<br><small>\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e43\u0e19\u0e42\u0e1f\u0e25\u0e40\u0e14\u0e2d\u0e23\u0e4c Downloads \u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13<\/small>`,\n                        timer: 4000,\n                        showConfirmButton: true,\n                        confirmButtonText: '\u0e15\u0e01\u0e25\u0e07',\n                        timerProgressBar: true\n                    });\n                    \n                } catch (blobError) {\n                    console.log('Blob method failed, trying alternative...', blobError);\n                    \n                    \/\/ Method 2: Data URL approach\n                    const dataUrl = 'data:text\/csv;charset=utf-8,' + encodeURIComponent(csvContent);\n                    const downloadLink = document.createElement('a');\n                    downloadLink.href = dataUrl;\n                    downloadLink.download = filename;\n                    downloadLink.style.display = 'none';\n                    \n                    document.body.appendChild(downloadLink);\n                    downloadLink.click();\n                    document.body.removeChild(downloadLink);\n                    \n                    Swal.fire({\n                        icon: 'success',\n                        title: '\u0e44\u0e1f\u0e25\u0e4c\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14! \ud83d\udcca',\n                        html: `\u0e44\u0e1f\u0e25\u0e4c <strong>${filename}<\/strong> \u0e16\u0e39\u0e01\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e25\u0e49\u0e27<br><small>\u0e2b\u0e32\u0e01\u0e44\u0e21\u0e48\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e04\u0e25\u0e34\u0e01\u0e02\u0e27\u0e32\u0e17\u0e35\u0e48\u0e25\u0e34\u0e07\u0e01\u0e4c\u0e41\u0e25\u0e30\u0e40\u0e25\u0e37\u0e2d\u0e01 \"Save as\"<\/small>`,\n                        confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                    });\n                }\n                \n            } catch (error) {\n                console.error('Export error:', error);\n                \n                \/\/ Method 3: Fallback - show data in new window\n                try {\n                    const newWindow = window.open('', '_blank');\n                    newWindow.document.write('<pre>' + csvContent + '<\/pre>');\n                    newWindow.document.title = '\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23';\n                    \n                    Swal.fire({\n                        icon: 'info',\n                        title: '\u0e41\u0e2a\u0e14\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e43\u0e2b\u0e21\u0e48',\n                        text: '\u0e01\u0e23\u0e38\u0e13\u0e32\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e08\u0e32\u0e01\u0e2b\u0e19\u0e49\u0e32\u0e15\u0e48\u0e32\u0e07\u0e43\u0e2b\u0e21\u0e48\u0e41\u0e25\u0e30\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c .csv',\n                        confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                    });\n                    \n                } catch (windowError) {\n                    console.error('All methods failed:', windowError);\n                    \n                    \/\/ Method 4: Last resort - copy to clipboard\n                    if (navigator.clipboard) {\n                        navigator.clipboard.writeText(csvContent).then(() => {\n                            Swal.fire({\n                                icon: 'info',\n                                title: '\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e25\u0e49\u0e27! \ud83d\udccb',\n                                text: '\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e16\u0e39\u0e01\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e44\u0e1b\u0e22\u0e31\u0e07 Clipboard \u0e41\u0e25\u0e49\u0e27 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e19\u0e33\u0e44\u0e1b\u0e27\u0e32\u0e07\u0e43\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 Excel \u0e2b\u0e23\u0e37\u0e2d Google Sheets',\n                                confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                            });\n                        }).catch(() => {\n                            showDataInAlert(csvContent);\n                        });\n                    } else {\n                        showDataInAlert(csvContent);\n                    }\n                }\n            }\n        }\n        \n        \/\/ Helper function to show data in alert when all else fails\n        function showDataInAlert(csvContent) {\n            Swal.fire({\n                icon: 'info',\n                title: '\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23',\n                html: `<textarea readonly style=\"width:100%;height:300px;font-family:monospace;font-size:12px;\">${csvContent}<\/textarea>`,\n                confirmButtonText: '\u0e15\u0e01\u0e25\u0e07',\n                width: '80%'\n            });\n        }\n\n        \/\/ Clear all data function\n        async function clearAllData() {\n            Swal.fire({\n                title: '\u0e22\u0e37\u0e19\u0e22\u0e31\u0e19\u0e01\u0e32\u0e23\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14',\n                text: '\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e08\u0e32\u0e01 Firebase \u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48? \u0e01\u0e32\u0e23\u0e01\u0e23\u0e30\u0e17\u0e33\u0e19\u0e35\u0e49\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e22\u0e49\u0e2d\u0e19\u0e01\u0e25\u0e31\u0e1a\u0e44\u0e14\u0e49',\n                icon: 'warning',\n                showCancelButton: true,\n                confirmButtonColor: '#dc2626',\n                cancelButtonColor: '#6b7280',\n                confirmButtonText: '\u0e25\u0e1a\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14',\n                cancelButtonText: '\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01'\n            }).then(async (result) => {\n                if (result.isConfirmed) {\n                    try {\n                        \/\/ Show loading\n                        Swal.fire({\n                            title: '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25...',\n                            text: '\u0e01\u0e23\u0e38\u0e13\u0e32\u0e23\u0e2d\u0e2a\u0e31\u0e01\u0e04\u0e23\u0e39\u0e48',\n                            allowOutsideClick: false,\n                            showConfirmButton: false,\n                            didOpen: () => {\n                                Swal.showLoading();\n                            }\n                        });\n                        \n                        if (isFirebaseReady) {\n                            const { database, ref, remove } = window.firebaseDB;\n                            \n                            \/\/ Clear Firebase data\n                            await remove(ref(database, DB_PATHS.MEDICAL));\n                            await remove(ref(database, DB_PATHS.EDUCATION));\n                        }\n                        \n                        \/\/ Clear local arrays\n                        medicalClaims = [];\n                        educationClaims = [];\n                        \n                        \/\/ Update UI\n                        updateDashboard();\n                        renderMedicalList();\n                        renderEducationList();\n                        renderRecentTransactions();\n                        updatePersonList();\n                        \n                        Swal.fire({\n                            icon: 'success',\n                            title: '\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08!',\n                            text: '\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e08\u0e32\u0e01 Firebase \u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27',\n                            timer: 2000,\n                            showConfirmButton: false\n                        });\n                        \n                    } catch (error) {\n                        console.error('Error clearing data:', error);\n                        Swal.fire({\n                            icon: 'error',\n                            title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14!',\n                            text: '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e14\u0e49 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e25\u0e2d\u0e07\u0e43\u0e2b\u0e21\u0e48\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07',\n                            confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                        });\n                    }\n                }\n            });\n        }\n\n        \/\/ Refresh data (local only)\n        function refreshData() {\n            updateDashboard();\n            renderMedicalList();\n            renderEducationList();\n            renderRecentTransactions();\n            updatePersonList();\n            \n            Swal.fire({\n                icon: 'success',\n                title: '\u0e23\u0e35\u0e40\u0e1f\u0e23\u0e0a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e25\u0e49\u0e27',\n                timer: 1500,\n                showConfirmButton: false\n            });\n        }\n\n        \/\/ Show\/hide loading indicators\n        function showLoading(show) {\n            const loadingElements = ['dashboardLoading', 'medicalLoading', 'educationLoading'];\n            loadingElements.forEach(id => {\n                const element = document.getElementById(id);\n                if (element) {\n                    element.style.display = show ? 'inline-block' : 'none';\n                }\n            });\n        }\n\n        \/\/ Update current date\n        function updateCurrentDate() {\n            const now = new Date();\n            const options = { \n                year: 'numeric', \n                month: 'long', \n                day: 'numeric',\n                weekday: 'long'\n            };\n            document.getElementById('currentDate').textContent = now.toLocaleDateString('th-TH', options);\n        }\n\n        \/\/ Set default date to today\n        function setDefaultDate() {\n            const today = new Date().toISOString().split('T')[0];\n            document.getElementById('medicalDate').value = today;\n        }\n\n        \/\/ Tab switching\n        function showTab(tabName) {\n            \/\/ Hide all tab contents\n            document.querySelectorAll('.tab-content').forEach(content => {\n                content.classList.add('hidden');\n            });\n            \n            \/\/ Remove active class from all tabs\n            document.querySelectorAll('[id$=\"Tab\"]').forEach(tab => {\n                tab.classList.remove('border-blue-500', 'text-blue-600', 'bg-blue-50');\n                tab.classList.add('border-transparent', 'text-gray-500');\n            });\n            \n            \/\/ Show selected tab content\n            document.getElementById(tabName + 'Content').classList.remove('hidden');\n            document.getElementById(tabName + 'Content').classList.add('fade-in');\n            \n            \/\/ Add active class to selected tab\n            const activeTab = document.getElementById(tabName + 'Tab');\n            activeTab.classList.add('border-blue-500', 'text-blue-600', 'bg-blue-50');\n            activeTab.classList.remove('border-transparent', 'text-gray-500');\n        }\n\n        \/\/ Medical form submission\n        document.getElementById('medicalForm').addEventListener('submit', async function(e) {\n            e.preventDefault();\n            \n            \/\/ Show loading alert\n            Swal.fire({\n                title: '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25...',\n                text: '\u0e01\u0e23\u0e38\u0e13\u0e32\u0e23\u0e2d\u0e2a\u0e31\u0e01\u0e04\u0e23\u0e39\u0e48',\n                allowOutsideClick: false,\n                showConfirmButton: false,\n                didOpen: () => {\n                    Swal.showLoading();\n                }\n            });\n            \n            try {\n                const formData = {\n                    id: 'MED_' + new Date().getTime(),\n                    requesterName: document.getElementById('medicalRequesterName').value.trim(),\n                    patientName: document.getElementById('medicalPatientName').value.trim(),\n                    relation: document.getElementById('medicalRelation').value,\n                    hospital: document.getElementById('medicalHospital').value.trim(),\n                    date: document.getElementById('medicalDate').value,\n                    amount: parseFloat(document.getElementById('medicalAmount').value),\n                    note: document.getElementById('medicalNote').value.trim(),\n                    status: '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23',\n                    timestamp: new Date().toISOString()\n                };\n                \n                \/\/ Save to Firebase\n                await saveToFirebase('medical', formData);\n                \n                \/\/ Reset form\n                this.reset();\n                setDefaultDate();\n                \n                \/\/ Show success message\n                Swal.fire({\n                    icon: 'success',\n                    title: '\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08! \ud83c\udf89',\n                    text: '\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e01\u0e32\u0e23\u0e40\u0e1a\u0e34\u0e01\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\u0e25\u0e07 Firebase \u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27',\n                    timer: 2500,\n                    showConfirmButton: false,\n                    timerProgressBar: true\n                });\n                \n            } catch (error) {\n                console.error('Error:', error);\n                Swal.fire({\n                    icon: 'error',\n                    title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14! \u274c',\n                    text: error.message || '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e14\u0e49 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e25\u0e2d\u0e07\u0e43\u0e2b\u0e21\u0e48\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07',\n                    confirmButtonText: '\u0e15\u0e01\u0e25\u0e07',\n                    confirmButtonColor: '#3085d6'\n                });\n            }\n        });\n\n        \/\/ Education form submission\n        document.getElementById('educationForm').addEventListener('submit', async function(e) {\n            e.preventDefault();\n            \n            \/\/ Show loading alert\n            Swal.fire({\n                title: '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25...',\n                text: '\u0e01\u0e23\u0e38\u0e13\u0e32\u0e23\u0e2d\u0e2a\u0e31\u0e01\u0e04\u0e23\u0e39\u0e48',\n                allowOutsideClick: false,\n                showConfirmButton: false,\n                didOpen: () => {\n                    Swal.showLoading();\n                }\n            });\n            \n            try {\n                const formData = {\n                    id: 'EDU_' + new Date().getTime(),\n                    requesterName: document.getElementById('educationRequesterName').value.trim(),\n                    childName: document.getElementById('educationChildName').value.trim(),\n                    school: document.getElementById('educationSchool').value.trim(),\n                    level: document.getElementById('educationLevel').value,\n                    semester: document.getElementById('educationSemester').value.trim(),\n                    amount: parseFloat(document.getElementById('educationAmount').value),\n                    note: document.getElementById('educationNote').value.trim(),\n                    status: '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23',\n                    timestamp: new Date().toISOString()\n                };\n                \n                \/\/ Save to Firebase\n                await saveToFirebase('education', formData);\n                \n                \/\/ Reset form\n                this.reset();\n                \n                \/\/ Show success message\n                Swal.fire({\n                    icon: 'success',\n                    title: '\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08! \ud83c\udf89',\n                    text: '\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e01\u0e32\u0e23\u0e40\u0e1a\u0e34\u0e01\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\u0e25\u0e07 Firebase \u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27',\n                    timer: 2500,\n                    showConfirmButton: false,\n                    timerProgressBar: true\n                });\n                \n            } catch (error) {\n                console.error('Error:', error);\n                Swal.fire({\n                    icon: 'error',\n                    title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14! \u274c',\n                    text: error.message || '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e14\u0e49 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e25\u0e2d\u0e07\u0e43\u0e2b\u0e21\u0e48\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07',\n                    confirmButtonText: '\u0e15\u0e01\u0e25\u0e07',\n                    confirmButtonColor: '#3085d6'\n                });\n            }\n        });\n\n        \/\/ Update dashboard\n        function updateDashboard() {\n            const currentMonth = new Date().getMonth();\n            const currentYear = new Date().getFullYear();\n            \n            const thisMonthMedical = medicalClaims.filter(claim => {\n                const claimDate = new Date(claim.timestamp || claim.date);\n                return claimDate.getMonth() === currentMonth && claimDate.getFullYear() === currentYear;\n            }).reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n            \n            const thisMonthEducation = educationClaims.filter(claim => {\n                const claimDate = new Date(claim.timestamp || claim.date);\n                return claimDate.getMonth() === currentMonth && claimDate.getFullYear() === currentYear;\n            }).reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n            \n            const totalMedical = medicalClaims.reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n            const totalEducation = educationClaims.reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n            const pendingCount = [...medicalClaims, ...educationClaims].filter(claim => claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23').length;\n            \n            document.getElementById('totalThisMonth').textContent = (thisMonthMedical + thisMonthEducation).toLocaleString() + ' \u0e1a\u0e32\u0e17';\n            document.getElementById('medicalTotal').textContent = totalMedical.toLocaleString() + ' \u0e1a\u0e32\u0e17';\n            document.getElementById('educationTotal').textContent = totalEducation.toLocaleString() + ' \u0e1a\u0e32\u0e17';\n            document.getElementById('pendingCount').textContent = pendingCount;\n        }\n\n        \/\/ Update person list for reports\n        function updatePersonList() {\n            const personSelect = document.getElementById('reportPerson');\n            const allPersons = new Set();\n            \n            \/\/ Collect all requester names\n            [...medicalClaims, ...educationClaims].forEach(claim => {\n                if (claim.requesterName && claim.requesterName.trim()) {\n                    allPersons.add(claim.requesterName.trim());\n                }\n            });\n            \n            \/\/ Clear existing options except \"\u0e17\u0e38\u0e01\u0e04\u0e19\"\n            personSelect.innerHTML = '<option value=\"\">\u0e17\u0e38\u0e01\u0e04\u0e19<\/option>';\n            \n            \/\/ Add person options\n            Array.from(allPersons).sort().forEach(person => {\n                const option = document.createElement('option');\n                option.value = person;\n                option.textContent = person;\n                personSelect.appendChild(option);\n            });\n        }\n\n        \/\/ Render medical claims list\n        function renderMedicalList() {\n            const container = document.getElementById('medicalList');\n            \n            if (medicalClaims.length === 0) {\n                container.innerHTML = '<div class=\"text-gray-500 text-center py-8\">\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e21\u0e35\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/div>';\n                return;\n            }\n            \n            \/\/ Sort by timestamp (newest first)\n            const sortedClaims = [...medicalClaims].sort((a, b) => \n                new Date(b.timestamp || b.date) - new Date(a.timestamp || a.date)\n            );\n            \n            container.innerHTML = sortedClaims.map((claim, index) => `\n                <div class=\"border border-gray-200 rounded-lg p-4 hover:bg-gray-50 transition duration-200\">\n                    <div class=\"flex justify-between items-start mb-2\">\n                        <div class=\"flex-1\">\n                            <div class=\"font-medium text-gray-800\">${claim.requesterName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                            <div class=\"text-sm text-gray-600\">\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22: ${claim.patientName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'} (${claim.relation || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'})<\/div>\n                        <\/div>\n                        <div class=\"text-right flex items-start space-x-2\">\n                            <div>\n                                <div class=\"text-lg font-semibold text-green-600\">${(parseFloat(claim.amount) || 0).toLocaleString()} \u0e1a\u0e32\u0e17<\/div>\n                                <span class=\"inline-block px-2 py-1 text-xs rounded-full ${claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23' ? 'bg-orange-100 text-orange-800' : 'bg-green-100 text-green-800'}\">${claim.status || '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23'}<\/span>\n                            <\/div>\n                            <div class=\"flex flex-col space-y-1\">\n                                ${claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23' ? `\n                                <button onclick=\"approveMedicalClaim('${claim.firebaseKey || claim.id || index}')\" class=\"bg-green-500 hover:bg-green-600 text-white p-2 rounded-full text-sm transition duration-200\" title=\"\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e19\u0e35\u0e49\">\n                                    \u2705\n                                <\/button>\n                                ` : ''}\n                                <button onclick=\"deleteMedicalClaim('${claim.firebaseKey || claim.id || index}')\" class=\"delete-btn bg-red-500 hover:bg-red-600 text-white p-2 rounded-full text-sm transition duration-200\" title=\"\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e19\u0e35\u0e49\">\n                                    \ud83d\uddd1\ufe0f\n                                <\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class=\"text-sm text-gray-600 mb-1\">\ud83c\udfe5 ${claim.hospital || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                    <div class=\"text-sm text-gray-500\">\ud83d\udcc5 \u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e23\u0e31\u0e01\u0e29\u0e32: ${claim.date ? new Date(claim.date).toLocaleDateString('th-TH') : '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                    ${claim.note ? `<div class=\"text-sm text-gray-600 mt-2 bg-gray-50 p-2 rounded\">\ud83d\udcac ${claim.note}<\/div>` : ''}\n                <\/div>\n            `).join('');\n        }\n\n        \/\/ Render education claims list\n        function renderEducationList() {\n            const container = document.getElementById('educationList');\n            \n            if (educationClaims.length === 0) {\n                container.innerHTML = '<div class=\"text-gray-500 text-center py-8\">\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e21\u0e35\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/div>';\n                return;\n            }\n            \n            \/\/ Sort by timestamp (newest first)\n            const sortedClaims = [...educationClaims].sort((a, b) => \n                new Date(b.timestamp || b.date) - new Date(a.timestamp || a.date)\n            );\n            \n            container.innerHTML = sortedClaims.map((claim, index) => `\n                <div class=\"border border-gray-200 rounded-lg p-4 hover:bg-gray-50 transition duration-200\">\n                    <div class=\"flex justify-between items-start mb-2\">\n                        <div class=\"flex-1\">\n                            <div class=\"font-medium text-gray-800\">${claim.requesterName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                            <div class=\"text-sm text-gray-600\">\u0e1a\u0e38\u0e15\u0e23: ${claim.childName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                        <\/div>\n                        <div class=\"text-right flex items-start space-x-2\">\n                            <div>\n                                <div class=\"text-lg font-semibold text-purple-600\">${(parseFloat(claim.amount) || 0).toLocaleString()} \u0e1a\u0e32\u0e17<\/div>\n                                <span class=\"inline-block px-2 py-1 text-xs rounded-full ${claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23' ? 'bg-orange-100 text-orange-800' : 'bg-green-100 text-green-800'}\">${claim.status || '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23'}<\/span>\n                            <\/div>\n                            <div class=\"flex flex-col space-y-1\">\n                                ${claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23' ? `\n                                <button onclick=\"approveEducationClaim('${claim.firebaseKey || claim.id || index}')\" class=\"bg-green-500 hover:bg-green-600 text-white p-2 rounded-full text-sm transition duration-200\" title=\"\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e19\u0e35\u0e49\">\n                                    \u2705\n                                <\/button>\n                                ` : ''}\n                                <button onclick=\"deleteEducationClaim('${claim.firebaseKey || claim.id || index}')\" class=\"delete-btn bg-red-500 hover:bg-red-600 text-white p-2 rounded-full text-sm transition duration-200\" title=\"\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e19\u0e35\u0e49\">\n                                    \ud83d\uddd1\ufe0f\n                                <\/button>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n                    <div class=\"text-sm text-gray-600 mb-1\">\ud83c\udfeb ${claim.school || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                    <div class=\"text-sm text-gray-500\">\ud83d\udcda ${claim.level || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'} - ${claim.semester || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                    ${claim.note ? `<div class=\"text-sm text-gray-600 mt-2 bg-gray-50 p-2 rounded\">\ud83d\udcac ${claim.note}<\/div>` : ''}\n                <\/div>\n            `).join('');\n        }\n\n        \/\/ Render recent transactions\n        function renderRecentTransactions() {\n            const container = document.getElementById('recentTransactions');\n            const allClaims = [...medicalClaims, ...educationClaims]\n                .sort((a, b) => new Date(b.timestamp || b.date) - new Date(a.timestamp || a.date))\n                .slice(0, 5);\n            \n            if (allClaims.length === 0) {\n                container.innerHTML = '<div class=\"text-gray-500 text-center py-8\">\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e21\u0e35\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/div>';\n                return;\n            }\n            \n            container.innerHTML = allClaims.map(claim => {\n                const isMedical = medicalClaims.includes(claim);\n                return `\n                    <div class=\"flex items-center justify-between p-3 border border-gray-200 rounded-lg hover:bg-gray-50 transition duration-200\">\n                        <div class=\"flex items-center space-x-3\">\n                            <div class=\"text-2xl\">${isMedical ? '\ud83c\udfe5' : '\ud83c\udf93'}<\/div>\n                            <div>\n                                <div class=\"font-medium text-gray-800\">${claim.requesterName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/div>\n                                <div class=\"text-sm text-gray-500\">\n                                    ${new Date(claim.timestamp || claim.date).toLocaleDateString('th-TH')}\n                                <\/div>\n                            <\/div>\n                        <\/div>\n                        <div class=\"text-right\">\n                            <div class=\"font-semibold ${isMedical ? 'text-green-600' : 'text-purple-600'}\">\n                                ${(parseFloat(claim.amount) || 0).toLocaleString()} \u0e1a\u0e32\u0e17\n                            <\/div>\n                            <span class=\"inline-block px-2 py-1 text-xs rounded-full ${claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23' ? 'bg-orange-100 text-orange-800' : 'bg-green-100 text-green-800'}\">${claim.status || '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23'}<\/span>\n                        <\/div>\n                    <\/div>\n                `;\n            }).join('');\n        }\n\n        \/\/ Generate report\n        function generateReport() {\n            const selectedMonth = document.getElementById('reportMonth').value;\n            const selectedPerson = document.getElementById('reportPerson').value;\n            const container = document.getElementById('reportContent');\n            \n            let filteredMedical = [...medicalClaims];\n            let filteredEducation = [...educationClaims];\n            \n            \/\/ Filter by month\n            if (selectedMonth) {\n                filteredMedical = filteredMedical.filter(claim => {\n                    const claimDate = new Date(claim.timestamp || claim.date);\n                    return (claimDate.getMonth() + 1).toString().padStart(2, '0') === selectedMonth;\n                });\n                \n                filteredEducation = filteredEducation.filter(claim => {\n                    const claimDate = new Date(claim.timestamp || claim.date);\n                    return (claimDate.getMonth() + 1).toString().padStart(2, '0') === selectedMonth;\n                });\n            }\n            \n            \/\/ Filter by person\n            if (selectedPerson) {\n                filteredMedical = filteredMedical.filter(claim => \n                    claim.requesterName && claim.requesterName.trim() === selectedPerson\n                );\n                \n                filteredEducation = filteredEducation.filter(claim => \n                    claim.requesterName && claim.requesterName.trim() === selectedPerson\n                );\n            }\n            \n            const totalMedical = filteredMedical.reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n            const totalEducation = filteredEducation.reduce((sum, claim) => sum + (parseFloat(claim.amount) || 0), 0);\n            const grandTotal = totalMedical + totalEducation;\n            \n            \/\/ Create report title\n            let reportTitle = '\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e2a\u0e23\u0e38\u0e1b';\n            if (selectedPerson && selectedMonth) {\n                const monthNames = ['', '\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21', '\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c', '\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21', '\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19', '\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21', '\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19', \n                                  '\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21', '\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21', '\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19', '\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21', '\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19', '\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21'];\n                reportTitle = `\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e02\u0e2d\u0e07 ${selectedPerson} \u0e1b\u0e23\u0e30\u0e08\u0e33\u0e40\u0e14\u0e37\u0e2d\u0e19${monthNames[parseInt(selectedMonth)]}`;\n            } else if (selectedPerson) {\n                reportTitle = `\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e02\u0e2d\u0e07 ${selectedPerson}`;\n            } else if (selectedMonth) {\n                const monthNames = ['', '\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21', '\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c', '\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21', '\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19', '\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21', '\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19', \n                                  '\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21', '\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21', '\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19', '\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21', '\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19', '\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21'];\n                reportTitle = `\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19\u0e1b\u0e23\u0e30\u0e08\u0e33\u0e40\u0e14\u0e37\u0e2d\u0e19${monthNames[parseInt(selectedMonth)]}`;\n            }\n\n            container.innerHTML = `\n                <div class=\"mb-6\">\n                    <h4 class=\"text-xl font-bold text-gray-800 text-center\">${reportTitle}<\/h4>\n                    <p class=\"text-gray-600 text-center mt-2\">\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e21\u0e37\u0e48\u0e2d ${new Date().toLocaleDateString('th-TH', { \n                        year: 'numeric', month: 'long', day: 'numeric', \n                        hour: '2-digit', minute: '2-digit' \n                    })}<\/p>\n                <\/div>\n                \n                <div class=\"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6\">\n                    <div class=\"bg-green-50 p-4 rounded-lg border border-green-200\">\n                        <h4 class=\"font-semibold text-green-800\">\ud83c\udfe5 \u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25<\/h4>\n                        <p class=\"text-2xl font-bold text-green-600\">${totalMedical.toLocaleString()} \u0e1a\u0e32\u0e17<\/p>\n                        <p class=\"text-sm text-green-600\">${filteredMedical.length} \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/p>\n                    <\/div>\n                    <div class=\"bg-purple-50 p-4 rounded-lg border border-purple-200\">\n                        <h4 class=\"font-semibold text-purple-800\">\ud83c\udf93 \u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23<\/h4>\n                        <p class=\"text-2xl font-bold text-purple-600\">${totalEducation.toLocaleString()} \u0e1a\u0e32\u0e17<\/p>\n                        <p class=\"text-sm text-purple-600\">${filteredEducation.length} \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/p>\n                    <\/div>\n                    <div class=\"bg-blue-50 p-4 rounded-lg border border-blue-200\">\n                        <h4 class=\"font-semibold text-blue-800\">\ud83d\udcb0 \u0e23\u0e27\u0e21\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14<\/h4>\n                        <p class=\"text-2xl font-bold text-blue-600\">${grandTotal.toLocaleString()} \u0e1a\u0e32\u0e17<\/p>\n                        <p class=\"text-sm text-blue-600\">${filteredMedical.length + filteredEducation.length} \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/p>\n                    <\/div>\n                <\/div>\n                \n                <div class=\"space-y-6\">\n                    ${filteredMedical.length > 0 ? `\n                    <div>\n                        <h4 class=\"text-lg font-semibold text-gray-800 mb-3\">\ud83c\udfe5 \u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25<\/h4>\n                        <div class=\"overflow-x-auto\">\n                            <table class=\"w-full text-sm border border-gray-200 rounded-lg\">\n                                <thead class=\"bg-gray-50\">\n                                    <tr>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e1c\u0e39\u0e49\u0e02\u0e2d\u0e40\u0e1a\u0e34\u0e01<\/th>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e1c\u0e39\u0e49\u0e1b\u0e48\u0e27\u0e22<\/th>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e42\u0e23\u0e07\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25<\/th>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48<\/th>\n                                        <th class=\"px-4 py-3 text-right border-b\">\u0e08\u0e33\u0e19\u0e27\u0e19<\/th>\n                                        <th class=\"px-4 py-3 text-center border-b\">\u0e2a\u0e16\u0e32\u0e19\u0e30<\/th>\n                                    <\/tr>\n                                <\/thead>\n                                <tbody>\n                                    ${filteredMedical.map((claim, index) => `\n                                        <tr class=\"${index % 2 === 0 ? 'bg-white' : 'bg-gray-50'}\">\n                                            <td class=\"px-4 py-3 border-b\">${claim.requesterName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 border-b\">${claim.patientName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 border-b\">${claim.hospital || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 border-b\">${claim.date ? new Date(claim.date).toLocaleDateString('th-TH') : '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 text-right border-b font-semibold\">${(parseFloat(claim.amount) || 0).toLocaleString()}<\/td>\n                                            <td class=\"px-4 py-3 text-center border-b\">\n                                                <span class=\"px-2 py-1 text-xs rounded-full ${claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23' ? 'bg-orange-100 text-orange-800' : 'bg-green-100 text-green-800'}\">${claim.status || '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23'}<\/span>\n                                            <\/td>\n                                        <\/tr>\n                                    `).join('')}\n                                <\/tbody>\n                            <\/table>\n                        <\/div>\n                    <\/div>\n                    ` : ''}\n                    \n                    ${filteredEducation.length > 0 ? `\n                    <div>\n                        <h4 class=\"text-lg font-semibold text-gray-800 mb-3\">\ud83c\udf93 \u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23<\/h4>\n                        <div class=\"overflow-x-auto\">\n                            <table class=\"w-full text-sm border border-gray-200 rounded-lg\">\n                                <thead class=\"bg-gray-50\">\n                                    <tr>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e1c\u0e39\u0e49\u0e02\u0e2d\u0e40\u0e1a\u0e34\u0e01<\/th>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e0a\u0e37\u0e48\u0e2d\u0e1a\u0e38\u0e15\u0e23<\/th>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e2a\u0e16\u0e32\u0e19\u0e28\u0e36\u0e01\u0e29\u0e32<\/th>\n                                        <th class=\"px-4 py-3 text-left border-b\">\u0e23\u0e30\u0e14\u0e31\u0e1a<\/th>\n                                        <th class=\"px-4 py-3 text-right border-b\">\u0e08\u0e33\u0e19\u0e27\u0e19<\/th>\n                                        <th class=\"px-4 py-3 text-center border-b\">\u0e2a\u0e16\u0e32\u0e19\u0e30<\/th>\n                                    <\/tr>\n                                <\/thead>\n                                <tbody>\n                                    ${filteredEducation.map((claim, index) => `\n                                        <tr class=\"${index % 2 === 0 ? 'bg-white' : 'bg-gray-50'}\">\n                                            <td class=\"px-4 py-3 border-b\">${claim.requesterName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 border-b\">${claim.childName || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 border-b\">${claim.school || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 border-b\">${claim.level || '\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38'}<\/td>\n                                            <td class=\"px-4 py-3 text-right border-b font-semibold\">${(parseFloat(claim.amount) || 0).toLocaleString()}<\/td>\n                                            <td class=\"px-4 py-3 text-center border-b\">\n                                                <span class=\"px-2 py-1 text-xs rounded-full ${claim.status === '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23' ? 'bg-orange-100 text-orange-800' : 'bg-green-100 text-green-800'}\">${claim.status || '\u0e23\u0e2d\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23'}<\/span>\n                                            <\/td>\n                                        <\/tr>\n                                    `).join('')}\n                                <\/tbody>\n                            <\/table>\n                        <\/div>\n                    <\/div>\n                    ` : ''}\n                    \n                    ${filteredMedical.length === 0 && filteredEducation.length === 0 ? `\n                    <div class=\"text-center py-8 text-gray-500\">\n                        <div class=\"text-4xl mb-4\">\ud83d\udccb<\/div>\n                        <p>\u0e44\u0e21\u0e48\u0e1e\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e40\u0e07\u0e37\u0e48\u0e2d\u0e19\u0e44\u0e02\u0e17\u0e35\u0e48\u0e40\u0e25\u0e37\u0e2d\u0e01<\/p>\n                    <\/div>\n                    ` : ''}\n                <\/div>\n            `;\n        }\n\n        \/\/ Approve medical claim\n        async function approveMedicalClaim(claimId) {\n            Swal.fire({\n                title: '\u0e22\u0e37\u0e19\u0e22\u0e31\u0e19\u0e01\u0e32\u0e23\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34',\n                text: '\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\u0e19\u0e35\u0e49\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48?',\n                icon: 'question',\n                showCancelButton: true,\n                confirmButtonColor: '#10b981',\n                cancelButtonColor: '#6b7280',\n                confirmButtonText: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34',\n                cancelButtonText: '\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01'\n            }).then(async (result) => {\n                if (result.isConfirmed) {\n                    try {\n                        \/\/ Show loading\n                        Swal.fire({\n                            title: '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34...',\n                            allowOutsideClick: false,\n                            showConfirmButton: false,\n                            didOpen: () => {\n                                Swal.showLoading();\n                            }\n                        });\n                        \n                        \/\/ Find the claim\n                        const claim = medicalClaims.find(c => c.id === claimId || c.firebaseKey === claimId);\n                        \n                        if (claim && claim.firebaseKey) {\n                            \/\/ Update claim data\n                            const updatedClaim = {\n                                ...claim,\n                                status: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e41\u0e25\u0e49\u0e27',\n                                approvedDate: new Date().toISOString()\n                            };\n                            \n                            \/\/ Remove firebaseKey from the data to save\n                            const { firebaseKey, ...dataToSave } = updatedClaim;\n                            \n                            \/\/ Update in Firebase\n                            await updateFirebaseRecord('medical', claim.firebaseKey, dataToSave);\n                            \n                            Swal.fire({\n                                icon: 'success',\n                                title: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08! \u2705',\n                                text: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27',\n                                timer: 2000,\n                                showConfirmButton: false\n                            });\n                        } else {\n                            throw new Error('\u0e44\u0e21\u0e48\u0e1e\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34');\n                        }\n                        \n                    } catch (error) {\n                        console.error('Error approving claim:', error);\n                        Swal.fire({\n                            icon: 'error',\n                            title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14!',\n                            text: error.message || '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e44\u0e14\u0e49',\n                            confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                        });\n                    }\n                }\n            });\n        }\n\n        \/\/ Approve education claim\n        async function approveEducationClaim(claimId) {\n            Swal.fire({\n                title: '\u0e22\u0e37\u0e19\u0e22\u0e31\u0e19\u0e01\u0e32\u0e23\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34',\n                text: '\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\u0e19\u0e35\u0e49\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48?',\n                icon: 'question',\n                showCancelButton: true,\n                confirmButtonColor: '#10b981',\n                cancelButtonColor: '#6b7280',\n                confirmButtonText: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34',\n                cancelButtonText: '\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01'\n            }).then(async (result) => {\n                if (result.isConfirmed) {\n                    try {\n                        \/\/ Show loading\n                        Swal.fire({\n                            title: '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34...',\n                            allowOutsideClick: false,\n                            showConfirmButton: false,\n                            didOpen: () => {\n                                Swal.showLoading();\n                            }\n                        });\n                        \n                        \/\/ Find the claim\n                        const claim = educationClaims.find(c => c.id === claimId || c.firebaseKey === claimId);\n                        \n                        if (claim && claim.firebaseKey) {\n                            \/\/ Update claim data\n                            const updatedClaim = {\n                                ...claim,\n                                status: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e41\u0e25\u0e49\u0e27',\n                                approvedDate: new Date().toISOString()\n                            };\n                            \n                            \/\/ Remove firebaseKey from the data to save\n                            const { firebaseKey, ...dataToSave } = updatedClaim;\n                            \n                            \/\/ Update in Firebase\n                            await updateFirebaseRecord('education', claim.firebaseKey, dataToSave);\n                            \n                            Swal.fire({\n                                icon: 'success',\n                                title: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08! \u2705',\n                                text: '\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27',\n                                timer: 2000,\n                                showConfirmButton: false\n                            });\n                        } else {\n                            throw new Error('\u0e44\u0e21\u0e48\u0e1e\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34');\n                        }\n                        \n                    } catch (error) {\n                        console.error('Error approving claim:', error);\n                        Swal.fire({\n                            icon: 'error',\n                            title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14!',\n                            text: error.message || '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e2d\u0e19\u0e38\u0e21\u0e31\u0e15\u0e34\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e44\u0e14\u0e49',\n                            confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                        });\n                    }\n                }\n            });\n        }\n\n        \/\/ Delete medical claim\n        async function deleteMedicalClaim(claimId) {\n            Swal.fire({\n                title: '\u0e22\u0e37\u0e19\u0e22\u0e31\u0e19\u0e01\u0e32\u0e23\u0e25\u0e1a',\n                text: '\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\u0e19\u0e35\u0e49\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48?',\n                icon: 'warning',\n                showCancelButton: true,\n                confirmButtonColor: '#dc2626',\n                cancelButtonColor: '#6b7280',\n                confirmButtonText: '\u0e25\u0e1a',\n                cancelButtonText: '\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01'\n            }).then(async (result) => {\n                if (result.isConfirmed) {\n                    try {\n                        \/\/ Show loading\n                        Swal.fire({\n                            title: '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25...',\n                            allowOutsideClick: false,\n                            showConfirmButton: false,\n                            didOpen: () => {\n                                Swal.showLoading();\n                            }\n                        });\n                        \n                        \/\/ Find the claim\n                        const claim = medicalClaims.find(c => c.id === claimId || c.firebaseKey === claimId);\n                        \n                        if (claim && claim.firebaseKey) {\n                            \/\/ Delete from Firebase\n                            await deleteFromFirebase('medical', claim.firebaseKey);\n                            \n                            Swal.fire({\n                                icon: 'success',\n                                title: '\u0e25\u0e1a\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08!',\n                                text: '\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e23\u0e31\u0e01\u0e29\u0e32\u0e1e\u0e22\u0e32\u0e1a\u0e32\u0e25\u0e08\u0e32\u0e01 Firebase \u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27',\n                                timer: 2000,\n                                showConfirmButton: false\n                            });\n                        } else {\n                            throw new Error('\u0e44\u0e21\u0e48\u0e1e\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e25\u0e1a');\n                        }\n                        \n                    } catch (error) {\n                        console.error('Error deleting claim:', error);\n                        Swal.fire({\n                            icon: 'error',\n                            title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14!',\n                            text: error.message || '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e44\u0e14\u0e49',\n                            confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                        });\n                    }\n                }\n            });\n        }\n\n        \/\/ Delete education claim\n        async function deleteEducationClaim(claimId) {\n            Swal.fire({\n                title: '\u0e22\u0e37\u0e19\u0e22\u0e31\u0e19\u0e01\u0e32\u0e23\u0e25\u0e1a',\n                text: '\u0e04\u0e38\u0e13\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\u0e19\u0e35\u0e49\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48?',\n                icon: 'warning',\n                showCancelButton: true,\n                confirmButtonColor: '#dc2626',\n                cancelButtonColor: '#6b7280',\n                confirmButtonText: '\u0e25\u0e1a',\n                cancelButtonText: '\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01'\n            }).then(async (result) => {\n                if (result.isConfirmed) {\n                    try {\n                        \/\/ Show loading\n                        Swal.fire({\n                            title: '\u0e01\u0e33\u0e25\u0e31\u0e07\u0e25\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25...',\n                            allowOutsideClick: false,\n                            showConfirmButton: false,\n                            didOpen: () => {\n                                Swal.showLoading();\n                            }\n                        });\n                        \n                        \/\/ Find the claim\n                        const claim = educationClaims.find(c => c.id === claimId || c.firebaseKey === claimId);\n                        \n                        if (claim && claim.firebaseKey) {\n                            \/\/ Delete from Firebase\n                            await deleteFromFirebase('education', claim.firebaseKey);\n                            \n                            Swal.fire({\n                                icon: 'success',\n                                title: '\u0e25\u0e1a\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08!',\n                                text: '\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e04\u0e48\u0e32\u0e40\u0e25\u0e48\u0e32\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1a\u0e38\u0e15\u0e23\u0e08\u0e32\u0e01 Firebase \u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e25\u0e49\u0e27',\n                                timer: 2000,\n                                showConfirmButton: false\n                            });\n                        } else {\n                            throw new Error('\u0e44\u0e21\u0e48\u0e1e\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e25\u0e1a');\n                        }\n                        \n                    } catch (error) {\n                        console.error('Error deleting claim:', error);\n                        Swal.fire({\n                            icon: 'error',\n                            title: '\u0e40\u0e01\u0e34\u0e14\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14!',\n                            text: error.message || '\u0e44\u0e21\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e25\u0e1a\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e44\u0e14\u0e49',\n                            confirmButtonText: '\u0e15\u0e01\u0e25\u0e07'\n                        });\n                    }\n                }\n            });\n        }\n\n        \/\/ Show error message\n        function showErrorMessage(message) {\n            const containers = ['recentTransactions', 'medicalList', 'educationList'];\n            containers.forEach(containerId => {\n                const container = document.getElementById(containerId);\n                if (container) {\n                    container.innerHTML = `<div class=\"text-red-500 text-center py-8\">\u274c ${message}<\/div>`;\n                }\n            });\n        }\n    <\/script>\n<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML=\"window.__CF$cv$params={r:'9858a98ea5f4731d',t:'MTc1ODk1MTU4NS4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='\/cdn-cgi\/challenge-platform\/scripts\/jsd\/main.js';document.getElementsByTagName('head')[0].appendChild(a);\";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();<\/script><\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>\u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e34\u0e01\u0e32\u0e23\u0e1a\u0e38\u0e04\u0e25\u0e32\u0e01\u0e23 \ud83d\udd10 \u0e40\u0e02\u0e49\u0e32\u0e2a\u0e39\u0e48\u0e23\u0e30\u0e1a\u0e1a \u0e23\u0e30\u0e1a\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e2a\u0e27\u0e31\u0e2a [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/landing.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-22451","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/pages\/22451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/comments?post=22451"}],"version-history":[{"count":3,"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/pages\/22451\/revisions"}],"predecessor-version":[{"id":22460,"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/pages\/22451\/revisions\/22460"}],"wp:attachment":[{"href":"https:\/\/bba.rmutsv.ac.th\/ruts\/wp-json\/wp\/v2\/media?parent=22451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}