61 lines
2.3 KiB
HTML
61 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="no">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>EKT admin</title>
|
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
<meta name="description" content="Elektronisk Kadaver Tidtakningssystem" />
|
|
<link rel="icon" type="image/png" href="/img/favicon-96x96.png" sizes="96x96" />
|
|
<link rel="icon" type="image/svg+xml" href="/img/favicon.svg" />
|
|
<link rel="shortcut icon" href="/img/favicon.ico" />
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png" />
|
|
<meta name="apple-mobile-web-app-title" content="Kadaver'n" />
|
|
<link rel="manifest" href="/img/site.webmanifest" />
|
|
<link rel="stylesheet" href="matcha.css">
|
|
</head>
|
|
<body>
|
|
<nav>
|
|
<menu>
|
|
<li class="disabled"><a href="/admin.php">📊 Dashbord</a></li>
|
|
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</a></li>
|
|
<li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li>
|
|
<li class="selected"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
|
</menu>
|
|
</nav>
|
|
|
|
<h2>Sett dato og tid startskuddet gikk:</h2>
|
|
<form action="/config.php" method="POST">
|
|
<input style="display: none;" type="text" id="password" name="password" required>
|
|
<label>
|
|
Dato og tid
|
|
<input type="datetime-local" id="start_time" name="start_time" step="1">
|
|
</label>
|
|
<button type="submit">Oppdater</button>
|
|
</form>
|
|
|
|
</div>
|
|
<script>
|
|
function log_out(){
|
|
localStorage.removeItem("navn");
|
|
localStorage.removeItem("passord");
|
|
window.location.href = "/login.html";
|
|
}
|
|
|
|
// Sjekk om brukeren er logga inn. hvis ikke hiv de ut til innloggingskjermen
|
|
let xmlHttpReq = new XMLHttpRequest();
|
|
xmlHttpReq.open("POST", "/is_authorized.php", false);
|
|
xmlHttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8")
|
|
xmlHttpReq.send("username=" + localStorage.getItem("navn")+"&"+"password=" + localStorage.getItem("passord"));
|
|
if (xmlHttpReq.status != 200){
|
|
window.location.href = "/login.html";
|
|
}
|
|
document.getElementById('password').value = localStorage.getItem("passord");
|
|
|
|
xmlHttpReq.open("GET", "/config.php", false);
|
|
xmlHttpReq.send();
|
|
document.getElementById('start_time').value = xmlHttpReq.response.split('+')[0]
|
|
console.log(xmlHttpReq.response)
|
|
|
|
</script>
|
|
</body>
|
|
</html> |