la til valg av matpost

This commit is contained in:
Trygve 2024-10-08 21:41:41 +02:00
parent 0fc2aa5f05
commit dbcbaff3e1

View File

@ -1,16 +1,41 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="no"> <html lang="no">
<head> <head>
<meta charset="UTF-8" />
<title>EKT</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="description" content="Elektronisk Kadaver Tidtakningssystem" />
<link rel="stylesheet" href="https://matcha.mizu.sh/matcha.css"> <link rel="stylesheet" href="https://matcha.mizu.sh/matcha.css">
<style> <style>
.passed { .passed {
background-color: #8ff0a4; background-color: #8ff0a4;
} }
fieldset {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
}
</style> </style>
</head> </head>
<body> <body>
<fieldset>
<legend>Velg post</legend>
<label>
<input type="radio" name="post" value="1">
1. Matpost
</label>
<label>
<input type="radio" name="post" value="2">
2. Matpost
</label>
<label>
<input type="radio" name="post" value="3">
Mål
</label>
</fieldset>
<input id="search" type="text" class="form-control" onkeyup="filterTable()" placeholder="Søk etter startnummer eller navn">
<input id="search" type="number" class="form-control" onkeyup="filterTable()" placeholder="Søk">
<br> <br>
<table> <table>
@ -21,14 +46,14 @@
</body> </body>
<?php <?php
$action = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; $action = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
switch($action) { print_r($action)
}
?> ?>
<script> <script>
// Hvilken matpost vi er på: // Hvilken matpost vi er på:
var control = 2; var control = location.search[1];
function register_runner(id) { function register_runner(id) {
control = document.querySelector('input[name="post"]:checked').value;
let formData = new FormData(); let formData = new FormData();
formData.append(name= 'control', value=control); formData.append(name= 'control', value=control);
formData.append(name= 'id', value=id); formData.append(name= 'id', value=id);
@ -65,7 +90,7 @@ function create_row(id, name, passed) {
function create_rows(csv) { function create_rows(csv) {
csv = csv.split('\n') csv = csv.split('\n')
rows = "" rows = "<tr><th>#</th><th>Navn</th><th></th>";
for (i in csv) { for (i in csv) {
data = csv[i].split(",") data = csv[i].split(",")
rows += create_row(data[0], data[1], false) rows += create_row(data[0], data[1], false)