Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <?php
- $rubik_class = new DOTNET ( "Rubik.Dfi.DisplayInfo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f010a60e1fcd77e1", "Rubik.Dfi.DisplayInfo.DFIProvider" );
- $num_linien = $rubik_class->GetLinienAnzahl ();
- $num_page = intval ( $num_linien / 6 );
- if ($num_linien != $num_page * 6) {
- $num_page ++;
- }
- ?>
- <head>
- <style>
- body, html{
- height: 100%;
- }
- table {
- border-collapse: collapse;
- }
- td, th {
- vertical-align: center;
- }
- td {
- border: 8px solid white;
- font-weight: bold;
- }
- #bahnanzeige {
- font-family: Arial;
- width: 100%;
- height:100%;
- }
- #bahnanzeige td, #bahnanzeige th {
- font-size: 45px;
- }
- #bahnanzeige th {
- font-size: 45px;
- background-color: #1E32C4;
- color: #ffffff;
- }
- .page {
- top: 0;
- left: 0;
- width: 100%;
- position: absolute;
- height:100%;
- display: none;
- overflow: hidden;
- border: 0;
- }
- .currentPage {
- display: block;
- }
- </style>
- </head>
- <body>
- <script>
- var TIME_PER_PAGE = 2000;
- window.onload = function() {
- var pages = document.querySelectorAll('.page'),
- numPages = pages ? pages.length : 0;
- i = -1;
- function nextPage() {
- if (i >= 0)
- pages[i].classList.remove('currentPage');
- i++;
- if (i <= numPages - 1) {
- pages[i].classList.add('currentPage');
- setTimeout(nextPage, TIME_PER_PAGE);
- } else {
- i = 0;
- pages[i].classList.add('currentPage');
- setTimeout(nextPage, TIME_PER_PAGE);
- }
- }
- nextPage();
- }
- </script>
- <?php
- for($p = 0; $p < $num_page; $p ++) {
- ?>
- <div class="page">
- <!--the width of the columns in relation to each other.-->
- <table id="bahnanzeige">
- <tr height =15%>
- <!-- insert the picture on the first row, first column -->
- <th><img src="ovr_logo.png" alt="logo from ovr"
- style="width: 238.95px; height: 86.85px"></th>
- <?php
- // displays the time on the header
- echo "<th>";
- echo date ( "H:i" );
- echo "</th>";
- ?>
- <th text align=right>Abfahrt </th>
- <?php
- $linien_page = 6;
- if ($p == $num_page - 1) {
- $linien_page = $num_linien - 6 * ($num_page - 1);
- }
- for($i = 0; $i < $linien_page; $i ++) {
- $linie = $rubik_class->GetLinie ( 6 * $p + $i );
- echo "<tr height =15%>";
- echo "<td bgcolor = #FCCE4C text align =center width=10%>";
- echo $linie->Nummer;
- // first column of the table
- echo "</td>";
- echo "<td text align =left width=70%>";
- echo $linie->Endhalt;
- // second column of the table
- echo "</td>";
- if ($linie->Abfahrtszeit < 30)
- // Last column. It shows the time left until departure.
- // If departure time is over 30 min away, it will show the time itself
- {
- echo "<td text align =right width=20%>";
- echo $linie->Abfahrtszeit;
- } else {
- $uhrzeit = date ( "H:i" );
- $teile = explode ( ':', $uhrzeit );
- $uhr = date ( "H:i", mktime ( date ( "$teile[0]" ), date ( "$teile[1]" ) + $linie->Abfahrtszeit ) );
- echo "<td text align =right>";
- echo $uhr;
- }
- echo "</td>";
- echo "</tr>";
- }
- ?>
- </table>
- </div>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement