Compare commits
6 Commits
150d6cb931
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| fdfa3b2c50 | |||
| e6d44dca6d | |||
| dcd70bf14a | |||
| be2ba78336 | |||
| 54bc29756f | |||
| 4e20399114 |
@@ -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
BIN
common/ås.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
@@ -6,7 +6,7 @@
|
|||||||
<meta name="theme-color" content="#1a237e">
|
<meta name="theme-color" content="#1a237e">
|
||||||
<title>Liveresultater</title>
|
<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">
|
<link rel="stylesheet" href="common/main.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<header class="shadow-8">
|
<header class="shadow-8">
|
||||||
<div class='header-column'>
|
<div class='header-column'>
|
||||||
<div>
|
<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>
|
||||||
<div id="header-brand">
|
<div id="header-brand">
|
||||||
</div>
|
</div>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</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="ui.js"></script>
|
||||||
<script src="liveresults.js"></script>
|
<script src="liveresults.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -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>";
|
splitTimes += '<tr><td>' + xmlObj.ClassResult[i].PersonResult[k].Person.Name.Given + " " + xmlObj.ClassResult[i].PersonResult[k].Person.Name.Family + "(DSQ)</td>";
|
||||||
let controlTimeDelta = 0;
|
let controlTimeDelta = 0;
|
||||||
|
|
||||||
@@ -189,13 +189,9 @@ function loadresults() {
|
|||||||
controlTimeDelta += controlTime;
|
controlTimeDelta += controlTime;
|
||||||
splitTimes += '<td>'+ TimeFormater(controlTime) +'<br>'+ TimeFormater(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time)+'</td>'
|
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>';
|
splitTimes += '</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ header('Access-Control-Expose-Headers: X-Events');
|
|||||||
|
|
||||||
include 'lastSavedChange.php';
|
include 'lastSavedChange.php';
|
||||||
|
|
||||||
$resultFile = "resultater/Resultater.xml";
|
$resultFile = "resultater/results.xml";
|
||||||
//load variable from last check
|
//load variable from last check
|
||||||
$lastChange = filemtime($resultFile);
|
$lastChange = filemtime($resultFile);
|
||||||
$time = date('r');
|
$time = date('r');
|
||||||
@@ -31,7 +31,7 @@ if ($lastSavedChange<$lastChange){
|
|||||||
$var_str = var_export($lastChange, true);
|
$var_str = var_export($lastChange, true);
|
||||||
$var = "<?php\n\n\$lastSavedChange = $var_str;\n\n?>";
|
$var = "<?php\n\n\$lastSavedChange = $var_str;\n\n?>";
|
||||||
file_put_contents('lastSavedChange.php', $var, LOCK_EX);
|
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
|
//xml to json
|
||||||
if ($objXmlDocument === FALSE) {
|
if ($objXmlDocument === FALSE) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
libxml_use_internal_errors(TRUE);
|
libxml_use_internal_errors(TRUE);
|
||||||
$objXmlDocument = simplexml_load_file("resultater/Resultater.xml");
|
$objXmlDocument = simplexml_load_file("resultater/results.xml");
|
||||||
|
|
||||||
if ($objXmlDocument === FALSE) {
|
if ($objXmlDocument === FALSE) {
|
||||||
foreach(libxml_get_errors() as $error) {
|
foreach(libxml_get_errors() as $error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user