Commit 14f9bf9c authored by Bc. Vladimír Kušnirák's avatar Bc. Vladimír Kušnirák
Browse files

Showing current time, style change soon

parent 373b0a05
Pipeline #12825 passed with stage
in 1 minute and 10 seconds
......@@ -96,6 +96,19 @@ $time_leaving = 20;
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
var showTime = function() {
$('#time').text(new Date().toLocaleTimeString());
};
setInterval(showTime,200);
});
</script>
<!DOCTYPE html>
<html>
<head>
......@@ -106,7 +119,7 @@ $time_leaving = 20;
<meta http-equiv="refresh" content="60">
<body>
<h3>Odchody vlakov zo stanice KOŠICE</h3>
<h3>Odchody vlakov zo stanice KOŠICE <span id="time">&nbsp;</span> </h3>
<table class="responstable">
<thead>
<tr>
......@@ -124,19 +137,19 @@ $time_leaving = 20;
<tbody>
<?php
if ( ((strtotime($first_row[0]) - time())/60 <= $time_leaving) and ((strtotime($first_row[0]) - time())/60 >= -60) ){
echo '<tr class="leaving">';
} else {
echo '<tr>';
}
if ( ((strtotime($first_row[0]) - time())/60 <= $time_leaving) and ((strtotime($first_row[0]) - time())/60 >= -60) ){
echo '<tr class="leaving">';
} else {
echo '<tr>';
}
?>
<?php
$first = true;
foreach ($first_row as $item) {
echo '<td>' . $item . '</td>';
}
?>
<?php
$first = true;
foreach ($first_row as $item) {
echo '<td>' . $item . '</td>';
}
?>
</tr>
<?php
......@@ -147,11 +160,11 @@ $time_leaving = 20;
}
?>
<?php
foreach ($second_row as $item) {
echo '<td>' . $item . '</td>';
}
?>
<?php
foreach ($second_row as $item) {
echo '<td>' . $item . '</td>';
}
?>
</tr>
......@@ -162,11 +175,11 @@ $time_leaving = 20;
echo '<tr>';
}
?>
<?php
foreach ($third_row as $item) {
echo '<td>' . $item . '</td>';
}
?>
<?php
foreach ($third_row as $item) {
echo '<td>' . $item . '</td>';
}
?>
</tr>
<tr>
<?php
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment