Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <?php
  5. $rubik_class = new DOTNET ( "Rubik.Dfi.DisplayInfo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f010a60e1fcd77e1", "Rubik.Dfi.DisplayInfo.DFIProvider" );
  6. $num_linien = $rubik_class->GetLinienAnzahl ();
  7. $num_page = intval ( $num_linien / 6 );
  8. if ($num_linien != $num_page * 6) {
  9. $num_page ++;
  10. }
  11. ?>
  12.  
  13. <head>
  14. <style>
  15.  
  16.  
  17. body, html{
  18. height: 100%;
  19. }
  20.  
  21. table {
  22. border-collapse: collapse;
  23. }
  24.  
  25. td, th {
  26. vertical-align: center;
  27. }
  28.  
  29. td {
  30. border: 8px solid white;
  31. font-weight: bold;
  32.  
  33. }
  34.  
  35. #bahnanzeige {
  36. font-family: Arial;
  37. width: 100%;
  38. height:100%;
  39. }
  40.  
  41. #bahnanzeige td, #bahnanzeige th {
  42. font-size: 45px;
  43. }
  44.  
  45. #bahnanzeige th {
  46. font-size: 45px;
  47. background-color: #1E32C4;
  48. color: #ffffff;
  49. }
  50.  
  51. .page {
  52. top: 0;
  53. left: 0;
  54. width: 100%;
  55. position: absolute;
  56. height:100%;
  57. display: none;
  58. overflow: hidden;
  59. border: 0;
  60. }
  61.  
  62. .currentPage {
  63. display: block;
  64. }
  65. </style>
  66. </head>
  67.  
  68. <body>
  69.  
  70. <script>
  71. var TIME_PER_PAGE = 2000;
  72. window.onload = function() {
  73. var pages = document.querySelectorAll('.page'),
  74. numPages = pages ? pages.length : 0;
  75. i = -1;
  76.  
  77. function nextPage() {
  78. if (i >= 0)
  79. pages[i].classList.remove('currentPage');
  80.  
  81. i++;
  82.  
  83. if (i <= numPages - 1) {
  84. pages[i].classList.add('currentPage');
  85. setTimeout(nextPage, TIME_PER_PAGE);
  86. } else {
  87. i = 0;
  88. pages[i].classList.add('currentPage');
  89. setTimeout(nextPage, TIME_PER_PAGE);
  90. }
  91. }
  92.  
  93. nextPage();
  94. }
  95. </script>
  96.  
  97.  
  98.  
  99. <?php
  100. for($p = 0; $p < $num_page; $p ++) {
  101. ?>
  102.  
  103. <div class="page">
  104.  
  105. <!--the width of the columns in relation to each other.-->
  106.  
  107. <table id="bahnanzeige">
  108.  
  109. <tr height =15%>
  110.  
  111. <!-- insert the picture on the first row, first column -->
  112.  
  113. <th><img src="ovr_logo.png" alt="logo from ovr"
  114. style="width: 238.95px; height: 86.85px"></th>
  115. <?php
  116.  
  117. // displays the time on the header
  118.  
  119. echo "<th>";
  120. echo date ( "H:i" );
  121. echo "</th>";
  122. ?>
  123. <th text align=right>Abfahrt&nbsp;</th>
  124. <?php
  125. $linien_page = 6;
  126. if ($p == $num_page - 1) {
  127. $linien_page = $num_linien - 6 * ($num_page - 1);
  128. }
  129.  
  130. for($i = 0; $i < $linien_page; $i ++) {
  131. $linie = $rubik_class->GetLinie ( 6 * $p + $i );
  132. echo "<tr height =15%>";
  133. echo "<td bgcolor = #FCCE4C text align =center width=10%>";
  134. echo $linie->Nummer;
  135.  
  136. // first column of the table
  137.  
  138. echo "</td>";
  139. echo "<td text align =left width=70%>";
  140. echo $linie->Endhalt;
  141.  
  142. // second column of the table
  143.  
  144. echo "</td>";
  145. if ($linie->Abfahrtszeit < 30)
  146.  
  147. // Last column. It shows the time left until departure.
  148. // If departure time is over 30 min away, it will show the time itself
  149.  
  150. {
  151. echo "<td text align =right width=20%>";
  152. echo $linie->Abfahrtszeit;
  153. } else {
  154. $uhrzeit = date ( "H:i" );
  155. $teile = explode ( ':', $uhrzeit );
  156.  
  157. $uhr = date ( "H:i", mktime ( date ( "$teile[0]" ), date ( "$teile[1]" ) + $linie->Abfahrtszeit ) );
  158. echo "<td text align =right>";
  159. echo $uhr;
  160. }
  161. echo "</td>";
  162. echo "</tr>";
  163. }
  164.  
  165. ?>
  166.  
  167.  
  168. </table>
  169.  
  170. </div>
  171. <?php
  172. }
  173. ?>
  174.  
  175. </body>
  176. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement