72 lines
7.6 KiB
HTML
72 lines
7.6 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="ru">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>Вход — ПАБ</title>
|
||
<style>
|
||
*{box-sizing:border-box;margin:0;padding:0}
|
||
body{font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#0F1218 0%,#1a2332 100%)}
|
||
#card{background:#fff;padding:44px 36px;border-radius:14px;width:100%;max-width:400px;box-shadow:0 8px 40px rgba(0,0,0,0.25)}
|
||
#card h1{font-size:19px;text-align:center;margin-bottom:4px}
|
||
#card .sub{font-size:13px;color:#5B6573;text-align:center;margin-bottom:24px}
|
||
input{width:100%;padding:12px;margin-bottom:12px;border:2px solid #E2E6EB;border-radius:8px;font-size:14px;font-family:inherit;outline:none}
|
||
input:focus{border-color:#00B4D8}
|
||
select{width:100%;padding:10px;margin-bottom:10px;border:2px solid #E2E6EB;border-radius:8px;font-size:13px;font-family:inherit}
|
||
button{width:100%;padding:12px;background:#00B4D8;color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:700;cursor:pointer;font-family:inherit}
|
||
button:hover{background:#48CAE4}
|
||
.tabs{display:flex;gap:0;margin-bottom:20px;border-radius:8px;overflow:hidden;border:2px solid #E2E6EB}
|
||
.tabs button{flex:1;padding:8px;background:#fff;color:#5B6573;border:none;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit;border-radius:0}
|
||
.tabs button.ac{background:#00B4D8;color:#fff}
|
||
.err{color:#E63946;font-size:13px;text-align:center;display:none;margin-top:8px}
|
||
.ok{background:#EDF7F0;border:1px solid #2D6A4F;color:#2D6A4F;padding:10px;border-radius:8px;font-size:13px;text-align:center;display:none;margin-top:10px;font-weight:600}
|
||
#regForm{display:none}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div id="card">
|
||
<h1>🛡️ Поведенческий аудит безопасности</h1>
|
||
<div class="sub">Система ПАБ</div>
|
||
<div class="tabs"><button class="ac" id="tL">Вход</button><button id="tR">Регистрация</button></div>
|
||
<div id="loginForm">
|
||
<input type="text" id="lu" placeholder="Логин">
|
||
<input type="password" id="lp" placeholder="Пароль">
|
||
<button id="lb">Войти</button>
|
||
<div class="err" id="lerr">Неверный логин или пароль</div>
|
||
</div>
|
||
<div id="regForm">
|
||
<input type="text" id="rl" placeholder="Придумайте логин">
|
||
<input type="password" id="rp" placeholder="Придумайте пароль (мин. 3)">
|
||
<input type="text" id="rn" placeholder="ФИО">
|
||
<input type="email" id="re" placeholder="Email">
|
||
<select id="rr"><option value="">-- Должность --</option><option>Директор департамента ЦА</option><option>Директор департамента филиала</option><option>Региональный директор филиала</option><option>Директор ДЭСД</option><option>Начальник ТУСМ</option><option>Руководитель структурного подразделения</option><option>Начальник центра/службы/цеха</option><option>Начальник участка</option><option>Инженер БиОТ</option><option>Работник отдела БиОТ</option></select>
|
||
<select id="rf"><option value="">-- Периодичность ПАБ --</option><option value="2,month">2 раза в месяц</option><option value="1,month">1 раз в месяц</option><option value="1,quarter">1 раз в квартал</option><option value="1,halfyear">1 раз в полгода</option></select>
|
||
<input type="text" id="rb" placeholder="Филиал">
|
||
<input type="text" id="rd" placeholder="Подразделение">
|
||
<input type="text" id="rg" placeholder="Регион">
|
||
<input type="text" id="ro" placeholder="Область">
|
||
<input type="text" id="rc" placeholder="Город / село">
|
||
<button id="rbb">Зарегистрироваться</button>
|
||
<div class="err" id="rerr"></div><div class="ok" id="rok">✅ Регистрация успешна! Теперь войдите.</div>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
document.getElementById('tL').onclick=function(){document.getElementById('loginForm').style.display='block';document.getElementById('regForm').style.display='none';this.classList.add('ac');document.getElementById('tR').classList.remove('ac')};
|
||
document.getElementById('tR').onclick=function(){document.getElementById('loginForm').style.display='none';document.getElementById('regForm').style.display='block';this.classList.add('ac');document.getElementById('tL').classList.remove('ac')};
|
||
document.getElementById('lb').onclick=function(){
|
||
var u=document.getElementById('lu').value.trim().toLowerCase();
|
||
var p=document.getElementById('lp').value.trim();
|
||
if(u==='admin'&&p==='admin'){sessionStorage.setItem('pab_user',JSON.stringify({login:'admin',name:'Администратор',role:'Руководитель',freq:'0,month',email:'admin@telecom.kz',branch:'АО «Казахтелеком»',dept:'ЦА',region:'Центральный',oblast:'—',city:'г. Астана'}));location.href='app.html';return}
|
||
var users={};try{users=JSON.parse(localStorage.getItem('pab_users')||'{}')}catch(e){}if(users[u]&&users[u].pass===p){sessionStorage.setItem('pab_user',JSON.stringify({login:u,name:users[u].name,role:users[u].role,freq:users[u].freq||'',email:users[u].email||'',branch:users[u].branch||'',dept:users[u].dept||'',region:users[u].region||'',oblast:users[u].oblast||'',city:users[u].city||''}));location.href='app.html';return}
|
||
document.getElementById('lerr').style.display='block'
|
||
};
|
||
document.getElementById('lp').onkeydown=function(e){if(e.key==='Enter')document.getElementById('lb').onclick()};
|
||
document.getElementById('rbb').onclick=function(){
|
||
var l=document.getElementById('rl').value.trim().toLowerCase(),p=document.getElementById('rp').value.trim(),n=document.getElementById('rn').value.trim(),em=document.getElementById('re').value.trim(),r=document.getElementById('rr').value,fr=document.getElementById('rf').value,br=document.getElementById('rb').value.trim(),dp=document.getElementById('rd').value.trim(),rg=document.getElementById('rg').value.trim(),ob=document.getElementById('ro').value.trim(),ct=document.getElementById('rc').value.trim();
|
||
var e=document.getElementById('rerr'),ok=document.getElementById('rok');ok.style.display='none';if(!l||l.length<2){e.textContent='Логин мин. 2 символа';e.style.display='block';return}if(!p||p.length<3){e.textContent='Пароль мин. 3 символа';e.style.display='block';return}if(!n){e.textContent='Укажите ФИО';e.style.display='block';return}if(!r){e.textContent='Выберите должность';e.style.display='block';return}if(!em||em.indexOf('@')<0){e.textContent='Укажите Email';e.style.display='block';return}if(!br){e.textContent='Укажите филиал';e.style.display='block';return}if(!rg){e.textContent='Укажите регион';e.style.display='block';return}if(!ct){e.textContent='Укажите город';e.style.display='block';return}if(!dp){e.textContent='Укажите подразделение';e.style.display='block';return}if(!fr){e.textContent='Укажите периодичность ПАБ';e.style.display='block';return}
|
||
var users={};try{users=JSON.parse(localStorage.getItem('pab_users')||'{}')}catch(e){}if(users[l]){e.textContent='Логин занят';e.style.display='block';return}e.style.display='none';users[l]={pass:p,name:n,email:em,role:r,freq:fr,branch:br,dept:dp,region:rg,oblast:ob,city:ct};localStorage.setItem('pab_users',JSON.stringify(users));ok.style.display='block';document.getElementById('lu').value=l;setTimeout(function(){ok.style.display='none';document.getElementById('tL').onclick()},2000)
|
||
};
|
||
</script>
|
||
</body>
|
||
</html>
|