Advertisement
FIN-codelines

fakelotto

Jan 14th, 2023 (edited)
1,022
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.77 KB | None | 0 0
  1. <?php
  2. /*
  3. Pelaa leikkilottoa automatisoidusti eikä se maksa mitään.
  4. Anna koneen arpoa ensin yksi oma lottorivi.
  5. Sen jälkeen kone arpoo ns. voittorivin ja vertaa omaa riviäsi voittoriviin.
  6. Arvonta toistetaan (30 sek välein) niin kauan kunnes omaan riviin osuu vähintään viisi (5) oikein.
  7. Arvonnan päätyttyä näet paljonko voitit tai todennäköisemmin hävisit.
  8. Play the play finnish lottery automatically in your browser (localhost) and it costs nothing.
  9. Let the machine draw one of its own lottery rows first.
  10. After that, the machine draws the so-called win line and compare your own line with the win line.
  11. The draw is repeated (every 30 seconds) until at least five (5) correctly match your row.
  12. After the draw is over, you will see how much you won or, more likely, lost.
  13. This script proves that by playing the lottery you can only lose your money!
  14. */
  15. header("Content-Type: text/html; charset=utf-8");
  16. header("Cache-Control: no-cache");
  17. $offset = 60 * 60 * 24 * 1;
  18. $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
  19. header($ExpStr);
  20. date_default_timezone_set("Europe/Helsinki");
  21. if (session_status() == PHP_SESSION_NONE) { session_start(); }
  22. if (!isset($_SESSION["Hudit"])) { $_SESSION["Hudit"] = 0; }
  23. if (!isset($_SESSION["Osumat"])) { $_SESSION["Osumat"] = 0; }
  24. $hutilaskuri = $_SESSION["Hudit"];
  25. $osumalaskuri = $_SESSION["Osumat"];
  26. echo "<script>var krt = '".($hutilaskuri +1)."';</script>";
  27. echo "<script>var klt = '".number_format((($hutilaskuri +1) * 1.5),2,","," ")."';</script>";
  28. echo "<script>var osm = '".$osumalaskuri."';</script>";
  29. //voittotaulukko
  30. $r7 = "~ 1 300 000 \u20AC";
  31. echo "<script>const r7 = '".$r7."';</script>";
  32. $r6extrawithplus = "~ 500 000 \u20AC";
  33. echo "<script>const r6extrawithplus = '".$r6extrawithplus."';</script>";
  34. $r6extrawithoutplus = "~ 100 000 \u20AC";
  35. echo "<script>const r6extrawithoutplus = '".$r6extrawithoutplus."';</script>";
  36. $r6withplus = "~ 10 000 \u20AC";
  37. echo "<script>const r6withplus = '".$r6withplus."';</script>";
  38. $r6withoutplus = "~ 2 000 \u20AC";
  39. echo "<script>const r6withoutplus = '".$r6withoutplus."';</script>";
  40. $r5withplus = "~ 250,00 \u20AC";
  41. echo "<script>const r5withplus = '".$r5withplus."';</script>";
  42. $r5withoutplus = "~ 50,00 \u20AC";
  43. echo "<script>const r5withoutplus = '".$r5withoutplus."';</script>";
  44. $r4withplus = "48,50 \u20AC";
  45. echo "<script>const r4withplus = '".$r4withplus."';</script>";
  46. $r4withoutplus = "8,50 \u20AC";
  47. echo "<script>const r4withoutplus = '".$r4withoutplus."';</script>";
  48. $r3extrawithplus = "8,50 \u20AC";
  49. echo "<script>const r3extrawithplus = '".$r3extrawithplus."';</script>";
  50. $r3extrawithoutplus = "0,50 \u20AC";
  51. echo "<script>const r3extrawithoutplus = '".$r3extrawithoutplus."';</script>";
  52. $rplus = "3,50 \u20AC";
  53. echo "<script>const rplus = '".$rplus."';</script>";
  54. $stake = "-1,50 \u20AC";
  55. echo "<script>const stake = '".$stake."';</script>";
  56. //arvonta: aseta oma rivi
  57. $lotteryd = $drawedd = $sorterd = $lotterypro = $plusro = array();
  58. for ($x = 1;$x < 41;$x++) { array_push($lotteryd,$x); }
  59. for ($x = 1;$x < 8;$x++) {
  60.     shuffle($lotteryd);
  61.     array_push($sorterd,$x);
  62.     array_push($drawedd,$lotteryd[0]);
  63.     array_splice($lotteryd, 0, 1);
  64. }
  65. sort($drawedd);
  66. //arvonta: arvo oma plusnumero
  67. for ($x = 1;$x < 31;$x++) { array_push($lotterypro,$x); }
  68. shuffle($lotterypro);
  69. array_push($plusro,$lotterypro[0]);
  70. //arvonta: arvo oikea rivi
  71. $lotteryr = $lotterypr = $drawedr = $sorterr = $extrar = $plusr = array();
  72. for ($x = 1;$x < 41;$x++) { array_push($lotteryr,$x); }
  73. for ($x = 1;$x < 8;$x++) {
  74.     shuffle($lotteryr);
  75.     array_push($sorterr,$x);
  76.     array_push($drawedr,$lotteryr[0]);
  77.     array_splice($lotteryr, 0, 1);
  78. }
  79. sort($drawedr);
  80. //arvonta: arvo lisänumero
  81. shuffle($lotteryr);
  82. array_push($extrar,$lotteryr[0]);
  83. //arvonta: arvo plusnumero
  84. for ($x = 1;$x < 31;$x++) { array_push($lotterypr,$x); }
  85. shuffle($lotterypr);
  86. array_push($plusr,$lotterypr[0]);
  87. //arvonta: tarkista osumat
  88. $x = $osumat = $extraosumat = $plusosumat = 0;
  89. while (isset($drawedr[$x])) {
  90.     if (in_array($drawedr[$x], $drawedd)) {
  91.         $osumat++;
  92.     }
  93.     $x++;
  94. }
  95. ?>
  96. <!DOCTYPE html>
  97. <html lang="fi">
  98. <head>
  99. <meta charset="UTF-8" />
  100. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  101. <title>FAKELOTTO</title>
  102. <meta name="apple-mobile-web-app-title" content="FAKELOTTO" />
  103. <meta name="author" content="Oiva Pahtaja" />
  104. <style>*{box-sizing:border-box}html{background:#00F;height:100%}body{margin:10px}h1{color:#FFF;font-size:3em;margin:5px 0 15px}#main{width:360px;height:590px;margin:15px auto;display:block;text-align:center;border:1px solid #0F0;background:#FFF;border-radius:5px}#mainres{width:360px;margin:15px auto;display:none;text-align:center;border:1px solid #0F0;background:#FFF;border-radius:5px}#ndx{width:320px;margin:auto;display:block;text-align:center}#drawed,#yours{display:none}#uno,#due,#tre,#quattro,#cinque,#sei,#sette,#otto,#nove,#unox,#duex,#trex,#quattrox,#cinquex,#seix,#settex,#ottox{font-size:1.6em;display:inline-block}.btn{background:#00F;border-radius:10px;font-family:Arial,sans-serif;color:#FFF;font-size:20px;padding:10px 20px 10px 20px;text-decoration:none;outline:none}.btn:hover{text-decoration:none;cursor:default}.rec{color:#F00;font-weight:bold}.rece{color:#00F;font-weight:bold}.recep{color:#008000;font-weight:bold;text-decoration:underline}.tem{opacity:0}</style>
  105. </head><body>
  106. <?php
  107. echo "<div id='mainres'>";
  108. echo "<h4>PELATTU: <span id='krtkpl'></span> riviä ( <span id='klteur'></span> &euro; )</h4>";
  109. echo "<h4>VOITETTU: <span id='vtteur'></span> &euro;</h4>";
  110. echo "</div>";
  111. echo "<div id='main' title='Keltainen arpa palauttaisi 2 &euro; tai enemmän.&#10;Valkoinen arpa ei tuo palautusta.'>";
  112. echo "<div id='yours'>";
  113. echo "<h2>Oma rivi:</h2>";
  114. if (in_array($drawedd[0], $drawedr)) {
  115.     echo "<div id='unox'>".$drawedd[0]."</div>";
  116.     echo "<script>let unoxrec = '1';</script>";
  117. } else if (in_array($extrar[0], $drawedd) && $extrar[0] == $drawedd[0]) {
  118.     echo "<div id='unox'>".$drawedd[0]."</div>";
  119.     echo "<script>let unoxrece = '1';</script>";
  120.     $extraosumat = 1;
  121. } else {
  122.     echo "<div id='unox'>".$drawedd[0]."</div>";
  123. }
  124. echo " / ";
  125. if (in_array($drawedd[1], $drawedr)) {
  126.     echo "<div id='duex'>".$drawedd[1]."</div>";
  127.     echo "<script>let duexrec = '1';</script>";
  128. } else if (in_array($extrar[0], $drawedd) && $extrar[0] == $drawedd[1]) {
  129.     echo "<div id='duex'>".$drawedd[1]."</div>";
  130.     echo "<script>let duexrece = '1';</script>";
  131.     $extraosumat = 1;
  132. } else {
  133.     echo "<div id='duex'>".$drawedd[1]."</div>";
  134. }
  135. echo " / ";
  136. if (in_array($drawedd[2], $drawedr)) {
  137.     echo "<div id='trex'>".$drawedd[2]."</div>";
  138.     echo "<script>let trexrec = '1';</script>";
  139. } else if (in_array($extrar[0], $drawedd) && $extrar[0] == $drawedd[2]) {
  140.     echo "<div id='trex'>".$drawedd[2]."</div>";
  141.     echo "<script>let trexrece = '1';</script>";
  142.     $extraosumat = 1;
  143. } else {
  144.     echo "<div id='trex'>".$drawedd[2]."</div>";
  145. }
  146. echo " / ";
  147. if (in_array($drawedd[3], $drawedr)) {
  148.     echo "<div id='quattrox'>".$drawedd[3]."</div>";
  149.     echo "<script>let quattroxrec = '1';</script>";
  150. } else if (in_array($extrar[0], $drawedd) && $extrar[0] == $drawedd[3]) {
  151.     echo "<div id='quattrox'>".$drawedd[3]."</div>";
  152.     echo "<script>let quattroxrece = '1';</script>";
  153.     $extraosumat = 1;
  154. } else {
  155.     echo "<div id='quattrox'>".$drawedd[3]."</div>";
  156. }
  157. echo " / ";
  158. if (in_array($drawedd[4], $drawedr)) {
  159.     echo "<div id='cinquex'>".$drawedd[4]."</div>";
  160.     echo "<script>let cinquexrec = '1';</script>";
  161. } else if (in_array($extrar[0], $drawedd) && $extrar[0] == $drawedd[4]) {
  162.     echo "<div id='cinquex'>".$drawedd[4]."</div>";
  163.     echo "<script>let cinquexrece = '1';</script>";
  164.     $extraosumat = 1;
  165. } else {
  166.     echo "<div id='cinquex'>".$drawedd[4]."</div>";
  167. }
  168. echo " / ";
  169. if (in_array($drawedd[5], $drawedr)) {
  170.     echo "<div id='seix'>".$drawedd[5]."</div>";
  171.     echo "<script>let seixrec = '1';</script>";
  172. } else if (in_array($extrar[0], $drawedd) && $extrar[0] == $drawedd[5]) {
  173.     echo "<div id='seix'>".$drawedd[5]."</div>";
  174.     echo "<script>let seixrece = '1';</script>";
  175.     $extraosumat = 1;
  176. } else {
  177.     echo "<div id='seix'>".$drawedd[5]."</div>";
  178. }
  179. echo " / ";
  180. if (in_array($drawedd[6], $drawedr)) {
  181.     echo "<div id='settex'>".$drawedd[6]."</div>";
  182.     echo "<script>let settexrec = '1';</script>";
  183. } else if (in_array($extrar[0], $drawedd) && $extrar[0] == $drawedd[6]) {
  184.     echo "<div id='settex'>".$drawedd[6]."</div>";
  185.     echo "<script>let settexrece = '1';</script>";
  186.     $extraosumat = 1;
  187. } else {
  188.     echo "<div id='settex'>".$drawedd[6]." </div>";
  189. }
  190. echo " + ";
  191. if (in_array($plusr[0], $plusro)) {
  192.     echo "<div id='ottox'>".$plusro[0]."</div>";
  193.     echo "<script>let ottoxrecep = '1';</script>";
  194.     $plusosumat++;
  195. } else {
  196.     echo "<div id='ottox'>".$plusro[0]."</div>";
  197. }
  198. echo "<br /><br />- - - - - - - - - - - - - - - - - - - - -<br />";
  199. echo "</div>";
  200. echo "<div id='drawed'>";
  201. echo "<h2>\"Oikea\" rivi:</h2>";
  202. echo "<div id='uno' class='rec'>".$drawedr[0]."</div>";
  203. echo " / ";
  204. echo "<div id='due' class='rec'>".$drawedr[1]."</div>";
  205. echo " / ";
  206. echo "<div id='tre' class='rec'>".$drawedr[2]."</div>";
  207. echo " / ";
  208. echo "<div id='quattro' class='rec'>".$drawedr[3]."</div>";
  209. echo " / ";
  210. echo "<div id='cinque' class='rec'>".$drawedr[4]."</div>";
  211. echo " / ";
  212. echo "<div id='sei' class='rec'>".$drawedr[5]."</div>";
  213. echo " / ";
  214. echo "<div id='sette' class='rec'>".$drawedr[6]."</div>";
  215. echo "<br /><br />";
  216. echo "<div id='otto'>Lisänro: <span class='rece'>".$extrar[0]."</span></div>";
  217. echo " / ";
  218. echo "<div id='nove'>Plusnro: <span class='recep'>".$plusr[0]."</span></div>";
  219. echo "<br /><br />- - - - - - - - - - - - - - - - - - - - -<br />";
  220. echo "<h2>Osumia: <span id='winn'>".$osumat."</span> + <span id='winne' title='LISÄNUMERO'>".$extraosumat."</span><br />";
  221. if ($plusosumat > 0) {
  222.     echo "Plus: &#9989;</h2>";
  223.     echo "<script>var winchep = '1'</script>";
  224. } else {
  225.     echo "Plus: &#10060;</h2>";
  226.     echo "<script>var winchep = '0'</script>";
  227. }
  228. echo "- - - - - - - - - - - - - - - - - - - - -<br />";
  229. echo "<h2>Tulos: <span id='winnr'> </span></h2>";
  230. echo "<div id='ndx'>";
  231. echo "<button id='nd' class='btn tem' onclick='newDraw()' disabled='disabled' title='Arvonta suoritettu ".date("d.m.Y \k\l\o H:i:s")."'>Uusi arvonta automaattisesti puolen minuutin välein &#128515;</button>";
  232. echo "</div>";
  233. echo "</div></div>";
  234. if (!isset($selaajan_ip)) { $selaajan_ip = "UNKNOWN"; }
  235. if($osumat == 7) {
  236.     $osumalaskuri = $_SESSION["Osumat"] + 1300000;
  237.     unset($_SESSION["Hudit"]);
  238.     unset($_SESSION["Osumat"]);
  239. } else if($osumat == 6 && $extraosumat == 1 && $plusosumat == 1) {
  240.     $osumalaskuri = $_SESSION["Osumat"] + 500000;
  241.     unset($_SESSION["Hudit"]);
  242.     unset($_SESSION["Osumat"]);
  243. } else if($osumat == 6 && $extraosumat == 1 && $plusosumat == 0) {
  244.     $osumalaskuri = $_SESSION["Osumat"] + 100000;
  245.     unset($_SESSION["Hudit"]);
  246.     unset($_SESSION["Osumat"]);
  247. } else if($osumat == 6 && $extraosumat == 0 && $plusosumat == 1) {
  248.     $osumalaskuri = $_SESSION["Osumat"] + 10000;
  249.     unset($_SESSION["Hudit"]);
  250.     unset($_SESSION["Osumat"]);
  251. } else if($osumat == 6 && $extraosumat == 0 && $plusosumat == 0) {
  252.     $osumalaskuri = $_SESSION["Osumat"] + 2000;
  253.     unset($_SESSION["Hudit"]);
  254.     unset($_SESSION["Osumat"]);
  255. } else if($osumat == 5 && $plusosumat == 1) {
  256.     $osumalaskuri = $_SESSION["Osumat"] + 250;
  257.     unset($_SESSION["Hudit"]);
  258.     unset($_SESSION["Osumat"]);
  259. } else if($osumat == 5 && $plusosumat == 0) {
  260.     $osumalaskuri = $_SESSION["Osumat"] + 50;
  261.     unset($_SESSION["Hudit"]);
  262.     unset($_SESSION["Osumat"]);
  263. } else if($osumat == 4 && $plusosumat == 1) {
  264.     $osumalaskuri = $_SESSION["Osumat"] + 50;
  265.     unset($_SESSION["Hudit"]);
  266.     unset($_SESSION["Osumat"]);
  267. } else if($osumat == 4 && $plusosumat == 0) {
  268.     $osumalaskuri = $_SESSION["Osumat"] + 10;
  269.     unset($_SESSION["Hudit"]);
  270.     unset($_SESSION["Osumat"]);
  271. } else if($osumat == 3 && $extraosumat == 1 && $plusosumat == 1) {
  272.     $osumalaskuri = $_SESSION["Osumat"] + 10;
  273. } else if($osumat == 3 && $extraosumat == 1 && $plusosumat == 0) {
  274.     $osumalaskuri = $_SESSION["Osumat"] + 2;
  275. } else if($plusosumat == 1) {
  276.     $osumalaskuri = $_SESSION["Osumat"] + 5;
  277. } else {
  278.     $hutilaskuri = $_SESSION["Hudit"];
  279.     $hutilaskuri++;
  280.     $_SESSION["Hudit"] = $hutilaskuri;
  281.     $osumalaskuri = $_SESSION["Osumat"] + 0;
  282. }
  283. echo "<script>var osm = '".$osumalaskuri."';</script>";
  284. if (isset($_SESSION["Osumat"])) { $_SESSION["Osumat"] = $osumalaskuri; }
  285. ?>
  286. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
  287. <script>var elem1,elem2,elem3,elem4,elem5,elem6,elem7,elem8,bonus,winche,winchee,winchep,uusinta;winche = document.getElementById("winn").innerText;winchee = document.getElementById("winne").innerText;function changeDocTitle(){document.title = "FEIKKILOTTO ("+winche+" + "+winchee+")";document.getElementById("mainres").style.display='block';document.getElementById("krtkpl").innerText=krt;document.getElementById("klteur").innerText=klt;document.getElementById("vtteur").innerText=osm;}function chkWin(){calcBonus();if(winche === "7" || winche === "6" || winche === "5"){$("#main").css("background-color", "#FF0");clearTimeout(uusinta);changeDocTitle();} else if(winche === "4"){$("#main").css("background-color", "#FF0");} else if(winche === "3" && winchee === "1"){$("#main").css("background-color", "#FF0");} else if(winchep === "1"){$("#main").css("background-color", "#FF0");} else {$("#winnr").css("color", "#F00");}}function calcBonus(){if (winche === '7'){bonus = r7;}else if(winche === '6' && winchee === '1' && winchep === '1'){bonus = r6extrawithplus;}else if(winche === '6' && winchee === '1' && winchep === '0'){bonus = r6extrawithoutplus;}else if(winche === '6' && winchee === '0' && winchep === '1'){bonus = r6withplus;}else if (winche === '6' && winchee === '0' && winchep === '0'){bonus = r6withoutplus;} else if(winche === '5' && winchep === '1'){bonus = r5withplus;}else if(winche === '5' && winchep === '0'){bonus = r5withoutplus;}else if(winche === '4' && winchep === '1'){bonus = r4withplus;}else if(winche === '4' && winchep === '0'){bonus = r4withoutplus;}else if(winche === '3' && winchee === '1' && winchep === '1'){bonus = r3extrawithplus;}else if(winche === '3' && winchee === '1' && winchep === '0'){bonus = r3extrawithoutplus;}else if(winchep === '1'){bonus = rplus;}else {bonus = stake;}}function newDraw(){location.reload()}function showYours(){$("#yours").fadeIn(1500);}function showDraw(){$("#drawed").fadeIn(1500);$("#nd").animate({opacity:1},1000);"undefined"!=typeof unoxrec&&(elem1=document.getElementById("unox")).classList.add("rec");"undefined"!=typeof unoxrece&&(elem1=document.getElementById("unox")).classList.add("rece");"undefined"!=typeof unoxrecep&&(elem1=document.getElementById("unox")).classList.add("recep");"undefined"!=typeof duexrec&&(elem2=document.getElementById("duex")).classList.add("rec");"undefined"!=typeof duexrece&&(elem2=document.getElementById("duex")).classList.add("rece");"undefined"!=typeof duexrecep&&(elem2=document.getElementById("duex")).classList.add("recep");"undefined"!=typeof trexrec&&(elem3=document.getElementById("trex")).classList.add("rec");"undefined"!=typeof trexrece&&(elem3=document.getElementById("trex")).classList.add("rece");"undefined"!=typeof trexrecep&&(elem3=document.getElementById("trex")).classList.add("recep");"undefined"!=typeof quattroxrec&&(elem4=document.getElementById("quattrox")).classList.add("rec");"undefined"!=typeof quattroxrece&&(elem4=document.getElementById("quattrox")).classList.add("rece");"undefined"!=typeof quattroxrecep&&(elem4=document.getElementById("quattrox")).classList.add("recep");"undefined"!=typeof cinquexrec&&(elem5=document.getElementById("cinquex")).classList.add("rec");"undefined"!=typeof cinquexrece&&(elem5=document.getElementById("cinquex")).classList.add("rece");"undefined"!=typeof cinquexrecep&&(elem5=document.getElementById("cinquex")).classList.add("recep");"undefined"!=typeof seixrec&&(elem1=document.getElementById("seix")).classList.add("rec");"undefined"!=typeof seixrece&&(elem1=document.getElementById("seix")).classList.add("rece");"undefined"!=typeof seixrecep&&(elem1=document.getElementById("seix")).classList.add("recep");"undefined"!=typeof settexrec&&(elem7=document.getElementById("settex")).classList.add("rec");"undefined"!=typeof settexrece&&(elem7=document.getElementById("settex")).classList.add("rece");"undefined"!=typeof settexrecep&&(elem7=document.getElementById("settex")).classList.add("recep");"undefined"!=typeof ottoxrecep&&(elem8=document.getElementById("ottox")).classList.add("recep");}$(document).ready(function(){setTimeout(function(){showYours()},1e3);setTimeout(function(){showDraw();chkWin();document.getElementById("winnr").innerText=bonus;},3e3);uusinta=setTimeout(function(){newDraw()},3e4)})</script>
  288. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement