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

📄 citychange.php

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

  include("_include-jail.php");

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

/* ------------------------- */ ?>

<html>

<head>

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

<body>
<?

if (isset($_POST['submit2'])){
$land = $_POST['land2'];
if ($land == "Illinois" XOR $land == "California" XOR $land == "New York" XOR $land == "Texas" XOR $land == "Ohio" XOR $land == "Nevada" XOR $land == "New Jersey" XOR $land == "Colorado" XOR $land == "Michigan" XOR $land == "Pennsylvania" XOR $land == "Louisiana" XOR $land == "Admin Palace"){
if ($land == "Admin Palace" AND $data->level <= 50) {
echo "* Invalid location!";
} else {
$price	= "700";
if ($data->cash >= $price && $price == 700){
mysql_query("UPDATE `[users]` SET `cash`=`cash`+'70' WHERE `login`='{$aantal->owner}'");
mysql_query("UPDATE `[buildings]` SET `profit`=`profit`+'70' WHERE `type`='trainstation' AND `city`='{$data->City}'");
mysql_query("UPDATE `[users]` SET `cash`=`cash`-'{$price}',`City`='{$land}' WHERE `login`='{$data->login}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','{$price}','Travel',NOW())");
print <<<ENDHTML
<center><font size="5">Welcome to {$_POST['land2']}!</font></center>
ENDHTML;
echo "<SCRIPT type=text/javascript>
	setTimeout(\"top.jail.location = 'jail1.php'\", 0);
</SCRIPT>";
exit;
}
else {
print <<<ENDHTML
<table width=100%>
<tr>
<td align="center"  class="MainTxt">
You haven't got enough money!
</td>
</tr>
</table>
ENDHTML;
}
}
} else {
echo "* Invalid location!";
}
}

    $dbres			= mysql_query("SELECT * FROM `[logs]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`time`) < 2700 AND `login`='{$data->login}' AND `login`!='ZeRoDeaD' AND `area`='Travel'");
          if(mysql_num_rows($dbres) != 0) {
    print <<<ENDHTML
  <table width=100%>
    <tr><td class="subTitle"><b>Travel</b></td></tr>
    <tr><td class="mainTxt">
	<center><font color="red">* You can only travel once every 45 minutes!</font>
	</center>
    </td></tr>
  </table>
ENDHTML;

  } elseif($aantal->owner == unowned) {
    print <<<ENDHTML
  <table width=100%>
    <tr><td class="subTitle"><b>Travel</b></td></tr>
    <tr><td class="mainTxt">
	<center><font color="red">* You can not travel at an unowned trainstation!</font><br>
<a href="take.php?t=trainstation&c=$data->City"><font size=4>Take it over!</font></a>
	</center>
    </td></tr>
  </table>
ENDHTML;
    } else {

    $select = mysql_query("SELECT * FROM `[buildings]` WHERE `type`='trainstation' AND `city`='{$data->City}'"); 
    $aantal = mysql_fetch_object($select);
$owner = ($aantal->owner == "unowned") ? "<b><a href=\"take.php?t=trainstation&c=$data->City\">Unowned</a></b>" : "<a href=\"profile.php?x={$aantal->owner}\">$aantal->owner</a>";
print <<<ENDHTML
<form action="" method="post" name="land1">
<center><table width=240 border=1 bordercolor=black cellspacing=0 cellpadding=2>
<tr>
<td class=subTitle colspan=2 align=center><b>Train Station</b><br>
<font size=1>You're in {$data->City}</td>
</tr>
<tr>
<td colspan=2 align=center class="mainTxt"><img src="images/trainstation.gif"></td>
</tr>
ENDHTML;
if($data->City != Illinois) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Illinois\" name=\"land2\" id=\"1\"><LABEL id=\"a1\" for=\"1\">Illinois</LABEL></td>
	</tr>";
}
if($data->City != California) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"California\" name=\"land2\" id=\"2\"><LABEL id=\"a2\" for=\"2\">California</LABEL></td>
	</tr>";
}
if($data->City != "New York") {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"New York\" name=\"land2\" id=\"3\"><LABEL id=\"a3\" for=\"3\">New York</LABEL></td>
	</tr>";
}
if($data->City != Colorado) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Colorado\" name=\"land2\" id=\"4\"><LABEL id=\"a4\" for=\"4\">Colorado</LABEL></td>
	</tr>";
}
if($data->City != Michigan) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Michigan\" name=\"land2\" id=\"5\"><LABEL id=\"a5\" for=\"5\">Michigan</LABEL></td>
	</tr>";
}
if($data->City != Pennsylvania) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Pennsylvania\" name=\"land2\" id=\"6\"><LABEL id=\"a6\" for=\"6\">Pennsylvania</LABEL></td>
	</tr>";
}
if($data->City != Louisiana) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Louisiana\" name=\"land2\" id=\"7\"><LABEL id=\"a7\" for=\"7\">Louisiana</LABEL></td>
	</tr>";
}
if($data->City != Nevada) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Nevada\" name=\"land2\" id=\"8\"><LABEL id=\"a8\" for=\"8\">Nevada</LABEL></td>
	</tr>";
}
if($data->City != "New Jersey") {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"New Jersey\" name=\"land2\" id=\"9\"><LABEL id=\"a9\" for=\"9\">New Jersey</LABEL></td>
	</tr>";
}
if($data->City != Ohio) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Ohio\" name=\"land2\" id=\"10\"><LABEL id=\"a10\" for=\"10\">Ohio</LABEL></td>
	</tr>";
}
if($data->City != Texas) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Texas\" name=\"land2\" id=\"11\"><LABEL id=\"a11\" for=\"11\">Texas</LABEL></td>
	</tr>";
}
if($data->City != "Admin Palace") {
if($data->level > 50) {
echo "	<tr>
	<td class=\"mainTxt\"><input type=radio class=\"normalRadio\" value=\"Admin Palace\" name=\"land2\" id=\"12\"><LABEL id=\"a12\" for=\"12\">Admin Palace</LABEL></td>
	</tr>";
}
}
print <<<ENDHTML
<tr>
<td colspan=2 align=center class="mainTxt"> Owned by: <b>{$owner}</b><br>
<input type="submit" name="submit2" value="Travel!"></td>
</tr>
</table>
<br>
</center>
</form>
ENDHTML;
}

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

if ($data->login == $aantal->owner){
    print <<<ENDHTML
  <center><table width=90%>
    <tr><td class="subTitle"><b>Travel</b></td></tr>
    <tr><td class="mainTxt">
	<center>
                 <form method="POST" action="">
<center>The profit of this trainstation is: {$aantal->profit}.<br>
You can always drop the station, the trainstation will then be unowned, other people can take it then!<br></center>
                  <input type="submit" name="drop" value="Drop the station!"><br>
<center>You can also give it to someone else.<br>
<input type="text" name="newowner" width="40"><input type="submit" name="giveto" value="Give!">
                     </form></font>
	</center>
    </td></tr>
</table></center>
ENDHTML;

if (isset($_POST['drop']) && $data->login == $aantal->owner){
mysql_query("UPDATE `[buildings]` SET `owner`='unowned' WHERE `type`='trainstation' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Drop trainstation',NOW())");
echo "<center><table width=90%><tr><td class=\"mainTxt\">You dropped the trainstation!</td></tr></table></center>";
} 
ENDHTML;
if (isset($_POST['giveto']) && $data->login == $aantal->owner){
$dbres = mysql_query("SELECT `login` FROM `[users]` WHERE `login`='$newowner'");
$logincheck = mysql_num_rows($dbres);
$new = mysql_fetch_object($dbres);
if ($logincheck >= 1){
$newowner = $_POST['newowner'];
mysql_query("UPDATE `[buildings]` SET `owner`='$new->login' WHERE `type`='trainstation' AND `city`='{$data->City}'");
mysql_query("INSERT INTO `[logs]`(login,IP,code,area,time) values('$login','$IP','0','Give trainstation',NOW())");
echo "<center><table width=90%><tr><td class=\"mainTxt\">You gave the trainstation to $new->login!</td></tr></table></center>";
} 
else 
echo "<center><table width=90%><tr><td class=\"mainTxt\">* Invalid username!</td></tr></table></center>";
}
ENDHTML;
}
?>
<p align="center"><sub>&copy; 2006 - 2007 Dark-Step version 1.3 - All rights reserved.</sub></p>
</body>
</html>

⌨️ 快捷键说明

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