{"id":314,"date":"2024-01-13T11:06:17","date_gmt":"2024-01-13T11:06:17","guid":{"rendered":"https:\/\/luyenthitokutei.com\/?page_id=314"},"modified":"2025-05-06T10:13:23","modified_gmt":"2025-05-06T10:13:23","slug":"dang-nhap","status":"publish","type":"page","link":"https:\/\/luyenthitokutei.com\/ja\/dang-nhap\/","title":{"rendered":"\u30ed\u30ae\u30f3\u30b0"},"content":{"rendered":"<!DOCTYPE html>\n<html lang=\"vi\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u0110\u0103ng Nh\u1eadp H\u1ec7 Th\u1ed1ng Thi<\/title>\n    <style>\n        #login-page {\n            margin: 0;\n            padding: 0;\n            font-family: 'Roboto', Arial, sans-serif;\n            background-color: #f5f5f5;\n            height: 100vh;\n        }\n        \n        #login-page .popup {\n            position: fixed;\n            top: 0;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            background: rgba(0, 0, 0, 0.7);\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            z-index: 1000;\n        }\n        \n        #login-page .popup-content {\n            background: white;\n            padding: 25px;\n            border-radius: 10px;\n            width: 90%;\n            max-width: 500px;\n            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);\n        }\n        \n        #login-page .popup-content h3 {\n            color: #00448D;\n            margin-bottom: 20px;\n            text-align: center;\n        }\n        \n        #login-page .popup-content input {\n            width: 100%;\n            padding: 12px;\n            margin-bottom: 15px;\n            border: 1px solid #ddd;\n            border-radius: 5px;\n            font-size: 16px;\n        }\n        \n        #login-page .popup-content button {\n            width: 100%;\n            padding: 12px;\n            background-color: #00448D;\n            color: white;\n            border: none;\n            border-radius: 5px;\n            font-size: 16px;\n            cursor: pointer;\n            transition: background-color 0.3s;\n        }\n        \n        #login-page .popup-content button:hover {\n            background-color: #003366;\n        }\n    <\/style>\n<\/head>\n<body>\n    <div id=\"login-page\">\n        <div id=\"userIdPopup\" class=\"popup\">\n            <div class=\"popup-content\">  \n                <h3>NH\u1eacP TH\u00d4NG TIN \u0110\u1ec2 TI\u1ebeP T\u1ee4C<\/h3>\n                <input style=\"display:none;\" id=\"userName\" placeholder=\"H\u1ecd v\u00e0 t\u00ean\"\/>\n                <input id=\"userId\" placeholder=\"M\u00e3 h\u1ecdc vi\u00ean\" \/>\n                <input style=\"display:none;\" id=\"classId\" placeholder=\"L\u1edbp h\u1ecdc\" \/>\n                <button id=\"userInfo-button\" onclick=\"checkUserId()\">X\u00e1c nh\u1eadn<\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        const scriptUrl = \"https:\/\/script.google.com\/macros\/s\/AKfycbzFTowXA2Bo7FIPnHV4hIkPSJCJPcNcxfhqlPSD2E3RUY90p8tQ8KbYymzVQLQ-BApSHw\/exec\";\n        const redirectUrl = \"https:\/\/luyenthitokutei.com\/de-thi-ttdt\/\"; \/\/ Thay b\u1eb1ng link trang test th\u1ef1c t\u1ebf\n        \n        function checkUserId() {\n            const userId = document.getElementById('userId').value.trim();\n            const confirmButton = document.getElementById('userInfo-button');\n\n            if (!userId) {\n                alert('Vui l\u00f2ng nh\u1eadp m\u00e3 h\u1ecdc vi\u00ean!');\n                return;\n            }\n\n            confirmButton.disabled = true;\n            confirmButton.textContent = '\u0110ang ki\u1ec3m tra...';\n\n            const url = `${scriptUrl}?action=checkUserId&userId=${userId}`;\n\n            fetch(url)\n                .then(response => response.json())\n                .then(result => {\n                    if (result.error) throw new Error(result.error);\n\n                    if (result.exists) {\n                        \/\/ L\u1ea5y th\u00f4ng tin t\u1eeb server\n                        const classId = result.classId || \"\";\n                        const userName = result.userName || \"\";\n                        \n                        if (!classId) {\n                            alert(\"Kh\u00f4ng t\u00ecm th\u1ea5y l\u1edbp h\u1ecdc c\u1ee7a h\u1ecdc vi\u00ean. Vui l\u00f2ng ki\u1ec3m tra l\u1ea1i.\");\n                            confirmButton.disabled = false;\n                            confirmButton.textContent = 'X\u00e1c nh\u1eadn';\n                            return;\n                        }\n\n                        \/\/ L\u01b0u to\u00e0n b\u1ed9 th\u00f4ng tin v\u00e0o localStorage\n                        localStorage.setItem('userId', userId);\n                        localStorage.setItem('userName', userName);\n                        localStorage.setItem('classId', classId);\n\n                        \/\/ T\u1ea1o deviceId n\u1ebfu ch\u01b0a c\u00f3\n                        if (!localStorage.getItem('deviceId')) {\n                            localStorage.setItem('deviceId', generateRandomID());\n                        }\n\n                        console.log('Th\u00f4ng tin \u0111\u0103ng nh\u1eadp \u0111\u00e3 l\u01b0u:', {\n                            userId: userId,\n                            userName: userName,\n                            classId: classId,\n                            deviceId: localStorage.getItem('deviceId')\n                        });\n\n                        \/\/ Chuy\u1ec3n h\u01b0\u1edbng \u0111\u1ebfn trang test\n                        window.location.href = redirectUrl;\n                    } else {\n                        alert('M\u00e3 h\u1ecdc vi\u00ean kh\u00f4ng t\u1ed3n t\u1ea1i. Vui l\u00f2ng nh\u1eadp m\u00e3 h\u1ecdc vi\u00ean \u0111\u00fang.');\n                        confirmButton.disabled = false;\n                        confirmButton.textContent = 'X\u00e1c nh\u1eadn';\n                    }\n                })\n                .catch(error => {\n                    console.error('Error:', error);\n                    alert('C\u00f3 l\u1ed7i x\u1ea3y ra khi ki\u1ec3m tra m\u00e3 h\u1ecdc vi\u00ean: ' + error.message);\n                    confirmButton.disabled = false;\n                    confirmButton.textContent = 'X\u00e1c nh\u1eadn';\n                });\n        }\n\n        function generateRandomID() {\n            return Math.random().toString(36).substr(2, 9);\n        }\n    <\/script>\n<\/body>\n<\/html>","protected":false},"excerpt":{"rendered":"<p>\u0110\u0103ng Nh\u1eadp H\u1ec7 Th\u1ed1ng Thi NH\u1eacP TH\u00d4NG TIN \u0110\u1ec2 TI\u1ebeP T\u1ee4C X\u00e1c nh\u1eadn<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-314","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/pages\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/comments?post=314"}],"version-history":[{"count":215,"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/pages\/314\/revisions"}],"predecessor-version":[{"id":5104,"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/pages\/314\/revisions\/5104"}],"wp:attachment":[{"href":"https:\/\/luyenthitokutei.com\/ja\/wp-json\/wp\/v2\/media?parent=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}