File manager - Edit - /home/webapp68.cm.in.th/u68319090026/final/news/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: 700px; margin: 20px auto; background: #f0f4ff; } 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-wrap: wrap; gap: 16px; justify-content: center; } .card { background: white; padding: 24px 20px; border-radius: 8px; box-shadow: 0 4px 8px rgb(0 0 0 / 0.1); text-align: center; cursor: pointer; width: 150px; user-select: none; transition: background-color 0.3s ease; } .card:hover { background-color: #cce0ff; } .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="admin_dashboard.html">Dashboard</a> <a href="summary.html">สรุปจำนวนบทความ</a> <a href="users.html">จัดการผู้ใช้งาน</a> <a href="categories.html">จัดการหมวดหมู่</a> <a href="articles.html">จัดการบทความ</a> </nav> <h1>ยินดีต้อนรับ แอดมิน</h1> <div id="dashboardCards"> <!-- การ์ดข้อมูลจะถูกเติมด้วย JS --> </div> <button id="logoutBtn">ออกจากระบบ</button> <script> // ตรวจสอบล็อกอินแอดมิน if(localStorage.getItem('isAdminLoggedIn') !== 'true') { alert('กรุณาเข้าสู่ระบบด้วยบัญชีแอดมิน'); window.location.href = 'login.html'; } function logout() { localStorage.removeItem('isAdminLoggedIn'); 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 users = JSON.parse(localStorage.getItem('college_news_users')) || []; const categories = JSON.parse(localStorage.getItem('college_news_categories')) || []; 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='users.html'"> <h2>${users.length}</h2> <p>ผู้ใช้งาน</p> </div> <div class="card" onclick="location.href='categories.html'"> <h2>${categories.length}</h2> <p>หมวดหมู่</p> </div> <div class="card" onclick="location.href='articles.html'"> <h2>จัดการ</h2> <p>บทความ</p> </div> `; </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.45 |
proxy
|
phpinfo
|
Settings