Compare commits
3 Commits
5b62326c42
...
6825e90568
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6825e90568 | ||
|
|
5f377cf811 | ||
|
|
2aff55b50d |
14
admin.php
14
admin.php
@ -33,10 +33,10 @@
|
|||||||
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</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="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li>
|
||||||
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
||||||
<li class="selected">⏳️ Nedtelling matpost
|
<li class="disabled">⏳️ Nedtelling matpost
|
||||||
<menu>
|
<menu>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
||||||
</menu>
|
</menu>
|
||||||
</li>
|
</li>
|
||||||
</menu>
|
</menu>
|
||||||
@ -48,7 +48,7 @@ include("api/statistics.php");
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<h1>Søk opp løper</h1>
|
<h1>Søk opp løper</h1>
|
||||||
<form action="/api/runner.php" method="GET" hx-boost="true" hx-target="#runner" hx-swap="show:none">
|
<form action="/api/runner.php" method="GET" hx-boost="true" hx-target="#runner" hx-swap="show:none" hx-headers='js:{"Password": localStorage.getItem("passord")}'>
|
||||||
<label>
|
<label>
|
||||||
Navn, startnummer eller klubb
|
Navn, startnummer eller klubb
|
||||||
<input type="text" name="search" id="search">
|
<input type="text" name="search" id="search">
|
||||||
@ -57,9 +57,9 @@ include("api/statistics.php");
|
|||||||
</form>
|
</form>
|
||||||
<div id="runner" class="profile-card"></div>
|
<div id="runner" class="profile-card"></div>
|
||||||
|
|
||||||
<button hx-get="/api/email.php" hx-target="#emails" hx-headers='js:{"password": localStorage.getItem("passord")}'>hent alle eposter</button>
|
<button hx-get="/api/email.php" hx-target="#emails" hx-headers='js:{"Password": localStorage.getItem("passord")}'>hent alle eposter</button>
|
||||||
<button hx-get="/api/email.php?course=Kadaverløpet" hx-target="#emails" hx-headers='js:{"password": localStorage.getItem("passord")}'>Hent bare eposter for fullkadavern</button>
|
<button hx-get="/api/email.php?course=Kadaverløpet" hx-target="#emails" hx-headers='js:{"Password": localStorage.getItem("passord")}'>Hent bare eposter for fullkadavern</button>
|
||||||
<button hx-get="/api/email.php?course=Minikadaver'n" hx-target="#emails" hx-headers='js:{"password": localStorage.getItem("passord")}'>Hent bare eposter for minikadaver'n</button>
|
<button hx-get="/api/email.php?course=Minikadaver'n" hx-target="#emails" hx-headers='js:{"Password": localStorage.getItem("passord")}'>Hent bare eposter for minikadaver'n</button>
|
||||||
<div class="flash default">
|
<div class="flash default">
|
||||||
<output id="emails"></output>
|
<output id="emails"></output>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -18,12 +18,15 @@ function write_ini_file($assoc_array, $path) {
|
|||||||
|
|
||||||
$config = parse_ini_file("$documentRoot/data/config.ini");
|
$config = parse_ini_file("$documentRoot/data/config.ini");
|
||||||
|
|
||||||
$hash = file_get_contents("$documentRoot/data/hash.txt");
|
include("$documentRoot/data/hash.php");
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
if ($method == "POST") {
|
if ($method == "POST") {
|
||||||
$start_time = $_POST['start_time'];
|
$start_time = $_POST['start_time'];
|
||||||
|
$start_time_mini = $_POST['mini_time'];
|
||||||
|
|
||||||
|
$password = $_POST['Password'];
|
||||||
|
$password = getallheaders()['Password'];
|
||||||
|
|
||||||
$password = $_POST['password'];
|
|
||||||
|
|
||||||
$new_time = DateTime::createFromFormat(DateTime::ISO8601, $start_time. "+01");
|
$new_time = DateTime::createFromFormat(DateTime::ISO8601, $start_time. "+01");
|
||||||
if (!password_verify($password, $hash)) {
|
if (!password_verify($password, $hash)) {
|
||||||
@ -35,13 +38,30 @@ if ($method == "POST") {
|
|||||||
|
|
||||||
$file = "$documentRoot/data/config.ini";
|
$file = "$documentRoot/data/config.ini";
|
||||||
$config["start_date"] = $start_time . "+01";
|
$config["start_date"] = $start_time . "+01";
|
||||||
|
$config["start_date_mini"] = $start_time_mini . "+01";
|
||||||
write_ini_file($config, $file);
|
write_ini_file($config, $file);
|
||||||
header("HX-Replace-Url: false");
|
header("HX-Replace-Url: false");
|
||||||
echo("Starttida er oppdatert til: $start_time");
|
echo("Starttida er oppdatert til: $start_time for Kadaver'n <br> $start_time_mini for Minikadaer'n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($method == "GET"){
|
elseif ($method == "GET"){
|
||||||
print($config["start_date"]);
|
$start_kadaver = explode("+", $config["start_date"])[0];
|
||||||
|
$start_mini = explode("+", $config["start_date_mini"])[0];
|
||||||
|
$response = "
|
||||||
|
<form action='/api/config.php' method='POST' hx-boost='true' hx-target='#updated' hx-swap='show:none' hx-headers='js:{\"Password\": localStorage.getItem(\"passord\")}'>
|
||||||
|
<label>
|
||||||
|
Starttid Kadaverløpet
|
||||||
|
<input type='datetime-local' id='start_time' name='start_time' step='1' value='$start_kadaver'>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
Starttid Minikadaver'n
|
||||||
|
<input type='datetime-local' id='mini_time' name='mini_time' step='1' value='$start_mini'>
|
||||||
|
</label>
|
||||||
|
<button type='submit'>Oppdater</button>
|
||||||
|
</form>
|
||||||
|
<div id='updated'></div>
|
||||||
|
";
|
||||||
|
echo($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
||||||
include("$documentRoot/import_runners.php");
|
include("$documentRoot/import_runners.php");
|
||||||
$hash = file_get_contents("$documentRoot/data/hash.txt");
|
include("$documentRoot/data/hash.php");
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
if ($method == "GET") {
|
if ($method == "GET") {
|
||||||
parse_str($_SERVER['QUERY_STRING'], $query);
|
parse_str($_SERVER['QUERY_STRING'], $query);
|
||||||
$course = $query['course'];
|
$course = $query['course'];
|
||||||
$password = getallheaders()['password'];
|
$password = getallheaders()['Password'];
|
||||||
if (!password_verify($password, $hash)) {
|
if (!password_verify($password, $hash)) {
|
||||||
http_response_code(response_code: 401);
|
http_response_code(response_code: 401);
|
||||||
}
|
} else {
|
||||||
$runners = read_runners_from_csv();
|
$runners = read_runners_from_csv();
|
||||||
$emails = "";
|
$emails = "";
|
||||||
for ($i = 0; $i < count($runners); $i++) {
|
for ($i = 0; $i < count($runners); $i++) {
|
||||||
@ -22,4 +22,5 @@ if ($method == "GET") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo($emails);
|
echo($emails);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,18 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
||||||
print_r($documentRoot);
|
include("$documentRoot/data/hash.php");
|
||||||
$hash = file_get_contents("$documentRoot/data/hash.txt");
|
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
if ($method == "POST") {
|
if ($method == "POST") {
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
|
|
||||||
if (!password_verify($password, $hash)) {
|
if (!password_verify($password, $hash)) {
|
||||||
http_response_code(response_code: 401);
|
http_response_code(response_code: 401);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
http_response_code(response_code: 200);
|
http_response_code(response_code: 200);
|
||||||
}
|
}
|
||||||
}
|
}else {
|
||||||
else {
|
|
||||||
http_response_code(response_code: 405);
|
http_response_code(response_code: 405);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ $runner_id = $_POST['id'];
|
|||||||
$time = $_POST['time'];
|
$time = $_POST['time'];
|
||||||
$password = $_POST['password'];
|
$password = $_POST['password'];
|
||||||
|
|
||||||
$hash = file_get_contents("$documentRoot/data/hash.txt");
|
include("$documentRoot/data/hash.php");
|
||||||
|
|
||||||
if (!password_verify($password, $hash)) {
|
if (!password_verify($password, $hash)) {
|
||||||
http_response_code(response_code: 401);
|
http_response_code(response_code: 401);
|
||||||
|
|||||||
@ -3,7 +3,7 @@ $documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
|||||||
include("$documentRoot/import_runners.php");
|
include("$documentRoot/import_runners.php");
|
||||||
|
|
||||||
|
|
||||||
$hash = file_get_contents("$documentRoot/data/hash.txt");
|
include("$documentRoot/data/hash.php");
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
if ($method == "POST") {
|
if ($method == "POST") {
|
||||||
$runner_id = $_POST['id'];
|
$runner_id = $_POST['id'];
|
||||||
@ -37,6 +37,10 @@ if ($method == "POST") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($method == "PATCH") {
|
if ($method == "PATCH") {
|
||||||
|
$password = getallheaders()['Password'];
|
||||||
|
if (!password_verify($password, $hash)) {
|
||||||
|
http_response_code(response_code: 401);
|
||||||
|
} else {
|
||||||
parse_str(file_get_contents('php://input'), $_PATCH);
|
parse_str(file_get_contents('php://input'), $_PATCH);
|
||||||
$line = $_PATCH["id"] . ";;" . $_PATCH["name"] . ";" . $_PATCH["email"] . ";" . $_PATCH["phone"] . ";" . $_PATCH["club"] . ";" . $_PATCH["course"] . ";;;\n";
|
$line = $_PATCH["id"] . ";;" . $_PATCH["name"] . ";" . $_PATCH["email"] . ";" . $_PATCH["phone"] . ";" . $_PATCH["club"] . ";" . $_PATCH["course"] . ";;;\n";
|
||||||
|
|
||||||
@ -59,17 +63,25 @@ if ($method == "PATCH") {
|
|||||||
echo("<span class='bg-success'>Endret: $line</span>");
|
echo("<span class='bg-success'>Endret: $line</span>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($method == "GET") {
|
if ($method == "GET") {
|
||||||
|
$password = getallheaders()['Password'];
|
||||||
|
if (!password_verify($password, $hash)) {
|
||||||
|
http_response_code(response_code: 401);
|
||||||
|
} else {
|
||||||
parse_str($_SERVER['QUERY_STRING'], $query);
|
parse_str($_SERVER['QUERY_STRING'], $query);
|
||||||
|
|
||||||
$runners = read_runners_from_csv();
|
$runners = read_runners_from_csv();
|
||||||
$filtered = search_for_runner($runners, $query['search']);
|
$filtered = search_for_runner($runners, $query['search']);
|
||||||
|
if (isset($query['get'])) {
|
||||||
|
$filtered = [get_runner($runners,$query['get'])];
|
||||||
|
}
|
||||||
if (count($filtered) == 1 && $query['edit'] == "true") {
|
if (count($filtered) == 1 && $query['edit'] == "true") {
|
||||||
$r = $filtered[0];
|
$r = $filtered[0];
|
||||||
$response .= "
|
$response .= "
|
||||||
<h2>Endre $r->id $r->name</h2>
|
<h2>Endre $r->id $r->name</h2>
|
||||||
<form hx-patch='/api/runner.php'>
|
<form hx-patch='/api/runner.php' hx-headers='js:{\"Password\": localStorage.getItem(\"passord\")}'>
|
||||||
<label>Startnummer<input type='number' id='id' name='id' required value='$r->id'></label>
|
<label>Startnummer<input type='number' id='id' name='id' required value='$r->id'></label>
|
||||||
<label>Navn<input type='text' id='name' name='name' required value='$r->name'></label>
|
<label>Navn<input type='text' id='name' name='name' required value='$r->name'></label>
|
||||||
<label>Forening<input type='text' id='club' name='club' required value='$r->club'></label>
|
<label>Forening<input type='text' id='club' name='club' required value='$r->club'></label>
|
||||||
@ -111,11 +123,11 @@ if ($method == "GET") {
|
|||||||
for ($i = 0; $i < count($filtered); $i++) {
|
for ($i = 0; $i < count($filtered); $i++) {
|
||||||
$runner = $filtered[$i];
|
$runner = $filtered[$i];
|
||||||
if ($query['edit'] == "true") {
|
if ($query['edit'] == "true") {
|
||||||
$url = "/api/runner.php?search=$runner->id&edit=true";
|
$url = "/api/runner.php?get=$runner->id&edit=true";
|
||||||
} else {
|
} else {
|
||||||
$url = "/api/runner.php?search=$runner->id";
|
$url = "/api/runner.php?get=$runner->id";
|
||||||
}
|
}
|
||||||
$response .= "<button class=\"default\" hx-get=\"$url\" hx-target=\"#runner\" hx-swap=\"show:none\">$runner->id $runner->name</button>";
|
$response .= "<button class=\"default\" hx-get=\"$url\" hx-target=\"#runner\" hx-swap=\"show:none\" hx-headers='js:{\"Password\": localStorage.getItem(\"passord\")}'>$runner->id $runner->name</button>";
|
||||||
header("HX-Replace-Url: false");
|
header("HX-Replace-Url: false");
|
||||||
}
|
}
|
||||||
echo($response);
|
echo($response);
|
||||||
@ -123,5 +135,5 @@ if ($method == "GET") {
|
|||||||
else{
|
else{
|
||||||
echo("Ingen resultater...");
|
echo("Ingen resultater...");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -4,6 +4,7 @@ $documentRoot = $_SERVER['DOCUMENT_ROOT'];
|
|||||||
$config = parse_ini_file("$documentRoot/data/config.ini");
|
$config = parse_ini_file("$documentRoot/data/config.ini");
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
$GLOBALS['start_time'] = DateTime::createFromFormat(DateTime::ISO8601, $config["start_date"]);
|
$GLOBALS['start_time'] = DateTime::createFromFormat(DateTime::ISO8601, $config["start_date"]);
|
||||||
|
$GLOBALS['start_time_mini'] = DateTime::createFromFormat(DateTime::ISO8601, $config["start_date_mini"]);
|
||||||
$GLOBALS['number_of_controls'] = 3;
|
$GLOBALS['number_of_controls'] = 3;
|
||||||
/*
|
/*
|
||||||
// Caching
|
// Caching
|
||||||
@ -165,7 +166,9 @@ function liveresult_table($runners) {
|
|||||||
$matposter = "<td>$tid_1_mat</td><td>$tid_2_mat</td>";
|
$matposter = "<td>$tid_1_mat</td><td>$tid_2_mat</td>";
|
||||||
}
|
}
|
||||||
if ($runner->course == "Kadaverløpet") {
|
if ($runner->course == "Kadaverløpet") {
|
||||||
$kadaver_table .= "<tr><td>". $kadaver_num .".</td><td>$runner->name</td>$matposter<td>$tid_maal</td><td>$tid_etter</td>$sprekk</tr>\n";
|
$runner_number = $kadaver_num .".";
|
||||||
|
if ($runner->get_control() == -1){$runner_number = "";};
|
||||||
|
$kadaver_table .= "<tr><td>". $runner_number ."</td><td>$runner->name</td>$matposter<td>$tid_maal</td><td>$tid_etter</td>$sprekk</tr>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$kadaver_table .= "</tbody></table>\n";
|
$kadaver_table .= "</tbody></table>\n";
|
||||||
@ -174,8 +177,8 @@ function liveresult_table($runners) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function minikadadvern_table($runners) {
|
function minikadadvern_table($runners) {
|
||||||
usort($runners, "cmp");
|
//usort($runners, "cmp");
|
||||||
usort($runners, "cmp_course");
|
//usort($runners, "cmp_course");
|
||||||
$minikadaver_table = "<table><thead>
|
$minikadaver_table = "<table><thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
@ -183,53 +186,18 @@ function minikadadvern_table($runners) {
|
|||||||
<th>Mål</th>
|
<th>Mål</th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody>";
|
<tbody>";
|
||||||
$kadaver_num = 0;
|
|
||||||
$mini_num = 0;
|
$mini_num = 0;
|
||||||
for ($i = 0; $i < count($runners); $i++) {
|
for ($i = 0; $i < count($runners); $i++) {
|
||||||
$runner = $runners[$i];
|
$runner = $runners[$i];
|
||||||
$tid_maal = "";
|
$tid_maal = "";
|
||||||
$sprekk = "<td></td>";
|
|
||||||
if ($runner->splits[2] != false) {
|
if ($runner->splits[2] != false) {
|
||||||
$tid_maal = $GLOBALS['start_time']->diff($runner->splits[2])->format('%H:%I:%S');
|
$tid_maal = $GLOBALS['start_time_mini']->diff($runner->splits[2])->format('%H:%I:%S');
|
||||||
}
|
}
|
||||||
if ($runner->course == "Kadaverløpet") {
|
if ($runner->course == "Minikadaver'n") {
|
||||||
$kadaver_num++;
|
|
||||||
$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');
|
|
||||||
}
|
|
||||||
$tid_2_mat = "";
|
|
||||||
|
|
||||||
//tid etter vinner
|
|
||||||
$tid_etter = "";
|
|
||||||
if ($runner->splits[2] != false && $kadaver_num > 0) {
|
|
||||||
$tid_etter = $runners[0]->splits[2]->diff($runner->splits[2])->format('%I:%S');
|
|
||||||
}
|
|
||||||
//sprekkindekss
|
|
||||||
if ($runner->splits[1] != false) {
|
|
||||||
$tid_2_mat = $GLOBALS['start_time']->diff($runner->splits[1])->format('%H:%I:%S');
|
|
||||||
try {
|
|
||||||
$sprekk = "<td>" . number_format(100*(time_diff($GLOBALS['start_time'],$runner->splits[2]) - time_diff($GLOBALS['start_time'],$runner->splits[1])) / time_diff($GLOBALS['start_time'],$runner->splits[2]), 0) . "%</td>";
|
|
||||||
}
|
|
||||||
catch (DivisionByZeroError $e){
|
|
||||||
$sprekk = "<td></td>";
|
|
||||||
}
|
|
||||||
catch (TypeError $e) {
|
|
||||||
$sprekk = "<td></td>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$matposter = "<td>$tid_1_mat</td><td>$tid_2_mat</td>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$mini_num++;
|
$mini_num++;
|
||||||
}
|
$runner_number = $mini_num . ".";
|
||||||
|
if ($runner->get_control() != 2){$runner_number = "";};
|
||||||
if ($runner->course == "Kadaverløpet") {
|
$minikadaver_table .= "<tr><td>". "$runner_number" ."</td><td>$runner->name</td><td>$tid_maal</td></tr>\n";
|
||||||
$kadaver_table .= "<tr><td>". $kadaver_num .".</td><td>$runner->name</td>$matposter<td>$tid_maal</td><td>$tid_etter</td>$sprekk</tr>\n";
|
|
||||||
}
|
|
||||||
elseif ($runner->course == "Minikadaver'n") {
|
|
||||||
$minikadaver_table .= "<tr><td>". "" .".</td><td>$runner->name</td><td>$tid_maal</td></tr>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$minikadaver_table .= "</tbody></table>";
|
$minikadaver_table .= "</tbody></table>";
|
||||||
|
|||||||
@ -19,26 +19,17 @@
|
|||||||
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</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="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li>
|
||||||
<li class="selected"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
<li class="selected"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
||||||
<li class="selected">⏳️ Nedtelling matpost
|
<li class="disabled">⏳️ Nedtelling matpost
|
||||||
<menu>
|
<menu>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
||||||
</menu>
|
</menu>
|
||||||
</li>
|
</li>
|
||||||
</menu>
|
</menu>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<h2>Sett dato og tid startskuddet gikk:</h2>
|
<h2>Sett dato og tid startskuddet gikk:</h2>
|
||||||
<form action="/api/config.php" method="POST" hx-boost="true" hx-target="#updated" hx-swap="show:none">
|
<div hx-get="/api/config.php" hx-swap="outerHTML" hx-trigger="load"></div>
|
||||||
<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 id="updated"></div>
|
|
||||||
</div>
|
|
||||||
<script>
|
<script>
|
||||||
function log_out(){
|
function log_out(){
|
||||||
localStorage.removeItem("navn");
|
localStorage.removeItem("navn");
|
||||||
|
|||||||
@ -19,16 +19,16 @@
|
|||||||
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</a></li>
|
<li class="disabled"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</a></li>
|
||||||
<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>
|
||||||
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
||||||
<li class="selected">⏳️ Nedtelling matpost
|
<li class="disabled">⏳️ Nedtelling matpost
|
||||||
<menu>
|
<menu>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
||||||
</menu>
|
</menu>
|
||||||
</li>
|
</li>
|
||||||
</menu>
|
</menu>
|
||||||
</nav>
|
</nav>
|
||||||
<h2>Legg til løper</h2>
|
<h2>Legg til løper</h2>
|
||||||
<form action="/api/runner.php" method="POST" hx-boost="true" hx-target="#updated" hx-swap="show:none">
|
<form action="/api/runner.php" method="POST" hx-boost="true" hx-target="#updated" hx-swap="show:none" hx-headers='js:{"Password": localStorage.getItem("passord")}'>
|
||||||
<input style="display: none;" type="text" id="password" name="password" required>
|
<input style="display: none;" type="text" id="password" name="password" required>
|
||||||
|
|
||||||
<label for="id">Startnummer:
|
<label for="id">Startnummer:
|
||||||
@ -56,7 +56,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<div id="updated"></div>
|
<div id="updated"></div>
|
||||||
<h2>Endre løper</h2>
|
<h2>Endre løper</h2>
|
||||||
<form action="/api/runner.php" method="GET" hx-boost="true" hx-target="#runner" hx-swap="show:none">
|
<form action="/api/runner.php" method="GET" hx-boost="true" hx-target="#runner" hx-swap="show:none" hx-headers='js:{"Password": localStorage.getItem("passord")}'>
|
||||||
<input type="hidden" id="edit" name="edit" value="true">
|
<input type="hidden" id="edit" name="edit" value="true">
|
||||||
<label>
|
<label>
|
||||||
Søk etter navn, startnummer eller klubb
|
Søk etter navn, startnummer eller klubb
|
||||||
|
|||||||
@ -34,13 +34,17 @@ class Runner
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_control(){
|
function get_control(){
|
||||||
$control = -1;
|
if ($this->splits[2] != false) {
|
||||||
for ($i = 0; $i < count($this->splits); $i++) {
|
return 2;
|
||||||
if ($this->splits[$i] != false) {
|
} elseif ($this->splits[1] != false) {
|
||||||
$control++;
|
return 1;
|
||||||
}
|
}
|
||||||
|
elseif ($this->splits[0] != false) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
return $control;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,8 +50,8 @@
|
|||||||
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
||||||
<li class="selected">⏳️ Nedtelling matpost
|
<li class="selected">⏳️ Nedtelling matpost
|
||||||
<menu>
|
<menu>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
||||||
</menu>
|
</menu>
|
||||||
</li>
|
</li>
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
<h1>Påmeldte Kadaverløpet 2025</h1>
|
<h1>Påmeldte Kadaverløpet 2025</h1>
|
||||||
</div>
|
</div>
|
||||||
<h2>Oppdatert 28.10.25</h2>
|
<h2>Oppdatert 28.10.25</h2>
|
||||||
<div class="flash attention">Startnummer blir tildelt nærmere arrangementet. Prøver å oppdatere lista jevnlig. TBN</div>
|
|
||||||
<?php
|
<?php
|
||||||
$query = ["type"=>"paameldte"];
|
$query = ["type"=>"paameldte"];
|
||||||
include("api/table.php");
|
include("api/table.php");
|
||||||
|
|||||||
@ -53,10 +53,10 @@
|
|||||||
<li class="selected"><a href="/registrering.php">⏱️ Registrer passering på matpost/mål</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>
|
<li class="disabled"><a href="/db_editor.html">👥 Endre løperbase</a></li>
|
||||||
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
<li class="disabled"><a href="/config_editor.html">⚙️ Konfigurasjon</a></li>
|
||||||
<li class="selected">⏳️ Nedtelling matpost
|
<li class="disabled">⏳️ Nedtelling matpost
|
||||||
<menu>
|
<menu>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=0">1. mat</a></li>
|
||||||
<li><a href="http://localhost:8000/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
<li><a href="/matpost_nedtelling.php?matpost=1">2. mat</a></li>
|
||||||
</menu>
|
</menu>
|
||||||
</li>
|
</li>
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user