Commit cb934b5d authored by Bc. Matúš Bagoňa's avatar Bc. Matúš Bagoňa
Browse files

odchod o, zvyraznenie - bug fixes

parent c4660a0c
Pipeline #14704 passed with stage
in 1 minute and 1 second
This diff is collapsed.
......@@ -29,6 +29,8 @@ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$content = curl_exec($ch);
date_default_timezone_set('Europe/Bratislava');
if (curl_errno($ch)) {
echo 'error:' . curl_error($ch);
} else {
......@@ -39,66 +41,75 @@ if (curl_errno($ch)) {
$first_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[2]->td[0]) - time() );
array_push($first_row, $time_to_leave);
$time_to_leave = (strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[2]->td[0]) - time());
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($first_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[2]->td as $item) {
array_push($first_row, $item);
}
$second_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[3]->td[0]) - time() );
array_push($second_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[3]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($second_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[3]->td as $item) {
array_push($second_row, $item);
}
$third_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[4]->td[0]) - time() );
array_push($third_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[4]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($third_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[4]->td as $item) {
array_push($third_row, $item);
}
$fourth_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[5]->td[0]) - time() );
array_push($fourth_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[5]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($fourth_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[5]->td as $item) {
array_push($fourth_row, $item);
}
$fifth_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[6]->td[0]) - time() );
array_push($fifth_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[6]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($fifth_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[6]->td as $item) {
array_push($fifth_row, $item);
}
$sixth_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[7]->td[0]) - time() );
array_push($sixth_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[7]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($sixth_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[7]->td as $item) {
array_push($sixth_row, $item);
}
$seventh_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[8]->td[0]) - time() );
array_push($seventh_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[8]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($seventh_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[8]->td as $item) {
array_push($seventh_row, $item);
}
$eighth_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[9]->td[0]) - time() );
array_push($eighth_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[9]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($eighth_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[9]->td as $item) {
array_push($eighth_row, $item);
}
$ninth_row = array();
$time_to_leave = date("h:i",strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[10]->td[0]) - time() );
array_push($ninth_row, $time_to_leave);
$time_to_leave = strtotime($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[10]->td[0]) - time() ;
if ($time_to_leave <= 60) { $time_to_leave += 24*3600; }
array_push($ninth_row, sprintf("%'.02d:%'.02d", intdiv($time_to_leave, 3600), intdiv($time_to_leave%3600, 60)) );
foreach ($sxml->body->form->div[2]->div[1]->div[0]->div[0]->div[1]->div[1]->div->div->table->tr[10]->td as $item) {
array_push($ninth_row, $item);
}
......@@ -109,9 +120,9 @@ if (curl_errno($ch)) {
}
curl_close($ch);
date_default_timezone_set('Europe/Bratislava');
$time_leaving = 20;
$time_leaving = 30;
?>
......@@ -174,7 +185,7 @@ $time_leaving = 20;
<tbody>
<?php
if ( ((strtotime($first_row[0]) - time())/60 <= $time_leaving) and ((strtotime($first_row[0]) - time())/60 >= -60) ){
if ( ((strtotime($first_row[1]) - time())/60 <= $time_leaving) and ((strtotime($first_row[1]) - time())/60 >= -60) ){
echo '<tr class="leaving">';
} else {
echo '<tr>';
......@@ -190,7 +201,7 @@ $time_leaving = 20;
</tr>
<?php
if ( ((strtotime($second_row[0]) - time())/60 <= $time_leaving) and ((strtotime($second_row[0]) - time())/60 >= -60) ){
if ( ((strtotime($second_row[1]) - time())/60 <= $time_leaving) and ((strtotime($second_row[1]) - time())/60 >= -60) ){
echo '<tr class="leaving">';
} else {
echo '<tr>';
......@@ -206,7 +217,7 @@ $time_leaving = 20;
<?php
if ( ((strtotime($third_row[0]) - time())/60 <= $time_leaving) and ((strtotime($third_row[0]) - time())/60 >= -60) ){
if ( ((strtotime($third_row[1]) - time())/60 <= $time_leaving) and ((strtotime($third_row[1]) - time())/60 >= -60) ){
echo '<tr class="leaving">';
} else {
echo '<tr>';
......
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