Advertisement
KENOkamu

joker-pricetiers

Feb 23rd, 2023 (edited)
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 23.92 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. header("Content-Type: text/html; charset=utf-8");
  4. header("Cache-Control: no-cache");
  5. $offset = 60 * 60 * 24 * 1;
  6. $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
  7. header($ExpStr);
  8. date_default_timezone_set("Europe/Helsinki");
  9. $current_file_name = basename($_SERVER['PHP_SELF']);
  10. function test_input($data) {
  11.     $data = trim($data);
  12.     $data = stripslashes($data);
  13.     $data = htmlspecialchars($data);
  14.     return (int) $data;
  15. }
  16. $ep = 4;
  17. if (isset($_GET["d"])) {
  18.     if (in_array(test_input($_GET["d"]), range(4,208))) {
  19.         $ep = test_input($_GET["d"]);
  20.     }
  21. }
  22. ?>
  23. <!DOCTYPE HTML>
  24. <html lang="fi">
  25. <head>
  26. <meta charset="UTF-8" />
  27. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  28. <title>JOKERI ~ VOITONJAKO</title>
  29. <meta name="apple-mobile-web-app-title" content="JOKERI" />
  30. <meta name="author" content="Anonymous" />
  31. <style>*{box-sizing:border-box}html{background-color:#DBDBDB}body{margin:0}h2,p{text-align:center;margin-top:0;font-weight:bold}th{padding:8px;border:solid 1px #000;background:#00F;color:#FFF}td{padding:8px;border:solid 1px #000;background:#F0F0FF}#myBtntU{display:none;position:fixed;bottom:300px;right:20px;z-index:99;font-size:18px;border:none;outline:none;background-color:#00ADAD;color:#FFF;cursor:pointer;padding:5px;border-radius:4px}#myBtntU:hover{background-color:#00D600}#myBtnUp{display:none;position:fixed;bottom:260px;right:20px;z-index:99;font-size:18px;border:none;outline:none;background-color:#00ADAD;color:#FFF;cursor:pointer;padding:5px;border-radius:4px}#myBtnUp:hover{background-color:#00D600}#myBtnDown{display:none;position:fixed;bottom:220px;right:20px;z-index:99;font-size:18px;border:none;outline:none;background-color:#00ADAD;color:#FFF;cursor:pointer;padding:5px;border-radius:4px}#myBtnDown:hover{background-color:#00D600}#myBtnbD{display:none;position:fixed;bottom:180px;right:20px;z-index:99;font-size:18px;border:none;outline:none;background-color:#00ADAD;color:#FFF;cursor:pointer;padding:5px;border-radius:4px}#myBtnbD:hover{background-color:#00D600}#start{width:532px;height:94px;margin:10px auto 0;display:block;background-color:#FFF;padding:15px;border:solid 1px #00F;overflow-x:hidden;overflow-y:auto;text-align:justify}.dvd{width:80px;padding:2px;background:#0000CD;color:#FFF;text-align:center;float:left;border:solid 1px #FFF}.dvd:hover{background:#008000}.dvdx{clear:both}.kes{text-align:center}.main{width:560px;margin:20px auto;display:block;background-color:#FFF;border:solid 1px #00F;border-radius:5px;padding:15px 15px 0}.oik{text-align:right}.pohja{background:#00F;color:#FFF}.vas{text-align:left}.wint{width:135px}.winw{width:110px}@media screen and (max-width: 670px){#myBtntU, #myBtnUp, #myBtnDown, #myBtnbD{visibility:hidden}}</style>
  32. </head><body>
  33. <?php
  34. echo "<div id='start'>";
  35. echo "<a href='".$current_file_name."?d=20' target='_self' title='20 arvontaa' onclick='clickAndDisable(this);'><div id='w20' class='dvd'><h3>20</h3></div></a>";
  36. echo "<a href='".$current_file_name."?d=40' target='_self' title='40 arvontaa' onclick='clickAndDisable(this);'><div id='w40' class='dvd'><h3>40</h3></div></a>";
  37. echo "<a href='".$current_file_name."?d=60' target='_self' title='60 arvontaa' onclick='clickAndDisable(this);'><div id='w60' class='dvd'><h3>60</h3></div></a>";
  38. echo "<a href='".$current_file_name."?d=80' target='_self' title='80 arvontaa' onclick='clickAndDisable(this);'><div id='w80' class='dvd'><h3>80</h3></div></a>";
  39. echo "<a href='".$current_file_name."?d=100' target='_self' title='100 arvontaa' onclick='clickAndDisable(this);'><div id='w100' class='dvd'><h3>100</h3></div></a>";
  40. echo "<a href='".$current_file_name."?d=120' target='_self' title='120 arvontaa' onclick='clickAndDisable(this);'><div id='w120' class='dvd'><h3>120</h3></div></a>";
  41. echo "<a href='".$current_file_name."?d=16' target='_self' title='16 arvontaa' onclick='clickAndDisable(this);'><div id='w16' class='dvd'><h3>16</h3></div></a>";
  42. echo "<a href='".$current_file_name."?d=36' target='_self' title='36 arvontaa' onclick='clickAndDisable(this);'><div id='w36' class='dvd'><h3>36</h3></div></a>";
  43. echo "<a href='".$current_file_name."?d=56' target='_self' title='56 arvontaa' onclick='clickAndDisable(this);'><div id='w56' class='dvd'><h3>56</h3></div></a>";
  44. echo "<a href='".$current_file_name."?d=76' target='_self' title='76 arvontaa' onclick='clickAndDisable(this);'><div id='w76' class='dvd'><h3>76</h3></div></a>";
  45. echo "<a href='".$current_file_name."?d=96' target='_self' title='96 arvontaa' onclick='clickAndDisable(this);'><div id='w96' class='dvd'><h3>96</h3></div></a>";
  46. echo "<a href='".$current_file_name."?d=116' target='_self' title='116 arvontaa' onclick='clickAndDisable(this);'><div id='w116' class='dvd'><h3>116</h3></div></a>";
  47. echo "<a href='".$current_file_name."?d=12' target='_self' title='12 arvontaa' onclick='clickAndDisable(this);'><div id='w12' class='dvd'><h3>12</h3></div></a>";
  48. echo "<a href='".$current_file_name."?d=32' target='_self' title='32 arvontaa' onclick='clickAndDisable(this);'><div id='w32' class='dvd'><h3>32</h3></div></a>";
  49. echo "<a href='".$current_file_name."?d=52' target='_self' title='52 arvontaa' onclick='clickAndDisable(this);'><div id='w52' class='dvd'><h3>52</h3></div></a>";
  50. echo "<a href='".$current_file_name."?d=72' target='_self' title='72 arvontaa' onclick='clickAndDisable(this);'><div id='w72' class='dvd'><h3>72</h3></div></a>";
  51. echo "<a href='".$current_file_name."?d=92' target='_self' title='92 arvontaa' onclick='clickAndDisable(this);'><div id='w92' class='dvd'><h3>92</h3></div></a>";
  52. echo "<a href='".$current_file_name."?d=112' target='_self' title='112 arvontaa' onclick='clickAndDisable(this);'><div id='w112' class='dvd'><h3>112</h3></div></a>";
  53. echo "<a href='".$current_file_name."?d=8' target='_self' title='8 arvontaa' onclick='clickAndDisable(this);'><div id='w8' class='dvd'><h3>8</h3></div></a>";
  54. echo "<a href='".$current_file_name."?d=28' target='_self' title='28 arvontaa' onclick='clickAndDisable(this);'><div id='w28' class='dvd'><h3>28</h3></div></a>";
  55. echo "<a href='".$current_file_name."?d=48' target='_self' title='48 arvontaa' onclick='clickAndDisable(this);'><div id='w48' class='dvd'><h3>48</h3></div></a>";
  56. echo "<a href='".$current_file_name."?d=68' target='_self' title='68 arvontaa' onclick='clickAndDisable(this);'><div id='w68' class='dvd'><h3>68</h3></div></a>";
  57. echo "<a href='".$current_file_name."?d=88' target='_self' title='88 arvontaa' onclick='clickAndDisable(this);'><div id='w88' class='dvd'><h3>88</h3></div></a>";
  58. echo "<a href='".$current_file_name."?d=108' target='_self' title='108 arvontaa' onclick='clickAndDisable(this);'><div id='w108' class='dvd'><h3>108</h3></div></a>";
  59. echo "</div><div class='dvdx'></div>";
  60. //haku veikkaus.fi - JOKERI, tutkitaan avoimista lähtöpiste tulosten hakuun
  61. $header = array(
  62.         "Accept: application/json",
  63.         "Content-Type: application/json",
  64.         "X-ESA-API-Key: ROBOT"
  65. );
  66. $url = "https://www.veikkaus.fi/api/draw-open-games/v1/games/JOKERI/draws";
  67. // Alustetaan cURL asetuksineen
  68. $ch = curl_init();
  69. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  70. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  71. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  72. curl_setopt($ch, CURLOPT_URL, $url);
  73. curl_setopt($ch, CURLOPT_POST, 0);
  74. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  75. curl_setopt($ch, CURLOPT_ENCODING, "identity");
  76. // Suoritetaan pyyntö
  77. $data = curl_exec($ch);
  78. // Suljetaan cURL
  79. curl_close($ch);
  80. // Tarkistetaan että datassa on eloa
  81. $sub = "JOKERI";
  82. $startPoint = 0;
  83. $rivi = "";
  84. if ($data && strpos($data, $sub) !== false) {
  85.     $avoimet = array();
  86.     $avoimet = json_decode($data, true);
  87.     if (isset($avoimet[0]['id'])) {
  88.         $startPoint = $avoimet[0]['id'];
  89.     }
  90.     $startPoint--;
  91.     $endPoint = $startPoint - $ep;
  92.     for ($x = $startPoint; $x > $endPoint; $x--) {
  93.         //haku veikkaus.fi - JOKERI
  94.         $header = array(
  95.                 "Accept: application/json",
  96.                 "Content-Type: application/json",
  97.                 "X-ESA-API-Key: ROBOT"
  98.         );
  99.         $url = "https://www.veikkaus.fi/api/draw-results/v1/games/JOKERI/draws/".$x;
  100.         // Alustetaan cURL asetuksineen
  101.         $ch = curl_init();
  102.         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  103.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  104.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  105.         curl_setopt($ch, CURLOPT_URL, $url);
  106.         curl_setopt($ch, CURLOPT_POST, 0);
  107.         curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  108.         curl_setopt($ch, CURLOPT_ENCODING, "identity");
  109.         // Suoritetaan pyyntö
  110.         $data = curl_exec($ch);
  111.         // Suljetaan cURL
  112.         curl_close($ch);
  113.         // Tarkistetaan että datassa on eloa
  114.         $sub = "prizeTiers";
  115.         if ($data && strpos($data, $sub) !== false) {
  116.             $tulos = array();
  117.             $tulos = json_decode($data, true);
  118.             $voitot = 0;
  119.             for ($z = 0; $z < 12; $z++) {
  120.                 $voitot += ($tulos['prizeTiers'][$z]['totalAmount']);
  121.             }
  122.             if ($voitot == 0) { continue; }
  123.             $rivi .= $tulos['brandName'].", viikko ".(date("W", $tulos['drawTime']/1000) + 0)."/".date("Y", $tulos['drawTime']/1000)." / ".number_format(($voitot/100),2,","," ")." &euro;\r\n";
  124.             echo "<div class='main'>";
  125.             echo "<h2>".strtoupper(substr($tulos['brandName'],0,2))." - JOKERI 🃏 viikko ".(date("W", $tulos['drawTime']/1000) + 0)."/".date("Y", $tulos['drawTime']/1000)." 🃏 voitonjako</h2>";
  126.             echo "<table><thead><tr><th class='wint vas' title='voittoluokat'>tulos</th><th title='voittavien pelien lukumäärä'>rivit, kpl</th><th class='winw' title='voitto-osuus'>osuus, &euro;</th><th class='winw' title='maksetut voitot'>voitto, &euro;</th><th title='osuus kokonaisvoitosta'>%-osuus</th></tr></thead><tbody>";
  127.             echo "<tr><td>".$tulos['prizeTiers'][0]['name']."</td>";
  128.             echo "<td class='kes'>".($tulos['prizeTiers'][0]['shareCount'] - $tulos['prizeTiers'][6]['shareCount'])."</td>";
  129.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][0]['shareAmount'] / 100),2,","," ")."</td>";
  130.             echo "<td class='oik'>".number_format((($tulos['prizeTiers'][0]['shareCount'] - $tulos['prizeTiers'][6]['shareCount']) * ($tulos['prizeTiers'][0]['shareAmount'] /100)),2,","," ")."</td>";
  131.             echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][0]['shareCount'] - $tulos['prizeTiers'][6]['shareCount']) * $tulos['prizeTiers'][0]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  132.             echo "<tr><td>".$tulos['prizeTiers'][6]['name']." (Tupla)</td>";
  133.             echo "<td class='kes'>".$tulos['prizeTiers'][6]['shareCount']."</td>";
  134.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][6]['shareAmount'] / 100),2,","," ")."</td>";
  135.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][6]['shareCount'] * ($tulos['prizeTiers'][6]['shareAmount'] /100)),2,","," ")."</td>";
  136.             echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][6]['shareCount'] * $tulos['prizeTiers'][6]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  137.             echo "<tr><td>".$tulos['prizeTiers'][1]['name']."</td>";
  138.             echo "<td class='kes'>".($tulos['prizeTiers'][1]['shareCount'] - $tulos['prizeTiers'][7]['shareCount'])."</td>";
  139.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][1]['shareAmount'] / 100),2,","," ")."</td>";
  140.             echo "<td class='oik'>".number_format((($tulos['prizeTiers'][1]['shareCount'] - $tulos['prizeTiers'][7]['shareCount']) * ($tulos['prizeTiers'][1]['shareAmount'] /100)),2,","," ")."</td>";
  141.             echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][1]['shareCount'] - $tulos['prizeTiers'][7]['shareCount']) * $tulos['prizeTiers'][1]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  142.             echo "<tr><td>".$tulos['prizeTiers'][7]['name']." (Tupla)</td>";
  143.             echo "<td class='kes'>".$tulos['prizeTiers'][7]['shareCount']."</td>";
  144.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][7]['shareAmount'] / 100),2,","," ")."</td>";
  145.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][7]['shareCount'] * ($tulos['prizeTiers'][7]['shareAmount'] /100)),2,","," ")."</td>";
  146.             echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][7]['shareCount'] * $tulos['prizeTiers'][7]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  147.             echo "<tr><td>".$tulos['prizeTiers'][2]['name']."</td>";
  148.             echo "<td class='kes'>".($tulos['prizeTiers'][2]['shareCount'] - $tulos['prizeTiers'][8]['shareCount'])."</td>";
  149.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][2]['shareAmount'] / 100),2,","," ")."</td>";
  150.             echo "<td class='oik'>".number_format((($tulos['prizeTiers'][2]['shareCount'] - $tulos['prizeTiers'][8]['shareCount']) * ($tulos['prizeTiers'][2]['shareAmount'] /100)),2,","," ")."</td>";
  151.             echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][2]['shareCount'] - $tulos['prizeTiers'][8]['shareCount']) * $tulos['prizeTiers'][2]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  152.             echo "<tr><td>".$tulos['prizeTiers'][8]['name']." (Tupla)</td>";
  153.             echo "<td class='kes'>".$tulos['prizeTiers'][8]['shareCount']."</td>";
  154.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][8]['shareAmount'] / 100),2,","," ")."</td>";
  155.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][8]['shareCount'] * ($tulos['prizeTiers'][8]['shareAmount'] /100)),2,","," ")."</td>";
  156.             echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][8]['shareCount'] * $tulos['prizeTiers'][8]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  157.             echo "<tr><td>".$tulos['prizeTiers'][3]['name']."</td>";
  158.             echo "<td class='kes'>".($tulos['prizeTiers'][3]['shareCount'] - $tulos['prizeTiers'][9]['shareCount'])."</td>";
  159.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][3]['shareAmount'] / 100),2,","," ")."</td>";
  160.             echo "<td class='oik'>".number_format((($tulos['prizeTiers'][3]['shareCount'] - $tulos['prizeTiers'][9]['shareCount']) * ($tulos['prizeTiers'][3]['shareAmount'] /100)),2,","," ")."</td>";
  161.             echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][3]['shareCount'] - $tulos['prizeTiers'][9]['shareCount']) * $tulos['prizeTiers'][3]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  162.             echo "<tr><td>".$tulos['prizeTiers'][9]['name']." (Tupla)</td>";
  163.             echo "<td class='kes'>".$tulos['prizeTiers'][9]['shareCount']."</td>";
  164.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][9]['shareAmount'] / 100),2,","," ")."</td>";
  165.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][9]['shareCount'] * ($tulos['prizeTiers'][9]['shareAmount'] /100)),2,","," ")."</td>";
  166.             echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][9]['shareCount'] * $tulos['prizeTiers'][9]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  167.             echo "<tr><td>".$tulos['prizeTiers'][4]['name']."</td>";
  168.             echo "<td class='kes'>".($tulos['prizeTiers'][4]['shareCount'] - $tulos['prizeTiers'][10]['shareCount'])."</td>";
  169.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][4]['shareAmount'] / 100),2,","," ")."</td>";
  170.             echo "<td class='oik'>".number_format((($tulos['prizeTiers'][4]['shareCount'] - $tulos['prizeTiers'][10]['shareCount']) * ($tulos['prizeTiers'][4]['shareAmount'] /100)),2,","," ")."</td>";
  171.             echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][4]['shareCount'] - $tulos['prizeTiers'][10]['shareCount']) * $tulos['prizeTiers'][4]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  172.             echo "<tr><td>".$tulos['prizeTiers'][10]['name']." (Tupla)</td>";
  173.             echo "<td class='kes'>".$tulos['prizeTiers'][10]['shareCount']."</td>";
  174.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][10]['shareAmount'] / 100),2,","," ")."</td>";
  175.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][10]['shareCount'] * ($tulos['prizeTiers'][10]['shareAmount'] /100)),2,","," ")."</td>";
  176.             echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][10]['shareCount'] * $tulos['prizeTiers'][10]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  177.             echo "<tr><td>".$tulos['prizeTiers'][5]['name']."</td>";
  178.             echo "<td class='kes'>".($tulos['prizeTiers'][5]['shareCount'] - $tulos['prizeTiers'][11]['shareCount'])."</td>";
  179.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][5]['shareAmount'] / 100),2,","," ")."</td>";
  180.             echo "<td class='oik'>".number_format((($tulos['prizeTiers'][5]['shareCount'] - $tulos['prizeTiers'][11]['shareCount']) * ($tulos['prizeTiers'][5]['shareAmount'] /100)),2,","," ")."</td>";
  181.             echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][5]['shareCount'] - $tulos['prizeTiers'][11]['shareCount']) * $tulos['prizeTiers'][5]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  182.             echo "<tr><td>".$tulos['prizeTiers'][11]['name']." (Tupla)</td>";
  183.             echo "<td class='kes'>".$tulos['prizeTiers'][11]['shareCount']."</td>";
  184.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][11]['shareAmount'] / 100),2,","," ")."</td>";
  185.             echo "<td class='oik'>".number_format(($tulos['prizeTiers'][11]['shareCount'] * ($tulos['prizeTiers'][11]['shareAmount'] /100)),2,","," ")."</td>";
  186.             echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][11]['shareCount'] * $tulos['prizeTiers'][11]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
  187.             echo "</tbody><tfoot><tr><td colspan=3' class='vas pohja'>voitot yhteensä (&euro;):</td><td colspan=2' class='oik pohja' title='voitot yhteensä (&euro;)'>".number_format(($voitot/100),2,","," ")." &euro;</td></tr></tfoot></table><br />";
  188.             flush();
  189.             ob_flush();
  190.             echo "<script>window.scrollTo(0,document.body.scrollHeight);</script>";
  191.             echo "</div>";
  192.         }
  193.     }
  194. } else {
  195.     echo "<div class='main'>";
  196.     echo "<p>Ei tulosdataa saatavilla!</p>";
  197.     echo "</div>";
  198. }
  199. //echo "<pre>";
  200. //print_r($rivi);
  201. //echo "</pre>";
  202. if ($ep == 8) { echo "<script>document.getElementById('w8').style.background = '#008000';</script>"; }
  203. if ($ep == 12) { echo "<script>document.getElementById('w12').style.background = '#008000';</script>"; }
  204. if ($ep == 16) { echo "<script>document.getElementById('w16').style.background = '#008000';</script>"; }
  205. if ($ep == 20) { echo "<script>document.getElementById('w20').style.background = '#008000';</script>"; }
  206. if ($ep == 28) { echo "<script>document.getElementById('w28').style.background = '#008000';</script>"; }
  207. if ($ep == 32) { echo "<script>document.getElementById('w32').style.background = '#008000';</script>"; }
  208. if ($ep == 36) { echo "<script>document.getElementById('w36').style.background = '#008000';</script>"; }
  209. if ($ep == 40) { echo "<script>document.getElementById('w40').style.background = '#008000';</script>"; }
  210. if ($ep == 48) { echo "<script>document.getElementById('w48').style.background = '#008000';</script>"; }
  211. if ($ep == 52) { echo "<script>document.getElementById('w52').style.background = '#008000';</script>"; }
  212. if ($ep == 56) { echo "<script>document.getElementById('w56').style.background = '#008000';</script>"; }
  213. if ($ep == 60) { echo "<script>document.getElementById('w60').style.background = '#008000';</script>"; }
  214. if ($ep == 68) { echo "<script>document.getElementById('w68').style.background = '#008000';</script>"; }
  215. if ($ep == 72) { echo "<script>document.getElementById('w72').style.background = '#008000';</script>"; }
  216. if ($ep == 76) { echo "<script>document.getElementById('w76').style.background = '#008000';</script>"; }
  217. if ($ep == 80) { echo "<script>document.getElementById('w80').style.background = '#008000';</script>"; }
  218. if ($ep == 88) { echo "<script>document.getElementById('w88').style.background = '#008000';</script>"; }
  219. if ($ep == 92) { echo "<script>document.getElementById('w92').style.background = '#008000';</script>"; }
  220. if ($ep == 96) { echo "<script>document.getElementById('w96').style.background = '#008000';</script>"; }
  221. if ($ep == 100) { echo "<script>document.getElementById('w100').style.background = '#008000';</script>"; }
  222. if ($ep == 108) { echo "<script>document.getElementById('w108').style.background = '#008000';</script>"; }
  223. if ($ep == 112) { echo "<script>document.getElementById('w112').style.background = '#008000';</script>"; }
  224. if ($ep == 116) { echo "<script>document.getElementById('w116').style.background = '#008000';</script>"; }
  225. if ($ep == 120) { echo "<script>document.getElementById('w120').style.background = '#008000';</script>"; }
  226. // Siivotaan jälkiä
  227. if (isset($avoimet)) { unset($avoimet); }
  228. if (isset($ch)) { unset($ch); }
  229. if (isset($current_file_name)) { unset($current_file_name); }
  230. if (isset($data)) { unset($data); }
  231. if (isset($endPoint)) { unset($endPoint); }
  232. if (isset($ep)) { unset($ep); }
  233. if (isset($header)) { unset($header); }
  234. if (isset($startPoint)) { unset($startPoint); }
  235. if (isset($rivi)) { unset($rivi); }
  236. if (isset($sub)) { unset($sub); }
  237. if (isset($tulos)) { unset($tulos); }
  238. if (isset($url)) { unset($url); }
  239. if (isset($voitot)) { unset($voitot); }
  240. if (isset($x)) { unset($x); }
  241. ?>
  242. <button onclick="topUp()" id="myBtntU" title="Loikkaa sivun alkuun">&#8607;</button>
  243. <button onclick="scrUp()" id="myBtnUp" title="Vieritä ylös">&#8673;</button>
  244. <button onclick="scrDown()" id="myBtnDown" title="Vieritä alas">&#8675;</button>
  245. <button onclick="bottomDown()" id="myBtnbD" title="Loikkaa sivun loppuun">&#8609;</button>
  246. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
  247. <script>const windowInnerHeight=window.innerHeight,pageHeight=document.documentElement.scrollHeight;function clickAndDisable(link){link.onclick=function(event){event.preventDefault()}}function scrollFunction(){document.body.scrollTop>pageHeight-(windowInnerHeight+10)||document.documentElement.scrollTop>pageHeight-(windowInnerHeight+10)?(document.getElementById("myBtnDown").style.display="none",document.getElementById("myBtnbD").style.display="none"):(document.getElementById("myBtnDown").style.display="block",document.getElementById("myBtnbD").style.display="block"),document.body.scrollTop>windowInnerHeight/3||document.documentElement.scrollTop>windowInnerHeight/3?(document.getElementById("myBtntU").style.display="block",document.getElementById("myBtnUp").style.display="block"):document.body.scrollTop>40||document.documentElement.scrollTop>40?document.getElementById("myBtnUp").style.display="block":(document.getElementById("myBtntU").style.display="none",document.getElementById("myBtnUp").style.display="none")}function scrUp(){window.scrollBy(0,-100),document.getElementById("myBtnDown").style.display="initial",document.getElementById("myBtnbD").style.display="initial"}function scrDown(){window.scrollBy(0,100),document.getElementById("myBtnDown").style.display="none",document.getElementById("myBtnbD").style.display="none"}function topUp(){window.scrollTo({left:0,top:0,behavior:"smooth"}),document.getElementById("myBtnDown").style.display="initial",document.getElementById("myBtnbD").style.display="initial"}function bottomDown(){window.scrollTo({left:0,top:document.body.scrollHeight,behavior:"smooth"}),document.getElementById("myBtnDown").style.display="none",document.getElementById("myBtnbD").style.display="none"}window.onscroll=function(){scrollFunction()};$(document).ready(function(){var uri = window.location.toString();if(pageHeight > windowInnerHeight + 50){$("#myBtnDown").show(500);$("#myBtnbD").show(1000);};if (uri.indexOf("?") > 0){var clean_uri = uri.substring(0, uri.indexOf("?"));window.history.replaceState({}, document.title, clean_uri);}})</script>
  248. <noscript>HUOM! Selaimesi ei tue JavaScriptiä, joten sivusto ei toimi täysin suunnitellusti.</noscript>
  249. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement