Oppdrydning
This commit is contained in:
parent
91451b382f
commit
648bb5443c
32
admin.php
32
admin.php
@ -6,25 +6,6 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="description" content="Elektronisk Kadaver Tidtakningssystem" />
|
<meta name="description" content="Elektronisk Kadaver Tidtakningssystem" />
|
||||||
<link rel="stylesheet" href="matcha.css">
|
<link rel="stylesheet" href="matcha.css">
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.settings {
|
|
||||||
padding: 0 1.5rem;
|
|
||||||
}
|
|
||||||
fieldset {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-evenly;
|
|
||||||
}
|
|
||||||
.bg-success {
|
|
||||||
background: var(--bg-success) !important;
|
|
||||||
}
|
|
||||||
.bg-active {
|
|
||||||
background: var(--bg-active) !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav>
|
<nav>
|
||||||
@ -35,19 +16,6 @@
|
|||||||
</menu>
|
</menu>
|
||||||
</nav>
|
</nav>
|
||||||
<button class="danger" onclick="log_out()">Logg ut</button>
|
<button class="danger" onclick="log_out()">Logg ut</button>
|
||||||
<h2>Simple Form</h2>
|
|
||||||
<form action="/runner.php" method="POST">
|
|
||||||
<label for="password">Passord:</label><br>
|
|
||||||
<input type="text" id="password" name="password" required><br><br>
|
|
||||||
|
|
||||||
<label for="id">Startnummer:</label><br>
|
|
||||||
<input type="text" id="id" name="id" required><br><br>
|
|
||||||
|
|
||||||
<label for="navn">Navn:</label><br>
|
|
||||||
<input type="text" id="name" name="input2"><br><br>
|
|
||||||
|
|
||||||
<button type="submit">Submit</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -6,25 +6,6 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta name="description" content="Elektronisk Kadaver Tidtakningssystem" />
|
<meta name="description" content="Elektronisk Kadaver Tidtakningssystem" />
|
||||||
<link rel="stylesheet" href="matcha.css">
|
<link rel="stylesheet" href="matcha.css">
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.settings {
|
|
||||||
padding: 0 1.5rem;
|
|
||||||
}
|
|
||||||
fieldset {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-evenly;
|
|
||||||
}
|
|
||||||
.bg-success {
|
|
||||||
background: var(--bg-success) !important;
|
|
||||||
}
|
|
||||||
.bg-active {
|
|
||||||
background: var(--bg-active) !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav>
|
<nav>
|
||||||
@ -34,16 +15,31 @@
|
|||||||
<li class="selected"><a href="/db_editor.html">Endre løperbase</a></li>
|
<li class="selected"><a href="/db_editor.html">Endre løperbase</a></li>
|
||||||
</menu>
|
</menu>
|
||||||
</nav>
|
</nav>
|
||||||
<h2>Simple Form</h2>
|
<h2>Legg til løper</h2>
|
||||||
<form action="/runner.php" method="POST">
|
<form action="/runner.php" method="POST">
|
||||||
<label for="password">Passord:</label><br>
|
|
||||||
<input type="text" id="password" name="password" required><br><br>
|
|
||||||
|
|
||||||
<label for="id">Startnummer:</label><br>
|
<input style="display: none;" type="text" id="password" name="password" required>
|
||||||
<input type="text" id="id" name="id" required><br><br>
|
|
||||||
|
|
||||||
<label for="navn">Navn:</label><br>
|
<label for="id">Startnummer:
|
||||||
<input type="text" id="name" name="input2"><br><br>
|
<input type="text" id="id" name="id" required>
|
||||||
|
</label>
|
||||||
|
<label for="navn">Navn:
|
||||||
|
<input type="text" id="name" name="name">
|
||||||
|
</label>
|
||||||
|
<label for="club">Klubb:
|
||||||
|
<input type="text" id="club" name="club">
|
||||||
|
</label>
|
||||||
|
<fieldset>
|
||||||
|
<legend>Klasse</legend>
|
||||||
|
<label>
|
||||||
|
<input type="radio" name="course" value="Kadaverløpet" checked="checked">
|
||||||
|
Kadaverløpet
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<input type="radio" name="course" value="Minikadaver'n">
|
||||||
|
Minikadaver'n
|
||||||
|
</label>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
<button type="submit">Submit</button>
|
<button type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
@ -56,6 +52,7 @@
|
|||||||
window.location.href = "/login.html";
|
window.location.href = "/login.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sjekk om brukeren er logga inn. hvis ikke hiv de ut til innloggingskjermen
|
||||||
let xmlHttpReq = new XMLHttpRequest();
|
let xmlHttpReq = new XMLHttpRequest();
|
||||||
xmlHttpReq.open("POST", "/is_authorized.php", false);
|
xmlHttpReq.open("POST", "/is_authorized.php", false);
|
||||||
xmlHttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8")
|
xmlHttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8")
|
||||||
@ -63,6 +60,7 @@
|
|||||||
if (xmlHttpReq.status != 200){
|
if (xmlHttpReq.status != 200){
|
||||||
window.location.href = "/login.html";
|
window.location.href = "/login.html";
|
||||||
}
|
}
|
||||||
|
document.getElementById('password').value = localStorage.getItem("passord");
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -28,8 +28,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="settings">
|
<div class="settings">
|
||||||
<legend>Passord</legend>
|
<nav>
|
||||||
<input type="password" name="passord" id="password">
|
<menu>
|
||||||
|
<li class="disabled"><a href="/admin.php">Dashbord</a></li>
|
||||||
|
<li class="selected"><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>
|
||||||
|
</menu>
|
||||||
|
</nav>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Velg post</legend>
|
<legend>Velg post</legend>
|
||||||
<label>
|
<label>
|
||||||
@ -72,7 +77,7 @@ function register_runner(id) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append(name= 'password', value=document.getElementById('password').value)
|
formData.append(name= 'password', localStorage.getItem("passord"))
|
||||||
formData.append(name= 'control', value=control);
|
formData.append(name= 'control', value=control);
|
||||||
formData.append(name= 'id', value=id);
|
formData.append(name= 'id', value=id);
|
||||||
time = new Date(Date.now()).toISOString().split('.')[0]+"Z"
|
time = new Date(Date.now()).toISOString().split('.')[0]+"Z"
|
||||||
@ -99,6 +104,18 @@ function update() {
|
|||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then((text) => {table.innerHTML = text;})
|
.then((text) => {table.innerHTML = text;})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 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");
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -8,7 +8,7 @@ if ($method == "POST") {
|
|||||||
$club = $_POST['club'];
|
$club = $_POST['club'];
|
||||||
$course = $_POST['course'];
|
$course = $_POST['course'];
|
||||||
|
|
||||||
$line = $runner_id . ";;" . $name . ";;;" . $club . ";" . $course;
|
$line = $runner_id . ";;" . $name . ";;;" . $club . ";" . $course . "\n";
|
||||||
|
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
if (!password_verify($password, $hash)) {
|
if (!password_verify($password, $hash)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user