{"id":28,"date":"2026-04-13T23:26:20","date_gmt":"2026-04-13T23:26:20","guid":{"rendered":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/?page_id=28"},"modified":"2026-04-14T07:25:14","modified_gmt":"2026-04-14T07:25:14","slug":"thong-tin-dang-ky","status":"publish","type":"page","link":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/","title":{"rendered":""},"content":{"rendered":"\n<style>\n\/* ===== NOTIFICATION MODAL ===== *\/\n#noti-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 99999; align-items: center; justify-content: center; padding: 20px; }\n#noti-overlay.active { display: flex; }\n#noti-box { background: #fff; border-radius: 18px; padding: 36px 32px 28px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.25); animation: notiPop 0.3s cubic-bezier(.34,1.56,.64,1) both; }\n@keyframes notiPop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }\n.noti-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 18px; }\n.noti-icon.success { background: #e8f5e9; } .noti-icon.error { background: #fdecea; } .noti-icon.warning { background: #fff8e1; }\n#noti-title { font-size: 20px; font-weight: 700; color: #1a1a1a; margin-bottom: 10px; }\n#noti-message { font-size: 15px; color: #555; line-height: 1.6; margin-bottom: 24px; }\n#noti-btn { display: block; width: 100%; padding: 12px; border-radius: 50px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; color: #fff; transition: opacity 0.2s; }\n#noti-btn:hover { opacity: 0.88; }\n#noti-btn.success { background: #2e7d32; } #noti-btn.error { background: #c62828; } #noti-btn.warning { background: #f57f17; }\n\n\/* ===== TOGGLE SWITCH ===== *\/\n.toggle-group { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 6px; }\n.toggle-row { display: flex; align-items: center; justify-content: space-between; border: 2px solid #d5d5d5; border-radius: 50px; padding: 0 16px 0 22px; height: 52px; cursor: pointer; transition: border-color 0.2s, background 0.2s; background: #fff; user-select: none; box-sizing: border-box; }\n.toggle-row:hover:not(.toggle-disabled) { border-color: #999; }\n.toggle-row.toggle-checked { border-color: #e53935; background: #fff5f5; }\n.toggle-row.toggle-disabled { opacity: 0.45; cursor: not-allowed; background: #f2f2f2; }\n.toggle-label-text { font-size: 15px; font-weight: 500; color: #222; flex: 1; line-height: 1.3; pointer-events: none; }\n.toggle-sub { font-size: 11px; color: #888; font-weight: 400; display: block; margin-top: 2px; }\n.toggle-switch { position: relative; width: 52px; height: 28px; flex-shrink: 0; margin-left: 14px; pointer-events: none; }\n.toggle-switch input[type=\"radio\"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }\n.toggle-track { position: absolute; inset: 0; border-radius: 28px; background: #ccc; transition: background 0.28s; }\n.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.28); transition: transform 0.28s; }\n.toggle-row.toggle-checked .toggle-track { background: #e53935; }\n.toggle-row.toggle-checked .toggle-thumb { transform: translateX(24px); }\n#ca-hoc-section { display: none; }\n<\/style>\n\n<div id=\"noti-overlay\">\n    <div id=\"noti-box\">\n        <div class=\"noti-icon\" id=\"noti-icon\"><\/div>\n        <div id=\"noti-title\"><\/div>\n        <div id=\"noti-message\"><\/div>\n        <button id=\"noti-btn\" onclick=\"closeNoti()\">OK<\/button>\n    <\/div>\n<\/div>\n\n<script>\nconst NOTI_CFG = { success: { icon: '\u2705', label: 'success' }, error: { icon: '\u274c', label: 'error' }, warning: { icon: '\u26a0\ufe0f', label: 'warning' } };\nfunction showNoti(type, title, msg, onClose) {\n    const cfg = NOTI_CFG[type] || NOTI_CFG.error;\n    document.getElementById('noti-icon').innerHTML    = cfg.icon;\n    document.getElementById('noti-icon').className    = 'noti-icon ' + cfg.label;\n    document.getElementById('noti-title').textContent = title;\n    document.getElementById('noti-message').innerHTML = msg;\n    document.getElementById('noti-btn').className     = cfg.label;\n    document.getElementById('noti-overlay').classList.add('active');\n    window._notiOnClose = onClose || null;\n}\nfunction closeNoti() {\n    document.getElementById('noti-overlay').classList.remove('active');\n    if (window._notiOnClose) { window._notiOnClose(); window._notiOnClose = null; }\n}\ndocument.getElementById('noti-overlay').addEventListener('click', function(e) { if (e.target === this) closeNoti(); });\n<\/script>\n\n<form id=\"form-dangky\" class=\"form-don\" novalidate>\n<input type=\"hidden\" id=\"dangky_nonce\" name=\"dangky_nonce\" value=\"8c0ef4f90d\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/thongtindangky\/wp-json\/wp\/v2\/pages\/28\" \/><input type=\"hidden\" name=\"form_timestamp\" value=\"1781383017\">\n\n<h2 style=\"text-align:center; color:#064A02; font-size:28px; font-weight:bold; text-transform:uppercase;\">\n    \u0110\u01a0N XIN H\u1eccC H\u00c8\n<\/h2>\n<label style=\"text-align:center; color:#064A02; font-size:14px; font-weight:bold; text-transform:uppercase; display:block; margin-bottom:16px;\">\n    T\u1ea0I NH\u00c0 B\u00c1C \u00c1I \u2013 D\u00d2NG M\u1eb8 CH\u00daA C\u1ee8U CHU\u1ed8C<br>\n    D\u1ef1 ki\u1ebfn Khai gi\u1ea3ng: Th\u1ee9 Hai, ng\u00e0y 29\/06\/2026\n<\/label>\n\n<label>1: H\u1ecd t\u00ean h\u1ecdc sinh*<\/label>\n<input type=\"text\" name=\"ten_hs\" required>\n<div class=\"error-msg\" id=\"error-ten_hs\"><\/div>\n\n<label>2: Ng\u00e0y sinh*<\/label>\n<input type=\"date\" name=\"ngay_sinh\" required>\n<div class=\"error-msg\" id=\"error-ngay_sinh\"><\/div>\n\n<div id=\"da-hoc-box\">\n    <label>3: \u0110\u00e3 h\u1ecdc t\u1ea1i Nh\u00e0 B\u00e1c \u00c1i*<\/label>\n    <div class=\"toggle-group\" id=\"toggle-da-hoc\">\n                <div class=\"toggle-row\" data-group=\"da_hoc\" data-value=\"L\u1edbp 6\">\n            <span class=\"toggle-label-text\">L\u1edbp 6<\/span>\n            <span class=\"toggle-switch\">\n                <input type=\"radio\" name=\"da_hoc\" id=\"da_hoc_0\" value=\"L\u1edbp 6\">\n                <span class=\"toggle-track\"><\/span>\n                <span class=\"toggle-thumb\"><\/span>\n            <\/span>\n        <\/div>\n                <div class=\"toggle-row\" data-group=\"da_hoc\" data-value=\"L\u1edbp 7\">\n            <span class=\"toggle-label-text\">L\u1edbp 7<\/span>\n            <span class=\"toggle-switch\">\n                <input type=\"radio\" name=\"da_hoc\" id=\"da_hoc_1\" value=\"L\u1edbp 7\">\n                <span class=\"toggle-track\"><\/span>\n                <span class=\"toggle-thumb\"><\/span>\n            <\/span>\n        <\/div>\n                <div class=\"toggle-row\" data-group=\"da_hoc\" data-value=\"L\u1edbp 8\">\n            <span class=\"toggle-label-text\">L\u1edbp 8<\/span>\n            <span class=\"toggle-switch\">\n                <input type=\"radio\" name=\"da_hoc\" id=\"da_hoc_2\" value=\"L\u1edbp 8\">\n                <span class=\"toggle-track\"><\/span>\n                <span class=\"toggle-thumb\"><\/span>\n            <\/span>\n        <\/div>\n            <\/div>\n    <div class=\"error-msg\" id=\"error-da_hoc\"><\/div>\n<\/div>\n\n<label>4: Th\u00e1ng 9\/2026 s\u1ebd v\u00e0o h\u1ecdc L\u1edbp*<\/label>\n<div class=\"toggle-group\" id=\"toggle-lop\">\n    <div class=\"toggle-row\"\n         data-group=\"lop\" data-value=\"L\u1edbp 6\"\n         id=\"toggle-lop-L\u1edbp-6\">\n        <span class=\"toggle-label-text\">\n            L\u1edbp 6                            <span class=\"toggle-sub\">C\u00f2n 3 ch\u1ed7<\/span>\n                    <\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"lop\" id=\"lop_0\" value=\"L\u1edbp 6\"\n                 required>\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n    <div class=\"toggle-row\"\n         data-group=\"lop\" data-value=\"L\u1edbp 6.3\"\n         id=\"toggle-lop-L\u1edbp-6_3\">\n        <span class=\"toggle-label-text\">\n            L\u1edbp 6.3                            <span class=\"toggle-sub\">C\u00f2n 15 ch\u1ed7<\/span>\n                    <\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"lop\" id=\"lop_1\" value=\"L\u1edbp 6.3\"\n                 required>\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n    <div class=\"toggle-row\"\n         data-group=\"lop\" data-value=\"L\u1edbp 7\"\n         id=\"toggle-lop-L\u1edbp-7\">\n        <span class=\"toggle-label-text\">\n            L\u1edbp 7                            <span class=\"toggle-sub\">C\u00f2n 6 ch\u1ed7<\/span>\n                    <\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"lop\" id=\"lop_2\" value=\"L\u1edbp 7\"\n                 required>\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n    <div class=\"toggle-row\"\n         data-group=\"lop\" data-value=\"L\u1edbp 7.3\"\n         id=\"toggle-lop-L\u1edbp-7_3\">\n        <span class=\"toggle-label-text\">\n            L\u1edbp 7.3                            <span class=\"toggle-sub\">C\u00f2n 15 ch\u1ed7<\/span>\n                    <\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"lop\" id=\"lop_3\" value=\"L\u1edbp 7.3\"\n                 required>\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n    <div class=\"toggle-row\"\n         data-group=\"lop\" data-value=\"L\u1edbp 8\"\n         id=\"toggle-lop-L\u1edbp-8\">\n        <span class=\"toggle-label-text\">\n            L\u1edbp 8                            <span class=\"toggle-sub\">C\u00f2n 15 ch\u1ed7<\/span>\n                    <\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"lop\" id=\"lop_4\" value=\"L\u1edbp 8\"\n                 required>\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n    <div class=\"toggle-row\"\n         data-group=\"lop\" data-value=\"L\u1edbp 9\"\n         id=\"toggle-lop-L\u1edbp-9\">\n        <span class=\"toggle-label-text\">\n            L\u1edbp 9                            <span class=\"toggle-sub\">C\u00f2n 13 ch\u1ed7<\/span>\n                    <\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"lop\" id=\"lop_5\" value=\"L\u1edbp 9\"\n                 required>\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n<\/div>\n<div class=\"error-msg\" id=\"error-lop\"><\/div>\n\n<div id=\"ca-hoc-section\">\n    <label>5: \u0110\u0103ng k\u00fd ca h\u1ecdc*<\/label>\n    <div class=\"toggle-group\" id=\"toggle-ca-hoc\">\n        <div class=\"toggle-row\" id=\"row-sang\" data-group=\"ca_hoc\" data-value=\"S\u00e1ng\">\n            <span class=\"toggle-label-text\">\n                \u2600\ufe0f Ca S\u00e1ng\n                <span class=\"toggle-sub\" id=\"slot-sang\" style=\"font-size:12px;\"><\/span>\n            <\/span>\n            <span class=\"toggle-switch\">\n                <input type=\"radio\" name=\"ca_hoc\" id=\"real-sang\" value=\"S\u00e1ng\">\n                <span class=\"toggle-track\"><\/span>\n                <span class=\"toggle-thumb\"><\/span>\n            <\/span>\n        <\/div>\n\n        <div class=\"toggle-row\" id=\"row-chieu\" data-group=\"ca_hoc\" data-value=\"Chi\u1ec1u\">\n            <span class=\"toggle-label-text\">\n                \ud83c\udf24 Ca Chi\u1ec1u\n                <span class=\"toggle-sub\" id=\"slot-chieu\" style=\"font-size:12px;\"><\/span>\n            <\/span>\n            <span class=\"toggle-switch\">\n                <input type=\"radio\" name=\"ca_hoc\" id=\"real-chieu\" value=\"Chi\u1ec1u\">\n                <span class=\"toggle-track\"><\/span>\n                <span class=\"toggle-thumb\"><\/span>\n            <\/span>\n        <\/div>\n    <\/div>\n    <div class=\"error-msg\" id=\"error-ca_hoc\"><\/div>\n<\/div>\n\n<label>6: Hi\u1ec7n t\u1ea1i \u0111ang h\u1ecdc Tr\u01b0\u1eddng*<\/label>\n<input type=\"text\" name=\"truong\">\n<div class=\"error-msg\" id=\"error-truong\"><\/div>\n\n<label>7: T\u00f4n gi\u00e1o*<\/label>\n<div class=\"toggle-group\" id=\"toggle-ton-giao\">\n        <div class=\"toggle-row\" data-group=\"ton_giao\" data-value=\"C\u00f4ng gi\u00e1o\">\n        <span class=\"toggle-label-text\">C\u00f4ng gi\u00e1o<\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"ton_giao\" id=\"ton_giao_0\" value=\"C\u00f4ng gi\u00e1o\">\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n        <div class=\"toggle-row\" data-group=\"ton_giao\" data-value=\"Ph\u1eadt gi\u00e1o\">\n        <span class=\"toggle-label-text\">Ph\u1eadt gi\u00e1o<\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"ton_giao\" id=\"ton_giao_1\" value=\"Ph\u1eadt gi\u00e1o\">\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n        <div class=\"toggle-row\" data-group=\"ton_giao\" data-value=\"Tin l\u00e0nh\">\n        <span class=\"toggle-label-text\">Tin l\u00e0nh<\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"ton_giao\" id=\"ton_giao_2\" value=\"Tin l\u00e0nh\">\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n        <div class=\"toggle-row\" data-group=\"ton_giao\" data-value=\"Kh\u00f4ng\">\n        <span class=\"toggle-label-text\">Kh\u00f4ng<\/span>\n        <span class=\"toggle-switch\">\n            <input type=\"radio\" name=\"ton_giao\" id=\"ton_giao_3\" value=\"Kh\u00f4ng\">\n            <span class=\"toggle-track\"><\/span>\n            <span class=\"toggle-thumb\"><\/span>\n        <\/span>\n    <\/div>\n    <\/div>\n<div class=\"error-msg\" id=\"error-ton_giao\"><\/div>\n\n<label>8: \u1ea2nh h\u1ed3 s\u01a1 (c\u00f3 th\u1ec3 ch\u1ee5p h\u00ecnh b\u1eb1ng \u0111i\u1ec7n tho\u1ea1i)*<\/label>\n<input type=\"file\" name=\"anh_ho_so\" accept=\"image\/jpeg,image\/png\" required>\n<div class=\"error-msg\" id=\"error-anh_ho_so\"><\/div>\n<div style=\"display:flex; align-items:center; gap:15px; margin-top:10px;\">\n    <div id=\"preview-box\" style=\"display:none;\">\n        <img id=\"preview-img\" style=\"width:120px; border-radius:6px;\">\n    <\/div>\n    <p id=\"img-error\" style=\"color:red; font-weight:bold;\"><\/p>\n<\/div>\n\n<hr>\n\n<label>9: H\u1ecd t\u00ean Cha*<\/label>\n<input type=\"text\" name=\"ten_cha\">\n<div class=\"error-msg\" id=\"error-ten_cha\"><\/div>\n\n<label>10: H\u1ecd t\u00ean M\u1eb9*<\/label>\n<input type=\"text\" name=\"ten_me\">\n<div class=\"error-msg\" id=\"error-ten_me\"><\/div>\n\n<label>11: \u0110\u1ecba ch\u1ec9*<\/label>\n<input type=\"text\" name=\"dia_chi\">\n<div class=\"error-msg\" id=\"error-dia_chi\"><\/div>\n\n<label>12: S\u0110T ph\u1ee5 huynh*<\/label>\n<input type=\"text\" name=\"sdt\" required>\n<div class=\"error-msg\" id=\"error-sdt\"><\/div>\n<p>(Sau khi \u0111\u0103ng k\u00fd th\u00e0nh c\u00f4ng v\u00e0 \u0111\u01b0\u1ee3c s\u1eafp L\u1edbp, Ph\u1ee5 huynh HS s\u1ebd \u0111\u01b0\u1ee3c th\u00eam v\u00e0o nh\u00f3m Zalo c\u1ee7a L\u1edbp \u0111\u1ec3 nh\u1eadn th\u00f4ng b\u00e1o, b\u1eb1ng S\u0110T n\u00e0y)<\/p>\n\n<label>13: \u00dd ki\u1ebfn<\/label>\n<textarea name=\"ykien\"><\/textarea>\n\n<br>\n<input type=\"submit\" id=\"btn-submit-dangky\" value=\"G\u1eedi \u0111\u0103ng k\u00fd\">\n<\/form>\n\n<script>\nlet dataSiSo     = {\"L\\u1edbp 6\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":22,\"tong\":47},\"L\\u1edbp 6.3\":{\"S\\u00e1ng\":0,\"Chi\\u1ec1u\":0,\"tong\":0},\"L\\u1edbp 7\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":19,\"tong\":44},\"L\\u1edbp 7.3\":{\"S\\u00e1ng\":0,\"Chi\\u1ec1u\":0,\"tong\":0},\"L\\u1edbp 8\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":10,\"tong\":35},\"L\\u1edbp 9\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":12,\"tong\":37}};\nconst limitsConfig = {\"L\\u1edbp 6\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":25,\"tong\":50},\"L\\u1edbp 6.3\":{\"S\\u00e1ng\":15,\"Chi\\u1ec1u\":0,\"tong\":15},\"L\\u1edbp 7\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":25,\"tong\":50},\"L\\u1edbp 7.3\":{\"S\\u00e1ng\":0,\"Chi\\u1ec1u\":15,\"tong\":15},\"L\\u1edbp 8\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":25,\"tong\":50},\"L\\u1edbp 9\":{\"S\\u00e1ng\":25,\"Chi\\u1ec1u\":25,\"tong\":50}};\nconst ajaxUrl    = 'https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-admin\/admin-ajax.php';\n\nfunction refreshSiSo(callback) {\n    fetch(ajaxUrl + '?action=get_siso&_=' + Date.now())\n        .then(res => res.json())\n        .then(json => {\n            if (json.success) {\n                dataSiSo = json.data;\n                const lop = getSelectedLop();\n                if (lop) capNhatCaHoc(lop, false);\n                capNhatLabelLop();\n                if (callback) callback();\n            }\n        }).catch(() => {});\n}\n\nfunction fetchFreshNonce() {\n    return fetch(ajaxUrl + '?action=get_fresh_nonce&_=' + Date.now())\n        .then(res => res.json())\n        .then(json => {\n            if (json.success && json.data && json.data.nonce) {\n                const nonceInput = document.querySelector('input[name=\"dangky_nonce\"]');\n                if (nonceInput) nonceInput.value = json.data.nonce;\n                const tsInput = document.querySelector('input[name=\"form_timestamp\"]');\n                if (tsInput) tsInput.value = Math.floor(Date.now() \/ 1000);\n                return json.data.nonce;\n            }\n            return null;\n        }).catch(() => null);\n}\n\nfunction submitForm(fd) {\n    return fetch(ajaxUrl, { method: 'POST', body: fd, credentials: 'same-origin' }).then(res => res.json());\n}\n\ndocument.querySelectorAll('.toggle-row').forEach(function(row) {\n    row.addEventListener('click', function() {\n        if (row.classList.contains('toggle-disabled')) return;\n        const group = row.dataset.group;\n        const radio = row.querySelector('input[type=\"radio\"]');\n        if (!radio || radio.disabled) return;\n        const wasChecked = radio.checked;\n\n        document.querySelectorAll('.toggle-row[data-group=\"' + group + '\"]').forEach(function(r) {\n            r.querySelector('input[type=\"radio\"]').checked = false;\n            r.classList.remove('toggle-checked');\n        });\n        if (!wasChecked) {\n            radio.checked = true;\n            row.classList.add('toggle-checked');\n        }\n        const errEl = document.getElementById('error-' + group);\n        if (errEl) errEl.innerHTML = '';\n        radio.dispatchEvent(new Event('change', { bubbles: true }));\n    });\n});\n\nfunction capNhatLabelLop() {\n    document.querySelectorAll('input[name=\"lop\"]').forEach(radio => {\n        const l   = radio.value;\n        const row = radio.closest('.toggle-row');\n        const sub = row ? row.querySelector('.toggle-sub') : null;\n        if (!row) return;\n\n        const limitLop = limitsConfig[l]['tong'];\n        const tong   = dataSiSo[l] ? dataSiSo[l]['tong'] : 0;\n        const conCho = limitLop - tong;\n        const isFull = tong >= limitLop;\n\n        if (isFull) {\n            radio.dataset.locked = '1';\n            if (sub) { sub.textContent = '\u0110\u00e3 \u0111\u1ee7 ' + limitLop + ' em \u2013 Kh\u00f3a \u0111\u0103ng k\u00fd'; sub.style.color = '#c0392b'; }\n            radio.disabled = true;\n            row.classList.add('toggle-disabled');\n            if (radio.checked) {\n                radio.checked = false;\n                row.classList.remove('toggle-checked');\n                capNhatCaHoc(null);\n            }\n        } else {\n            delete radio.dataset.locked;\n            if (sub) { sub.textContent = 'C\u00f2n ' + conCho + ' ch\u1ed7'; sub.style.color = ''; }\n        }\n    });\n    applyLopLock();\n}\n\nsetInterval(refreshSiSo, 30000);\ndocument.addEventListener('visibilitychange', function() { if (document.visibilityState === 'visible') refreshSiSo(); });\nwindow.addEventListener('focus', refreshSiSo);\n\nfunction getSelectedLop() {\n    const checked = document.querySelector('input[name=\"lop\"]:checked');\n    return checked ? checked.value : null;\n}\n\nfunction capNhatCaHoc(lop, resetCaHoc) {\n    const section = document.getElementById('ca-hoc-section');\n    if (!lop) { section.style.display = 'none'; return; }\n    section.style.display = 'block';\n\n    if (resetCaHoc) {\n        document.getElementById('real-sang').checked  = false;\n        document.getElementById('real-chieu').checked = false;\n        document.getElementById('row-sang').classList.remove('toggle-checked');\n        document.getElementById('row-chieu').classList.remove('toggle-checked');\n    }\n\n    const lopLimits = limitsConfig[lop];\n\n    ['S\u00e1ng', 'Chi\u1ec1u'].forEach(ca => {\n        const isSang = (ca === 'S\u00e1ng');\n        const radio  = document.getElementById(isSang ? 'real-sang'  : 'real-chieu');\n        const row    = document.getElementById(isSang ? 'row-sang'   : 'row-chieu');\n        const slot   = document.getElementById(isSang ? 'slot-sang'  : 'slot-chieu');\n        const limitCa= lopLimits[ca];\n\n        if (limitCa === 0) {\n            row.style.display = 'none';\n            radio.disabled = true;\n            if (radio.checked) {\n                radio.checked = false;\n                row.classList.remove('toggle-checked');\n            }\n            return;\n        } else {\n            row.style.display = 'flex';\n        }\n\n        const count  = dataSiSo[lop] ? dataSiSo[lop][ca] : 0;\n        const con    = limitCa - count;\n        const full   = (count >= limitCa);\n\n        if (full) {\n            slot.innerHTML   = '\u274c \u0110\u00e3 \u0111\u1ee7 ' + limitCa + ' em \u2013 Kh\u00f3a';\n            slot.style.color = '#c0392b';\n            radio.disabled   = true;\n            row.classList.add('toggle-disabled');\n            if (radio.checked) {\n                radio.checked = false;\n                row.classList.remove('toggle-checked');\n            }\n        } else {\n            slot.innerHTML   = '\u2705 C\u00f2n ' + con + ' ch\u1ed7';\n            slot.style.color = '#0a7c2f';\n            radio.disabled   = false;\n            row.classList.remove('toggle-disabled');\n        }\n    });\n}\n\nconst lopOrder   = { 'L\u1edbp 6': 6, 'L\u1edbp 6.3': 6.3, 'L\u1edbp 7': 7, 'L\u1edbp 7.3': 7.3, 'L\u1edbp 8': 8, 'L\u1edbp 9': 9 };\nconst lopToDaHoc = { 'L\u1edbp 7': 'L\u1edbp 6', 'L\u1edbp 7.3': 'L\u1edbp 6', 'L\u1edbp 8': 'L\u1edbp 7', 'L\u1edbp 9': 'L\u1edbp 8' };\nconst daHocBox   = document.getElementById('da-hoc-box');\n\nfunction applyLopLock() {\n    const daHocChecked = document.querySelector('input[name=\"da_hoc\"]:checked');\n    const daHocNum     = daHocChecked ? lopOrder[daHocChecked.value] : 0;\n\n    document.querySelectorAll('input[name=\"lop\"]').forEach(lopEl => {\n        const lopNum = lopOrder[lopEl.value];\n        const row    = lopEl.closest('.toggle-row');\n        if (!row) return;\n\n        const isServerFull = !!lopEl.dataset.locked;\n        const isDaHocLock  = daHocNum > 0 && lopNum <= daHocNum;\n\n        if (isServerFull || isDaHocLock) {\n            lopEl.disabled = true;\n            if (isDaHocLock) {\n                lopEl.checked = false;\n                row.classList.remove('toggle-checked');\n            }\n            row.classList.add('toggle-disabled');\n        } else {\n            lopEl.disabled = false;\n            row.classList.remove('toggle-disabled');\n        }\n    });\n}\n\nfunction toggleDaHoc() {\n    const lop = getSelectedLop();\n    if (lop === 'L\u1edbp 6' || lop === 'L\u1edbp 6.3') {\n        daHocBox.style.display = 'none';\n        document.querySelectorAll('input[name=\"da_hoc\"]').forEach(el => {\n            el.checked = false;\n            el.closest('.toggle-row')?.classList.remove('toggle-checked');\n        });\n    } else {\n        daHocBox.style.display = 'block';\n    }\n    applyLopLock();\n}\n\ndocument.querySelectorAll('input[name=\"lop\"]').forEach(el => {\n    el.addEventListener('change', function() {\n        capNhatCaHoc(this.value, true);\n        toggleDaHoc();\n\n        const daHocVal = lopToDaHoc[this.value];\n        if (daHocVal) {\n            document.querySelectorAll('input[name=\"da_hoc\"]').forEach(dh => {\n                const row = dh.closest('.toggle-row');\n                if (dh.value === daHocVal) {\n                    dh.checked = true;\n                    row?.classList.add('toggle-checked');\n                } else {\n                    dh.checked = false;\n                    row?.classList.remove('toggle-checked');\n                }\n            });\n        }\n        applyLopLock();\n    });\n});\n\ndocument.querySelectorAll('input[name=\"da_hoc\"]').forEach(el => { el.addEventListener('change', applyLopLock); });\ndocument.querySelectorAll('.toggle-row[data-group=\"da_hoc\"]').forEach(function(row) {\n    row.addEventListener('click', function() { setTimeout(applyLopLock, 0); });\n});\n\nconst inputFile = document.querySelector('input[name=\"anh_ho_so\"]');\ninputFile.addEventListener('change', function(e) {\n    const file = e.target.files[0];\n    const preview = document.getElementById('preview-img');\n    const box     = document.getElementById('preview-box');\n    document.getElementById('img-error').innerHTML = '';\n    if (!file) return;\n    const img = new Image(), reader = new FileReader();\n    reader.onload = ev => { img.src = ev.target.result; };\n    img.onload = function() {\n        const canvas = document.createElement('canvas');\n        const ctx = canvas.getContext('2d');\n        const ratio = 2\/3, ir = img.width \/ img.height;\n        let nw, nh, sx, sy;\n        if (ir > ratio) { nh = img.height; nw = nh * ratio; sx = (img.width - nw) \/ 2; sy = 0; }\n        else            { nw = img.width;  nh = nw \/ ratio; sx = 0; sy = (img.height - nh) \/ 2; }\n        canvas.width = 400; canvas.height = 600;\n        ctx.drawImage(img, sx, sy, nw, nh, 0, 0, 400, 600);\n        canvas.toBlob(blob => {\n            const dt = new DataTransfer();\n            dt.items.add(new File([blob], file.name, { type: 'image\/jpeg' }));\n            inputFile.files = dt.files;\n            preview.src = URL.createObjectURL(blob);\n            box.style.display = 'block';\n        }, 'image\/jpeg', 0.9);\n    };\n    reader.readAsDataURL(file);\n});\n\nfunction handleSubmitResult(json, btn) {\n    btn.disabled = false;\n    btn.value = 'G\u1eedi \u0111\u0103ng k\u00fd';\n    if (json.success) {\n        showNoti('success', '\u0110\u0103ng k\u00fd th\u00e0nh c\u00f4ng!', 'Th\u00f4ng tin \u0111\u00e3 \u0111\u01b0\u1ee3c ghi nh\u1eadn. Ph\u1ee5 huynh vui l\u00f2ng ch\u1edd th\u00f4ng b\u00e1o x\u1ebfp l\u1edbp.', function() {\n            document.getElementById('form-dangky').reset();\n            document.querySelectorAll('.toggle-row').forEach(r => r.classList.remove('toggle-checked'));\n            document.getElementById('preview-box').style.display = 'none';\n            capNhatCaHoc(null);\n            toggleDaHoc();\n            refreshSiSo();\n        });\n    } else {\n        showNoti(json.data.type || 'error', json.data.title || 'C\u00f3 l\u1ed7i x\u1ea3y ra', json.data.msg || 'Vui l\u00f2ng th\u1eed l\u1ea1i.');\n    }\n}\n\ndocument.getElementById('form-dangky').addEventListener('submit', function(e) {\n    e.preventDefault();\n    let hasError = false;\n    document.querySelectorAll('.error-msg').forEach(el => el.innerHTML = '');\n    [\n        ['ten_hs', '\u274c Vui l\u00f2ng nh\u1eadp t\u00ean h\u1ecdc sinh'], ['ngay_sinh','\u274c Vui l\u00f2ng ch\u1ecdn ng\u00e0y sinh'],\n        ['sdt', '\u274c Vui l\u00f2ng nh\u1eadp s\u1ed1 \u0111i\u1ec7n tho\u1ea1i'], ['truong', '\u274c Vui l\u00f2ng nh\u1eadp tr\u01b0\u1eddng'],\n        ['ten_cha', '\u274c Vui l\u00f2ng nh\u1eadp t\u00ean cha'], ['ten_me', '\u274c Vui l\u00f2ng nh\u1eadp t\u00ean m\u1eb9'],\n        ['dia_chi', '\u274c Vui l\u00f2ng nh\u1eadp \u0111\u1ecba ch\u1ec9']\n    ].forEach(([name, msg]) => {\n        const el = document.querySelector('[name=\"' + name + '\"]');\n        if (!el || !el.value.trim()) {\n            const errEl = document.getElementById('error-' + name);\n            if (errEl) errEl.innerHTML = msg;\n            hasError = true;\n        }\n    });\n    if (!document.querySelector('input[name=\"lop\"]:checked')) { document.getElementById('error-lop').innerHTML = '\u274c Ch\u1ecdn l\u1edbp'; hasError = true; }\n    if (!document.getElementById('real-sang').checked && !document.getElementById('real-chieu').checked) {\n        document.getElementById('error-ca_hoc').innerHTML = '\u274c Ch\u1ecdn ca h\u1ecdc'; hasError = true;\n    }\n    if (!document.querySelector('input[name=\"ton_giao\"]:checked')) { document.getElementById('error-ton_giao').innerHTML = '\u274c Ch\u1ecdn t\u00f4n gi\u00e1o'; hasError = true; }\n    \n    const lopChecked = document.querySelector('input[name=\"lop\"]:checked');\n    if (lopChecked && (lopChecked.value !== 'L\u1edbp 6' && lopChecked.value !== 'L\u1edbp 6.3') && !document.querySelector('input[name=\"da_hoc\"]:checked')) {\n        document.getElementById('error-da_hoc').innerHTML = '\u274c Ch\u1ecdn l\u1edbp \u0111\u00e3 h\u1ecdc'; hasError = true;\n    }\n    if (!document.querySelector('[name=\"anh_ho_so\"]').files.length) { document.getElementById('error-anh_ho_so').innerHTML = '\u274c Vui l\u00f2ng ch\u1ecdn \u1ea3nh 4x6'; hasError = true; }\n\n    if (hasError) {\n        const firstErr = document.querySelector('.error-msg:not(:empty)');\n        if (firstErr) firstErr.scrollIntoView({ behavior: 'smooth', block: 'center' });\n        return;\n    }\n\n    const btn = document.getElementById('btn-submit-dangky');\n    btn.disabled = true; btn.value = '\u23f3 \u0110ang g\u1eedi...';\n\n    const fd = new FormData(document.getElementById('form-dangky'));\n    fd.append('action', 'dangky_hoc_he');\n\n    submitForm(fd).then(json => {\n        if (!json.success && json.data && json.data.type === 'nonce_expired') {\n            btn.value = '\u23f3 \u0110ang l\u00e0m m\u1edbi phi\u00ean...';\n            fetchFreshNonce().then(newNonce => {\n                if (!newNonce) {\n                    btn.disabled = false; btn.value = 'G\u1eedi \u0111\u0103ng k\u00fd';\n                    showNoti('warning', 'Phi\u00ean \u0111\u00e3 h\u1ebft h\u1ea1n', 'Vui l\u00f2ng t\u1ea3i l\u1ea1i trang v\u00e0 g\u1eedi l\u1ea1i \u0111\u01a1n \u0111\u0103ng k\u00fd.');\n                    return;\n                }\n                btn.value = '\u23f3 \u0110ang g\u1eedi...';\n                const fd2 = new FormData(document.getElementById('form-dangky'));\n                fd2.append('action', 'dangky_hoc_he');\n                submitForm(fd2).then(json2 => handleSubmitResult(json2, btn)).catch(() => {\n                    btn.disabled = false; btn.value = 'G\u1eedi \u0111\u0103ng k\u00fd';\n                    showNoti('error', 'L\u1ed7i k\u1ebft n\u1ed1i', 'Kh\u00f4ng th\u1ec3 g\u1eedi \u0111\u0103ng k\u00fd. Vui l\u00f2ng th\u1eed l\u1ea1i.');\n                });\n            });\n            return;\n        }\n        handleSubmitResult(json, btn);\n    }).catch(() => {\n        btn.disabled = false; btn.value = 'G\u1eedi \u0111\u0103ng k\u00fd';\n        showNoti('error', 'L\u1ed7i k\u1ebft n\u1ed1i', 'Kh\u00f4ng th\u1ec3 g\u1eedi \u0111\u0103ng k\u00fd. Vui l\u00f2ng ki\u1ec3m tra m\u1ea1ng v\u00e0 th\u1eed l\u1ea1i.');\n    });\n});\n\ndocument.querySelectorAll('.form-don input, .form-don textarea').forEach(el => {\n    el.addEventListener('input', function() { const b = document.getElementById('error-' + this.name); if(b) b.innerHTML = ''; });\n    el.addEventListener('change', function() { const b = document.getElementById('error-' + this.name); if(b) b.innerHTML = ''; });\n    el.addEventListener('invalid', function(e) { e.preventDefault(); });\n});\n\nwindow.addEventListener('load', function() {\n    const lopChecked = document.querySelector('input[name=\"lop\"]:checked');\n    if (lopChecked) capNhatCaHoc(lopChecked.value, false);\n    toggleDaHoc();\n    refreshSiSo();\n});\n<\/script>\n\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-28","page","type-page","status-publish","hentry"],"_hostinger_reach_plugin_has_subscription_block":false,"_hostinger_reach_plugin_is_elementor":false,"_links":{"self":[{"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/pages\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":3,"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/pages\/28\/revisions"}],"predecessor-version":[{"id":34,"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/pages\/28\/revisions\/34"}],"wp:attachment":[{"href":"https:\/\/dongmechuacuuchuoc.org\/thongtindangky\/wp-json\/wp\/v2\/media?parent=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}