File manager - Edit - /home/webapp68.cm.in.th/u68319090026/final/news/student_dashboard.html
Back
<!DOCTYPE html> <html lang="th"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Dashboard นักเรียน</title> <link href="https://fonts.googleapis.com/css2?family=Sarabun&display=swap" rel="stylesheet" /> <style> body { font-family: "Sarabun", sans-serif; max-width: 600px; margin: 20px auto; background: #fefefe; } nav a { margin: 0 10px; text-decoration: none; color: #3366cc; font-weight: 600; } nav a:hover { text-decoration: underline; } h1 { text-align: center; margin-bottom: 20px; } #dashboardCards { display: flex; flex-direction: column; gap: 16px; align-items: center; } .card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 3px 6px rgba(0,0,0,0.1); width: 100%; max-width: 350px; text-align: center; cursor: pointer; user-select: none; transition: background-color 0.3s ease; } .card:hover { background-color: #d6e4ff; } .card h2 { font-size: 48px; margin: 0 0 8px; color: #3366cc; } .card p { font-size: 18px; margin: 0; font-weight: 600; } #logoutBtn { margin-top: 30px; display: block; width: 120px; margin-left: auto; margin-right: auto; padding: 10px; background-color: #dc3545; color: white; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; } #logoutBtn:hover { background-color: #b52a38; } </style> </head> <body> <nav> <a href="student_articles.html">อ่านบทความ</a> </nav> <h1>ยินดีต้อนรับ นักเรียน</h1> <div id="dashboardCards"> <!-- การ์ดข้อมูลจะถูกเติมด้วย JS --> </div> <button id="logoutBtn">ออกจากระบบ</button> <script> // ตรวจสอบล็อกอินนักเรียน if(localStorage.getItem('isStudentLoggedIn') !== 'true') { alert('กรุณาเข้าสู่ระบบด้วยบัญชีนักเรียน'); window.location.href = 'login.html'; // เปลี่ยนเป็น login.html } function logout() { localStorage.removeItem('isStudentLoggedIn'); localStorage.removeItem('currentUserRole'); window.location.href = 'login.html'; // เปลี่ยนเป็น login.html } document.getElementById('logoutBtn').addEventListener('click', logout); const articles = JSON.parse(localStorage.getItem('college_news_articles')) || []; const dashboardCards = document.getElementById('dashboardCards'); dashboardCards.innerHTML = ` <div class="card" onclick="location.href='summary.html'"> <h2>${articles.length}</h2> <p>บทความทั้งหมด</p> </div> <div class="card" onclick="location.href='student_articles.html'"> <h2>อ่าน</h2> <p>บทความ</p> </div> `; </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.41 |
proxy
|
phpinfo
|
Settings