Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- header("Content-Type: text/html; charset=utf-8");
- header("Cache-Control: no-cache");
- $offset = 60 * 60 * 24 * 1;
- $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
- header($ExpStr);
- date_default_timezone_set("Europe/Helsinki");
- $current_file_name = basename($_SERVER['PHP_SELF']);
- function test_input($data) {
- $data = trim($data);
- $data = stripslashes($data);
- $data = htmlspecialchars($data);
- return (int) $data;
- }
- $ep = 4;
- if (isset($_GET["d"])) {
- if (in_array(test_input($_GET["d"]), range(4,208))) {
- $ep = test_input($_GET["d"]);
- }
- }
- ?>
- <!DOCTYPE HTML>
- <html lang="fi">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>JOKERI ~ VOITONJAKO</title>
- <meta name="apple-mobile-web-app-title" content="JOKERI" />
- <meta name="author" content="Anonymous" />
- <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>
- </head><body>
- <?php
- echo "<div id='start'>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- 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>";
- echo "</div><div class='dvdx'></div>";
- //haku veikkaus.fi - JOKERI, tutkitaan avoimista lähtöpiste tulosten hakuun
- $header = array(
- "Accept: application/json",
- "Content-Type: application/json",
- "X-ESA-API-Key: ROBOT"
- );
- $url = "https://www.veikkaus.fi/api/draw-open-games/v1/games/JOKERI/draws";
- // Alustetaan cURL asetuksineen
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, 0);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- curl_setopt($ch, CURLOPT_ENCODING, "identity");
- // Suoritetaan pyyntö
- $data = curl_exec($ch);
- // Suljetaan cURL
- curl_close($ch);
- // Tarkistetaan että datassa on eloa
- $sub = "JOKERI";
- $startPoint = 0;
- $rivi = "";
- if ($data && strpos($data, $sub) !== false) {
- $avoimet = array();
- $avoimet = json_decode($data, true);
- if (isset($avoimet[0]['id'])) {
- $startPoint = $avoimet[0]['id'];
- }
- $startPoint--;
- $endPoint = $startPoint - $ep;
- for ($x = $startPoint; $x > $endPoint; $x--) {
- //haku veikkaus.fi - JOKERI
- $header = array(
- "Accept: application/json",
- "Content-Type: application/json",
- "X-ESA-API-Key: ROBOT"
- );
- $url = "https://www.veikkaus.fi/api/draw-results/v1/games/JOKERI/draws/".$x;
- // Alustetaan cURL asetuksineen
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, 0);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- curl_setopt($ch, CURLOPT_ENCODING, "identity");
- // Suoritetaan pyyntö
- $data = curl_exec($ch);
- // Suljetaan cURL
- curl_close($ch);
- // Tarkistetaan että datassa on eloa
- $sub = "prizeTiers";
- if ($data && strpos($data, $sub) !== false) {
- $tulos = array();
- $tulos = json_decode($data, true);
- $voitot = 0;
- for ($z = 0; $z < 12; $z++) {
- $voitot += ($tulos['prizeTiers'][$z]['totalAmount']);
- }
- if ($voitot == 0) { continue; }
- $rivi .= $tulos['brandName'].", viikko ".(date("W", $tulos['drawTime']/1000) + 0)."/".date("Y", $tulos['drawTime']/1000)." / ".number_format(($voitot/100),2,","," ")." €\r\n";
- echo "<div class='main'>";
- echo "<h2>".strtoupper(substr($tulos['brandName'],0,2))." - JOKERI 🃏 viikko ".(date("W", $tulos['drawTime']/1000) + 0)."/".date("Y", $tulos['drawTime']/1000)." 🃏 voitonjako</h2>";
- 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, €</th><th class='winw' title='maksetut voitot'>voitto, €</th><th title='osuus kokonaisvoitosta'>%-osuus</th></tr></thead><tbody>";
- echo "<tr><td>".$tulos['prizeTiers'][0]['name']."</td>";
- echo "<td class='kes'>".($tulos['prizeTiers'][0]['shareCount'] - $tulos['prizeTiers'][6]['shareCount'])."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][0]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((($tulos['prizeTiers'][0]['shareCount'] - $tulos['prizeTiers'][6]['shareCount']) * ($tulos['prizeTiers'][0]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][0]['shareCount'] - $tulos['prizeTiers'][6]['shareCount']) * $tulos['prizeTiers'][0]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][6]['name']." (Tupla)</td>";
- echo "<td class='kes'>".$tulos['prizeTiers'][6]['shareCount']."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][6]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][6]['shareCount'] * ($tulos['prizeTiers'][6]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][6]['shareCount'] * $tulos['prizeTiers'][6]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][1]['name']."</td>";
- echo "<td class='kes'>".($tulos['prizeTiers'][1]['shareCount'] - $tulos['prizeTiers'][7]['shareCount'])."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][1]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((($tulos['prizeTiers'][1]['shareCount'] - $tulos['prizeTiers'][7]['shareCount']) * ($tulos['prizeTiers'][1]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][1]['shareCount'] - $tulos['prizeTiers'][7]['shareCount']) * $tulos['prizeTiers'][1]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][7]['name']." (Tupla)</td>";
- echo "<td class='kes'>".$tulos['prizeTiers'][7]['shareCount']."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][7]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][7]['shareCount'] * ($tulos['prizeTiers'][7]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][7]['shareCount'] * $tulos['prizeTiers'][7]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][2]['name']."</td>";
- echo "<td class='kes'>".($tulos['prizeTiers'][2]['shareCount'] - $tulos['prizeTiers'][8]['shareCount'])."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][2]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((($tulos['prizeTiers'][2]['shareCount'] - $tulos['prizeTiers'][8]['shareCount']) * ($tulos['prizeTiers'][2]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][2]['shareCount'] - $tulos['prizeTiers'][8]['shareCount']) * $tulos['prizeTiers'][2]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][8]['name']." (Tupla)</td>";
- echo "<td class='kes'>".$tulos['prizeTiers'][8]['shareCount']."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][8]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][8]['shareCount'] * ($tulos['prizeTiers'][8]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][8]['shareCount'] * $tulos['prizeTiers'][8]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][3]['name']."</td>";
- echo "<td class='kes'>".($tulos['prizeTiers'][3]['shareCount'] - $tulos['prizeTiers'][9]['shareCount'])."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][3]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((($tulos['prizeTiers'][3]['shareCount'] - $tulos['prizeTiers'][9]['shareCount']) * ($tulos['prizeTiers'][3]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][3]['shareCount'] - $tulos['prizeTiers'][9]['shareCount']) * $tulos['prizeTiers'][3]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][9]['name']." (Tupla)</td>";
- echo "<td class='kes'>".$tulos['prizeTiers'][9]['shareCount']."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][9]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][9]['shareCount'] * ($tulos['prizeTiers'][9]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][9]['shareCount'] * $tulos['prizeTiers'][9]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][4]['name']."</td>";
- echo "<td class='kes'>".($tulos['prizeTiers'][4]['shareCount'] - $tulos['prizeTiers'][10]['shareCount'])."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][4]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((($tulos['prizeTiers'][4]['shareCount'] - $tulos['prizeTiers'][10]['shareCount']) * ($tulos['prizeTiers'][4]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][4]['shareCount'] - $tulos['prizeTiers'][10]['shareCount']) * $tulos['prizeTiers'][4]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][10]['name']." (Tupla)</td>";
- echo "<td class='kes'>".$tulos['prizeTiers'][10]['shareCount']."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][10]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][10]['shareCount'] * ($tulos['prizeTiers'][10]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][10]['shareCount'] * $tulos['prizeTiers'][10]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][5]['name']."</td>";
- echo "<td class='kes'>".($tulos['prizeTiers'][5]['shareCount'] - $tulos['prizeTiers'][11]['shareCount'])."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][5]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((($tulos['prizeTiers'][5]['shareCount'] - $tulos['prizeTiers'][11]['shareCount']) * ($tulos['prizeTiers'][5]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format((((($tulos['prizeTiers'][5]['shareCount'] - $tulos['prizeTiers'][11]['shareCount']) * $tulos['prizeTiers'][5]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "<tr><td>".$tulos['prizeTiers'][11]['name']." (Tupla)</td>";
- echo "<td class='kes'>".$tulos['prizeTiers'][11]['shareCount']."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][11]['shareAmount'] / 100),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(($tulos['prizeTiers'][11]['shareCount'] * ($tulos['prizeTiers'][11]['shareAmount'] /100)),2,","," ")."</td>";
- echo "<td class='oik'>".number_format(((($tulos['prizeTiers'][11]['shareCount'] * $tulos['prizeTiers'][11]['shareAmount']) / $voitot) * 100),2,","," ")."</td></tr>";
- echo "</tbody><tfoot><tr><td colspan=3' class='vas pohja'>voitot yhteensä (€):</td><td colspan=2' class='oik pohja' title='voitot yhteensä (€)'>".number_format(($voitot/100),2,","," ")." €</td></tr></tfoot></table><br />";
- flush();
- ob_flush();
- echo "<script>window.scrollTo(0,document.body.scrollHeight);</script>";
- echo "</div>";
- }
- }
- } else {
- echo "<div class='main'>";
- echo "<p>Ei tulosdataa saatavilla!</p>";
- echo "</div>";
- }
- //echo "<pre>";
- //print_r($rivi);
- //echo "</pre>";
- if ($ep == 8) { echo "<script>document.getElementById('w8').style.background = '#008000';</script>"; }
- if ($ep == 12) { echo "<script>document.getElementById('w12').style.background = '#008000';</script>"; }
- if ($ep == 16) { echo "<script>document.getElementById('w16').style.background = '#008000';</script>"; }
- if ($ep == 20) { echo "<script>document.getElementById('w20').style.background = '#008000';</script>"; }
- if ($ep == 28) { echo "<script>document.getElementById('w28').style.background = '#008000';</script>"; }
- if ($ep == 32) { echo "<script>document.getElementById('w32').style.background = '#008000';</script>"; }
- if ($ep == 36) { echo "<script>document.getElementById('w36').style.background = '#008000';</script>"; }
- if ($ep == 40) { echo "<script>document.getElementById('w40').style.background = '#008000';</script>"; }
- if ($ep == 48) { echo "<script>document.getElementById('w48').style.background = '#008000';</script>"; }
- if ($ep == 52) { echo "<script>document.getElementById('w52').style.background = '#008000';</script>"; }
- if ($ep == 56) { echo "<script>document.getElementById('w56').style.background = '#008000';</script>"; }
- if ($ep == 60) { echo "<script>document.getElementById('w60').style.background = '#008000';</script>"; }
- if ($ep == 68) { echo "<script>document.getElementById('w68').style.background = '#008000';</script>"; }
- if ($ep == 72) { echo "<script>document.getElementById('w72').style.background = '#008000';</script>"; }
- if ($ep == 76) { echo "<script>document.getElementById('w76').style.background = '#008000';</script>"; }
- if ($ep == 80) { echo "<script>document.getElementById('w80').style.background = '#008000';</script>"; }
- if ($ep == 88) { echo "<script>document.getElementById('w88').style.background = '#008000';</script>"; }
- if ($ep == 92) { echo "<script>document.getElementById('w92').style.background = '#008000';</script>"; }
- if ($ep == 96) { echo "<script>document.getElementById('w96').style.background = '#008000';</script>"; }
- if ($ep == 100) { echo "<script>document.getElementById('w100').style.background = '#008000';</script>"; }
- if ($ep == 108) { echo "<script>document.getElementById('w108').style.background = '#008000';</script>"; }
- if ($ep == 112) { echo "<script>document.getElementById('w112').style.background = '#008000';</script>"; }
- if ($ep == 116) { echo "<script>document.getElementById('w116').style.background = '#008000';</script>"; }
- if ($ep == 120) { echo "<script>document.getElementById('w120').style.background = '#008000';</script>"; }
- // Siivotaan jälkiä
- if (isset($avoimet)) { unset($avoimet); }
- if (isset($ch)) { unset($ch); }
- if (isset($current_file_name)) { unset($current_file_name); }
- if (isset($data)) { unset($data); }
- if (isset($endPoint)) { unset($endPoint); }
- if (isset($ep)) { unset($ep); }
- if (isset($header)) { unset($header); }
- if (isset($startPoint)) { unset($startPoint); }
- if (isset($rivi)) { unset($rivi); }
- if (isset($sub)) { unset($sub); }
- if (isset($tulos)) { unset($tulos); }
- if (isset($url)) { unset($url); }
- if (isset($voitot)) { unset($voitot); }
- if (isset($x)) { unset($x); }
- ?>
- <button onclick="topUp()" id="myBtntU" title="Loikkaa sivun alkuun">↟</button>
- <button onclick="scrUp()" id="myBtnUp" title="Vieritä ylös">⇡</button>
- <button onclick="scrDown()" id="myBtnDown" title="Vieritä alas">⇣</button>
- <button onclick="bottomDown()" id="myBtnbD" title="Loikkaa sivun loppuun">↡</button>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
- <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>
- <noscript>HUOM! Selaimesi ei tue JavaScriptiä, joten sivusto ei toimi täysin suunnitellusti.</noscript>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement