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

📄 slot.php

📁 Time 4 Crime online
💻 PHP
字号:
<?php /* ------------------------- */ 

  $UPDATE_DB                                = 1; 
  include("_include-config.php"); 
  if(! check_login) { 
    header("Location: login.php"); 
  } 

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

/* ------------------------- */ ?> 
<html> 
 
<head> 
<title>Worldcrime</title> 
<link rel="stylesheet" type="text/css" href="css-v3.css"> 

</head> 
<body> 
<?php

    $dbres			= mysql_query("SELECT * FROM `[buildings]` WHERE `type`='slot' AND `city`='{$data->City}'");
    $aantal			= mysql_fetch_object($dbres);

if($aantal->owner == unowned){
echo "<table width=90% align=\"center\">
<tr><td align=center background=topic.gif>Slot machine</td></tr>
<tr><td class=\"mainTxt\">Deze slot machine heeft geen owner<br><a href=\"take.php?t=slot&c={$data->City}\"><font size=4>Neem hem over!</font></a></td></tr>
</table>";
} else {

$ownerr = ($aantal->owner == "unowned") ? "<b><a href=\"take.php?t=slot&c={$data->City}\">Neem over!</a></b>" : "<a href=\"profile.php?x={$aantal->owner}\">$aantal->owner</a>";
$owner = ($aantal->owner == "jeffrey") ? "<font color=white>State Owned</font>" : "$ownerr";
?>
<center><table width="180" border="1" cellspacing="0" cellpadding="2" bordercolor="black" height="170">
<tr><td align=center background=topic.gif><b>Slot Machine</b></td></tr>
<?PHP 



if (isset($_POST['submit1'])) { 
$inzet		= $_POST['inzet'];
	if(!preg_match('/^[0-9]{1,15}$/',$_POST['inzet']) OR $_POST['inzet'] < 0){
		echo "<tr><td class=\"mainTxt\">Ongeldig bedrag geld";
		echo "</font></td></tr>";
	}
	elseif($inzet > $data->cash){
		echo "<tr><td class=\"mainTxt\">Je hebt niet genoeg geld.";
		echo "</font></td></tr>";
	}
	elseif($inzet > $aantal->price){
		echo "<tr><td class=\"mainTxt\">Je moet je aan de max. inzet houden!";
		echo "</font></td></tr>";
	} else {
if($aantal->profit > 0) {
   $nr12		= rand(0,71);
   $nr22		= rand(0,71);
   $nr32		= rand(0,71);
   $nr11		= array("1","2","3","4","5","6","7","8","3","4","5","6","7","8","3","4","5","6","7","8","3","5","6","7","8","3","4","2","5","6","4","1","6","3","7","5","6","7","8","3","4","5","6","7","8","3","4","5","6","7","8","3","5","6","7","8","3","4","2","5","6","4","5","6","7","8","5","6","7","8","3","4");
   $nr21		= array("1","2","3","4","5","6","7","8","3","4","5","6","7","8","3","4","5","6","7","8","3","5","6","7","8","3","4","4","5","6","4","1","6","3","7","5","6","7","8","3","4","5","6","7","8","3","4","5","6","7","8","3","5","6","7","8","3","4","4","5","6","4","5","6","7","8","5","6","7","8","3","4");
   $nr31		= array("1","2","3","4","5","6","7","8","3","4","5","6","7","8","3","4","5","6","7","8","3","5","6","7","8","3","4","4","5","6","4","1","6","3","7","5","6","7","8","3","4","5","6","7","8","3","4","5","6","7","8","3","5","6","7","8","3","4","4","5","6","4","5","6","7","8","5","6","7","8","3","4");
} else {
   $nr12		= rand(0,81);
   $nr22		= rand(0,81);
   $nr32		= rand(0,81);
   $nr11		= array("1","2","3","4","5","6","7","8","3","9","5","6","7","8","3","3","5","6","4","8","3","5","6","7","8","7","5","5","7","8","3","1","5","8","5","8","1","3","5","6","7","8","3","9","5","6","7","8","3","3","5","6","4","8","3","5","6","7","8","7","5","5","7","8","3","1","5","8","5","8","5","6","7","8","5","6","7","8","5","6","7","8");
   $nr21		= array("1","2","3","4","5","6","7","8","3","9","5","6","7","8","3","3","5","6","4","8","3","5","6","7","8","7","5","5","7","8","3","1","5","8","5","8","1","3","5","6","7","8","3","9","5","6","7","8","3","3","5","6","4","8","3","5","6","7","8","7","5","5","7","8","3","1","5","8","5","8","5","6","7","8","5","6","7","8","5","6","7","8");
   $nr31		= array("1","2","3","4","5","6","7","8","3","9","5","6","7","8","3","3","5","6","4","8","3","5","6","7","8","7","5","5","7","8","3","1","5","8","5","8","1","3","5","6","7","8","3","9","5","6","7","8","3","3","5","6","4","8","3","5","6","7","8","7","5","5","7","8","3","1","5","8","5","8","5","6","7","8","5","6","7","8","5","6","7","8");
}
   $nr1			= $nr11[$nr12];
   $nr2			= $nr21[$nr22];
   $nr3			= $nr31[$nr32];

 print <<<ENDHTML
    <tr> 
      <td width=60 height=60 bgcolor="white"> 
        <center><img src="images/{$nr1}.gif"></center>
      </td>
      <td width=60 height=60 bgcolor="white"> 
       <center><img src="images/{$nr2}.gif"></center>
      </td>
      <td width=60 height=60 bgcolor="white"> 
        <center><img src="images/{$nr3}.gif"></center>
      </td>
    </tr>
ENDHTML;
	echo "<tr><td class=\"mainTxt\" align=\"center\" colspan=\"3\">";

if($nr1 == 1 && $nr2 == 1 && $nr3 == 1){
$profit2	= round($inzet*76);
$profit1	= round($profit2-$inzet);
$profit		= number_format($profit1,0);
       echo "<b>Gefeliciteert!</b><br>Je hebt \$$profit gewonnen";
}
elseif($nr1 == 2 && $nr2 == 2 && $nr3 == 2){
$profit2	= round($inzet*51);
$profit1	= round($profit2-$inzet);
$profit		= number_format($profit1,0);
       echo "<b>Gefeliciteert!</b><br>Je hebt \$$profit gewonnen";
}
elseif($nr1 == 3 && $nr2 == 3 && $nr3 == 3){
$profit2	= round($inzet*36);
$profit1	= round($profit2-$inzet);
$profit		= number_format($profit1,0);
       echo "<b>Gefeliciteert!</b><br>Je hebt \$$profit gewonnen";
}
elseif(($nr1 == 4 && $nr2 == 4 && $nr3 == 4) XOR ($nr1 == 4 && $nr2 == 4 && $nr3 == 9) XOR ($nr1 == 4 && $nr2 == 9 && $nr3 == 9) XOR ($nr1 == 9 && $nr2 == 9 && $nr3 == 9) XOR ($nr1 == 9 && $nr2 == 9 && $nr3 == 4) XOR ($nr1 == 9 && $nr2 == 4 && $nr3 == 4) XOR ($nr1 == 9 && $nr2 == 4 && $nr3 == 9) XOR ($nr1 == 4 && $nr2 == 9 && $nr3 == 4)){
$profit2	= round($inzet*7);
$profit1	= round($profit2-$inzet);
$profit		= number_format($profit1,0);
       echo "<b>Gefeliciteert!</b><br>Je hebt \$$profit gewonnen";
}
elseif($nr1 == 2 XOR $nr2 == 2 XOR $nr3 == 2){
$profit2	= round($inzet*4);
$profit1	= round($profit2-$inzet);
$profit		= number_format($profit1,0);
       echo "<b>Gefeliciteert!</b><br>Je hebt \$$profit gewonnen";
}
elseif(($nr1 == 2 && $nr2 == 2) XOR ($nr2 == 2 && $nr3 == 2) XOR ($nr3 == 2 && $nr1 == 2)){
$profit2	= round($inzet*8);
$profit1	= round($profit2-$inzet);
$profit		= number_format($profit1,0);
       echo "<b>Gefeliciteert!</b><br>Je hebt \$$profit gewonnen";
}
elseif(($nr1 == 4 && $nr2 == 4) XOR ($nr1 == 4 && $nr2 == 9) XOR ($nr1 == 9 && $nr2 == 4) XOR ($nr1 == 9 && $nr2 == 9) XOR ($nr1 == 4 && $nr3 == 4) XOR ($nr1 == 4 && $nr3 == 9) XOR ($nr1 == 9 && $nr3 == 4) XOR ($nr1 == 9 && $nr3 == 9) XOR ($nr2 == 4 && $nr3 == 4) XOR ($nr2 == 4 && $nr3 == 9) XOR ($nr2 == 9 && $nr3 == 4) XOR ($nr2 == 9 && $nr3 == 9)){
$profit2	= round($inzet*7);
$profit1	= round($profit2-$inzet);
$profit		= number_format($profit1,0);
       echo "<b>Gefeliciteert!</b><br>Je hebt \$$profit gewonnen";
}
else{
$profit2	= round($inzet);
$profit1	= round(0-$inzet);
$profit		= number_format($profit2,0);
print"<center>je hebt \$$profit verloren.</center>";
}
echo "</td></tr>";
mysql_query("UPDATE `[buildings]` SET `profit`=`profit`-$profit1 WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$profit1 WHERE `login`='{$aantal->owner}'");
mysql_query("UPDATE `[users]` SET `cash`=`cash`+$profit1 WHERE `login`='{$data->login}'");

}
}
$price	= number_format($aantal->price,0);
?>
<tr><td class="mainTxt" colspan="3" align="center">
<FORM METHOD=post>
      Inzet:<br>
  <font size="4">$</font>
	<input type=text name=inzet size=8 maxlength="11" value="<? echo $_POST['inzet']; ?>"><br>
	<input type=submit name=submit1 value="Pull Handle">
</FORM> 
</td></tr>
</table><br><br>

Deze slotmachine heeft als owner <? echo $owner; ?>. De max. inzet is <b>$<? echo $price; ?></b>.<br>

<?php

if ($data->login == $aantal->owner){
    print <<<ENDHTML
  <center><table width=90%>
    <tr><td align=center background=topic.gif><b>Slot Machine</b></td></tr>
    <tr><td class="mainTxt">
	<center>
<form method="POST" action=""><center>De winst is: <b>{$aantal->profit}</b>.<br>
Nieuwe max. inzet: <input type="text" name="newprice" size="5" maxlength="12" value="{$aantal->price}"><input type="submit" name="setnewprice" value="Set!"><br>
je kunt de slot machine ook weg doen, hij heeft dan geen owner meer en iemand anders kan hem kopen<br></center>
                  <input type="submit" name="drop" value="Doe de slot machine weg!"><br>
<center>Je kunt hem ook weggeven.<br>
<input type="text" name="newowner" size="20" maxlength="20"><input type="submit" name="giveto" value="geef!"><br>
</form>
                     </font>
	</center>
    </td></tr>
</table></center>
ENDHTML;

if (isset($_POST['drop'])){
if ($data->login == $aantal->owner){
mysql_query("UPDATE `[buildings]` SET `owner`='unowned' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `amount`='0' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `price`='25000' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `active`='0' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Drop BF',NOW())");
echo "<center><table width=90%><tr><td class=\"mainTxt\">Je hebt de slotmachine weggedaan</td></tr></table></center>";
}
else {
echo "<center><table width=90%><tr><td class=\"mainTxt\">Deze slotmachines zijn niet van jou!</font></td></tr></table></center>";
}
}

$newowner = $_POST['newowner'];
if (isset($_POST['giveto']) && $data->login == $aantal->owner){
$dbres = mysql_query("SELECT `login` FROM `[users]` WHERE `login`='$newowner'");
$logincheck = mysql_fetch_object($dbres);
$logincheck1 = mysql_num_rows($dbres);
if ($logincheck1 >= 1){
mysql_query("UPDATE `[buildings]` SET `owner`='{$logincheck->login}' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `profit`='0' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `amount`='0' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `price`='25000' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("UPDATE `[buildings]` SET `active`='0' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Give Slot Machines',NOW())");
echo "<center><table width=90%><tr><td class=\"mainTxt\">Jij hebt de slotmachine aan {$logincheck->login} gegeven!</td></tr></table></center>";
}
else {
echo "<center><table width=90%><tr><td class=\"mainTxt\">Ongeldige naam!</td></tr></table></center>";
}
}
if (isset($_POST['setnewprice'])){
if (preg_match('/^[0-9]{1,15}$/',$_POST['newprice']) && $data->login == $aantal->owner){
$newprice = $_POST['newprice'];
mysql_query("UPDATE `[buildings]` SET `price`='$newprice' WHERE `type`='slot' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','$newprice','Update SM maxbet',NOW())");
echo "<center><table width=90%><tr><td class=\"mainTxt\">je hebt de max. inzet veranderd in <b>\${$newprice}</b>!</td></tr></table></center>";
}
else {
echo "<center><table width=90%><tr><td class=\"mainTxt\">Ongeldige aantal geld</td></tr></table></center>";
}
}
}
}
?>


</body>

</html>

⌨️ 快捷键说明

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