diff --git a/QTOldGoudy.woff2 b/QTOldGoudy.woff2 new file mode 100644 index 0000000..9b0e11b Binary files /dev/null and b/QTOldGoudy.woff2 differ diff --git a/get_table.php b/get_table.php index eccd87d..8b6513b 100644 --- a/get_table.php +++ b/get_table.php @@ -122,29 +122,24 @@ if (!isset($query)){ if ($query[0] == "registrering"){ $matpost = $query[1]; - echo(" + echo(" # - Startnummer Navn - 1. matpost - 2. matpost - Mål - "); + Tid + + + "); for ($i = 0; $i < count($runners); $i++) { $runner = $runners[$i]; - $tid_1_mat = ""; - if ($runner->splits[0] != false) { - // https://www.php.net/manual/en/class.dateinterval.php - $tid_1_mat = $GLOBALS['start_time']->diff($runner->splits[0])->format('%H:%I:%S'); + + // Klokkeslett for denne posten + if ($runner->splits[$matpost-1] != false) { + $tid_passering = $GLOBALS['start_time']->diff($runner->splits[$matpost-1])->format('%H:%I:%S'); } - $tid_2_mat = ""; - if ($runner->splits[1] != false) { - $tid_2_mat = $GLOBALS['start_time']->diff($runner->splits[1])->format('%H:%I:%S'); - } - $tid_maal = ""; - if ($runner->splits[2] != false) { - $tid_maal = $GLOBALS['start_time']->diff($runner->splits[2])->format('%H:%I:%S'); + else { + $tid_passering = ""; } + if ($runner->get_control() == $matpost-1) { // Løperen har vært på denne matposten og vi farger raden grønn $button = ""; @@ -159,8 +154,9 @@ if ($query[0] == "registrering"){ $button = ""; $cssclass = ""; } - echo ("". $i+1 .".$runner->id$runner->name$tid_1_mat$tid_2_mat$tid_maal$button\n"); + echo ("$runner->id$runner->name$tid_passering$button\n"); } + echo(""); } elseif ($query[0] == "paameldte") { usort($runners, "cmp_course"); @@ -177,7 +173,7 @@ elseif ($query[0] == "paameldte") { } echo("
-
$kadaverløpere påmeldte i Kadaverløpet
$minikadaverløpere påmeldte i Minikadaver'n
+
$kadaverløpere påmeldt Kadaverløpet
$minikadaverløpere påmeldte i Minikadaver'n
"); echo(" diff --git a/registrering.php b/registrering.php index 1c9c657..3406c8a 100644 --- a/registrering.php +++ b/registrering.php @@ -7,23 +7,29 @@ +
+Passord +
Velg post
- +
- -
- - - -
- - + +
- \ No newline at end of file + + \ No newline at end of file diff --git a/upload.php b/upload.php index db2df82..8558176 100644 --- a/upload.php +++ b/upload.php @@ -2,7 +2,16 @@ $control = $_POST['control']; $runner_id = $_POST['id']; $time = $_POST['time']; -$file = 'passering.csv'; -$current = file_get_contents($file); -$current .= $control . "," . $runner_id . "," . $time . "\n"; -file_put_contents($file, $current); \ No newline at end of file +$password = $_POST['password']; + +$hash = file_get_contents("hash.txt"); + +if (!password_verify($password, $hash)) { + http_response_code(response_code: 401); +} +else { + $file = 'passering.csv'; + $current = file_get_contents($file); + $current .= $control . "," . $runner_id . "," . $time . "\n"; + file_put_contents($file, $current); +}