⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lotto.php

📁 还是WEB游戏源码 Darkstep 还是WEB游戏源码 Darkstep
💻 PHP
字号:
<?php /* ------------------------- */

  include("_include-config.php");
  if(! check_login()) {
    header("Location: login.php");
    exit;
  }

  mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");

/* ------------------------- */ ?>
<head>

<title>[( Elite Avengers )]</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">

</head>

<body>

<table width=100%>
<?php
//configuratie
$verlies = "$inzet";
// stel het bedrag in bij verlies
$gewonnnen = "{$inzet}*2";
// bedrag bij 2 goede getallen
$cijfers3 = "{$inzet}*3";
// bedrag bij 3 goede getallen
$jackpot = "{$inzet}*4";
// bedrag bij 4 goede getallen

$min = "1";
// laagste cijfer
$max = "9";
// hoogste cijfer
// end configuratie
// hieronder moet er niets meer veranderd worden
print "<tr><td class=\"subTitle\"><b>Lotto</b></td></tr>";
if ($data->lotto <= 0) {
print "<tr><td class=\"mainTxt\" align=\"center\">You already played lotto today!.</td></tr>";
exit;
}

if (isset($_POST['submit']) && $_POST['inzet'] >= 250) {
        if ($data->cash >= $verlies) {
$a = rand($min,$max);
$b = rand($min,$max);
$c = rand($min,$max);
$d = rand($min,$max);

print "<tr><td class=\"mainTxt\" align=\"center\"><font size=9>$a-$b-$c-$d</font></td></tr>";

if ($a == $b & $b == $c & $c == $d)
{
$win = "3";
}
else if ($a == $b & $a == $c OR $a == $b & $a == $d OR $a == $c && $a == $d OR $b == $c & $b == $d)
{
$win = "2";
}
else if ($a == $b OR $a == $c OR $a == $d OR $b == $c OR $b == $d OR $c == $d)
{
$win = "1";
}
else
{
$win = "0";
}

if ($win == "3")
{
mysql_query("UPDATE `[users]` SET `cash`=`cash`+{$jackpot}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'");
print "<br><tr><td class=\"mainTxt\" align=\"center\"><font size=5>You have 4 of the same lotto numbers. You've won 4X your bet!</font></td></tr>";
}
else if ($win == "2")
{
mysql_query("UPDATE `[users]` SET `cash`=`cash`+{$cijfers3}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'");
print "<br><tr><td class=\"mainTxt\" align=\"center\"><font size=4>You have 3 of the same lotto numbers. You've won 3X your bet!</font></td></tr>";
}
else if ($win == "1")
{
mysql_query("UPDATE `[users]` SET `cash`=`cash`+{$gewonnnen}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'") or die (mysql_error());
print "<br><tr><td class=\"mainTxt\" align=\"center\"><font size=3>You have 4 of the same lotto numbers. You've won 4X your bet!</font></td></tr>";
}
else if ($win == "0")
{
mysql_query("UPDATE `[users]` SET `cash`=`cash`-{$verlies}, `lotto`=`lotto`-1 WHERE `login`='{$data->login}'") or die (mysql_error());
print"<br><tr><td class=\"mainTxt\" align=\"center\"><font size=3>Sorry, you didn't win anything....</font></td></tr>";
}
}
else {
print "<tr><td class=\"mainTxt\" align=\"center\">You haven't enough cash to play lotto!.</td></tr>";
}
}
else
{
echo "<tr><td class=mainTxt>Welcome to Lotto<br>
There will be 4 numbers random choosen, if you have 2 or more of the same number, you win!<br>
2 of the same numbers: You win 2x your money!<br>3 of the same numbers: You win 3x your money!<br>4 of the same numbers: You win 4x your money!<br>
You can play Lotto today for {$data->lotto}X.<br><br>";
?>
<FORM METHOD=post ACTION="">
Inzet:
<select name="inzet">
<option value="250">$250</option>
<option value="500">$500</option>
<option value="750">$750</option>
<option value="1000">$1,000</option>
<option value="1500">$1,500</option>
<option value="2000">$2,000</option>
<option value="3000">$3,000</option>
<option value="10000">$10,000</option>
<option value="30000">$30,000</option>
<option value="50000">$50,000</option>
</select>,-<br>
<br>
<INPUT name="submit" type="submit" VALUE="Play">
</FORM>
</td></tr>
<table>
<?
}
?>
</table>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -