Compare commits

...

6 Commits

Author SHA1 Message Date
fdfa3b2c50 Oppdaterte filsti 2023-11-27 14:06:48 +01:00
e6d44dca6d Update README.md 2023-11-21 21:59:04 +00:00
dcd70bf14a Oppdaterte readme 2023-11-20 14:27:30 +01:00
be2ba78336 La til Ås NMBU logo 2023-11-20 14:27:11 +01:00
54bc29756f Fiksa strekktidsvisninga for diska løpere 2023-11-08 17:37:07 +01:00
4e20399114 Endra git urlen i footeren 2023-11-08 17:36:43 +01:00
6 changed files with 13 additions and 15 deletions

View File

@@ -1,2 +1,4 @@
# Simple-Liveresults
# Simple Liveresults
Enkel nettside som leser inn `results\results.xml` og lager tabeller med resultater og strekktider. Sida laster automatisk inn fila på nytt når den endres.
Koden er ikke spesielt elegant eller lesbar, men gjør jobben uten biblioteker og annen møkk.

BIN
common/ås.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@@ -6,7 +6,7 @@
<meta name="theme-color" content="#1a237e">
<title>Liveresultater</title>
<link rel="icon" type="image/png" href="./common/kok-144x144.png">
<link rel="icon" type="image/png" href="./common/ås.png">
<link rel="stylesheet" href="common/main.css">
</head>
@@ -14,7 +14,7 @@
<header class="shadow-8">
<div class='header-column'>
<div>
<img src="./common/kok-144x144.png" width="30" height="30" class="d-inline-block align-top" alt="" loading="lazy">
<img src="./common/ås.png" width="30" height="30" class="d-inline-block align-top" alt="" loading="lazy">
</div>
<div id="header-brand">
</div>
@@ -50,7 +50,7 @@
</div>
</div>
<footer><p>Denne sida er fri programmvare under <a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL 3.0</a>. Kildekoden er tilgjengelig <a href="https://gitlab.com/Trygve/simple-liveresults">her</a>. </p></footer>
<footer><p>Denne sida er fri programmvare under <a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL 3.0</a>. Kildekoden er tilgjengelig <a href="https://git.willy.club/Trygve/simple-liveresults">her</a>. </p></footer>
<script src="ui.js"></script>
<script src="liveresults.js"></script>
</body>

View File

@@ -177,7 +177,7 @@ function loadresults() {
}
}
}
else if (typeof(xmlObj.ClassResult[i].PersonResult[k])!== 'undefined' && typeof(xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime)!== 'undefined' && persStatus == 'Disqualified'){
else if (typeof(xmlObj.ClassResult[i].PersonResult[k])!== 'undefined' && typeof(xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime)!== 'undefined' && persStatus == 'MissingPunch'){
splitTimes += '<tr><td>' + xmlObj.ClassResult[i].PersonResult[k].Person.Name.Given + " " + xmlObj.ClassResult[i].PersonResult[k].Person.Name.Family + "(DSQ)</td>";
let controlTimeDelta = 0;
@@ -189,13 +189,9 @@ function loadresults() {
controlTimeDelta += controlTime;
splitTimes += '<td>'+ TimeFormater(controlTime) +'<br>'+ TimeFormater(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time)+'</td>'
}
}
}
else {
splitTimes += '<td></td>'
}
}
}
else {splitTimes += '<td></td>'}
}}}
}
splitTimes += '</tr>';
}

View File

@@ -16,7 +16,7 @@ header('Access-Control-Expose-Headers: X-Events');
include 'lastSavedChange.php';
$resultFile = "resultater/Resultater.xml";
$resultFile = "resultater/results.xml";
//load variable from last check
$lastChange = filemtime($resultFile);
$time = date('r');
@@ -31,7 +31,7 @@ if ($lastSavedChange<$lastChange){
$var_str = var_export($lastChange, true);
$var = "<?php\n\n\$lastSavedChange = $var_str;\n\n?>";
file_put_contents('lastSavedChange.php', $var, LOCK_EX);
$objXmlDocument = simplexml_load_file("resultater/Resultater.xml");
$objXmlDocument = simplexml_load_file("resultater/results.xml");
//xml to json
if ($objXmlDocument === FALSE) {

View File

@@ -1,6 +1,6 @@
<?php
libxml_use_internal_errors(TRUE);
$objXmlDocument = simplexml_load_file("resultater/Resultater.xml");
$objXmlDocument = simplexml_load_file("resultater/results.xml");
if ($objXmlDocument === FALSE) {
foreach(libxml_get_errors() as $error) {