Switch order of events and components on public tracking page

This commit is contained in:
Skylar Ittner 2020-06-07 20:53:13 -06:00
parent e66a35d156
commit 82eef074d2

View File

@ -246,6 +246,28 @@ if (isset($_GET["backgroundcolor"]) && !empty($_GET["backgroundcolor"]) && preg_
</div>
<?php
$history = $machine->getEvents();
if (count($history) > 0) {
?>
<div class="col-sm-6 mb-3">
<h6>Events:</h6>
<div class="list-group">
<?php
foreach ($history as $h) {
echo "<div class=\"list-group-item\">\n";
echo "<b>" . $h->getName() . "</b> on " . date($SETTINGS["datetime_format"], strtotime($h->getDate())) . "<br />\n";
if (!empty($h->getPublicNotes())) {
echo "<div><b>Notes:</b><br /><div class=\"ml-3\">" . htmlspecialchars($h->getPublicNotes()) . "</div></div>";
}
echo "\n</div>\n";
}
?>
</div>
</div>
<?php
}
$components = $machine->getComponents();
if (count($components) > 0) {
@ -309,29 +331,6 @@ if (isset($_GET["backgroundcolor"]) && !empty($_GET["backgroundcolor"]) && preg_
</div>
<?php
}
$history = $machine->getEvents();
if (count($history) > 0) {
?>
<div class="col-sm-6 mb-3">
<h6>Events:</h6>
<div class="list-group">
<?php
foreach ($history as $h) {
echo "<div class=\"list-group-item\">\n";
echo "<b>" . $h->getName() . "</b> on " . date($SETTINGS["datetime_format"], strtotime($h->getDate())) . "<br />\n";
if (!empty($h->getPublicNotes())) {
echo "<div><b>Notes:</b><br /><div class=\"ml-3\">" . htmlspecialchars($h->getPublicNotes()) . "</div></div>";
}
echo "\n</div>\n";
}
?>
</div>
</div>
<?php
}
?>
</div>
</div>