diff --git a/index.html b/index.html
index 3d69246..a12b861 100644
--- a/index.html
+++ b/index.html
@@ -30,12 +30,14 @@ input:focus,select:focus,textarea:focus{outline:2px solid var(--cyan);border-col
.nav-links{display:flex;gap:16px}
.nav-links a{color:var(--white);text-decoration:none;font-weight:600;font-size:14px;white-space:nowrap}
.nav-links a:hover{color:var(--cyan)}
+.nav-links a.admin-only{display:none}
.mobile-menu-btn{display:none;background:none;border:none;color:var(--white);font-size:28px;cursor:pointer;padding:4px}
.mobile-menu{display:none;position:fixed;top:52px;left:0;right:0;background:var(--ink);padding:16px;z-index:99;box-shadow:0 4px 12px rgba(0,0,0,0.3);max-height:80vh;overflow-y:auto}
.mobile-menu.show{display:block}
.mobile-menu a{display:block;color:var(--white);padding:14px 0;text-decoration:none;font-size:17px;border-bottom:1px solid rgba(255,255,255,0.08)}
.mobile-menu a:last-child{border-bottom:none}
.mobile-menu a:hover{color:var(--cyan)}
+.mobile-menu a.admin-only{display:none}
.mobile-menu-btn{display:none;background:none;border:none;color:var(--white);font-size:24px;cursor:pointer}
.mobile-menu{display:none;position:fixed;top:60px;left:0;right:0;background:var(--ink);padding:20px;z-index:99;box-shadow:0 4px 12px rgba(0,0,0,0.3)}
.mobile-menu a{display:block;color:var(--white);padding:16px 0;text-decoration:none;font-size:18px;border-bottom:1px solid rgba(255,255,255,0.1)}
@@ -89,7 +91,7 @@ input,select,textarea{font-size:16px;padding:12px;border-radius:8px;margin-botto
Тесттер
Видео
Дашборд
- Админ
+ Админ
Кіру
@@ -97,7 +99,7 @@ input,select,textarea{font-size:16px;padding:12px;border-radius:8px;margin-botto
Тесттер
Видео
Дашборд
- Админ
+ Админ
Кіру
@@ -292,8 +294,9 @@ let currentTest = null;
let currentQuestionIndex = 0;
let userAnswers = [];
let testStartTime = null;
-const ADMIN_PHONE = '77777777777';
-const ADMIN_PASS = 'admin123';
+const ADMIN_PHONE = '77474700532';
+const ADMIN_PASS = 'Aa123456';
+const ADMIN_NAME = 'Бижігіт Айбек';
// USER DATA - локальды сақтау
function getUserData() {
@@ -340,10 +343,25 @@ function unbanStudent(phone) {
// PAGE NAVIGATION
function showPage(pageId) {
+ // Check admin-only pages
+ if (pageId === 'admin' && currentUser !== 'admin') {
+ alert('⛔ Админ панельге кіру рұқсаты жоқ!');
+ showPage('home');
+ return;
+ }
+
document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
document.getElementById(pageId).classList.add('active');
if (pageId === 'dashboard') updateDashboard();
- if (pageId === 'admin') updateAdminList();
+ if (pageId === 'admin') {
+ if (currentUser === 'admin') {
+ updateAdminList();
+ renderStudentsList();
+ } else {
+ showPage('home');
+ return;
+ }
+ }
if (pageId === 'home') { renderTopics(); renderRecentTests(); }
window.scrollTo(0, 0);
}
@@ -353,6 +371,13 @@ function toggleMobileMenu() {
menu.classList.toggle('show');
}
+function updateAdminLinks() {
+ const isAdmin = currentUser === 'admin';
+ document.querySelectorAll('.admin-only').forEach(el => {
+ el.style.display = isAdmin ? 'block' : 'none';
+ });
+}
+
// RENDER TOPICS
async function renderTopics() {
const grid = document.getElementById('topicsGrid');
@@ -857,11 +882,13 @@ document.getElementById('loginForm').addEventListener('submit', function(e) {
// Admin check
if (phone === ADMIN_PHONE && password === ADMIN_PASS) {
currentUser = 'admin';
- document.getElementById('loginLink').textContent = '👑 Админ';
- document.getElementById('mobileLoginLink').textContent = '👑 Админ';
+ const adminName = ADMIN_NAME;
+ document.getElementById('loginLink').textContent = '👑 ' + adminName;
+ document.getElementById('mobileLoginLink').textContent = '👑 ' + adminName;
+ updateAdminLinks();
showPage('admin');
renderStudentsList();
- alert('Қош келдіңіз, Админ!');
+ alert('Қош келдіңіз, ' + adminName + '!');
return;
}
@@ -878,6 +905,7 @@ document.getElementById('loginForm').addEventListener('submit', function(e) {
const name = students[phone].name || phone;
document.getElementById('loginLink').textContent = '👤 ' + name;
document.getElementById('mobileLoginLink').textContent = '👤 ' + name;
+ updateAdminLinks();
showPage('home');
alert('Қош келдіңіз, ' + name + '!');
} else {
@@ -918,6 +946,7 @@ document.getElementById('registerForm').addEventListener('submit', function(e) {
renderTopics();
renderRecentTests();
renderVideos();
+updateAdminLinks();