-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathairport.php
173 lines (160 loc) · 7.32 KB
/
airport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
require_once("members/config.php");
include("members/countdown_p.php");
checks();
$result = mysql_query("SELECT location, username, Airtravel FROM Players WHERE id='{$_COOKIE['id']}' LIMIT 1");
$row = mysql_fetch_array($result);
$l = $row['location'];
$u = $row['username'];
$travel = $row['Airtravel'];
$title="$l Airport";
require_once("members/header.php");
include("members/Countdown_he.php");
$result = mysql_query("SELECT owner FROM airport WHERE location='$l' LIMIT 1");
$row = mysql_fetch_array($result);
$o = $row['owner'];
$sql = mysql_query("SELECT id, health FROM Players WHERE username='$o' LIMIT 1");
$row = mysql_fetch_array($sql);
$ownerid = $row['id'];
$ohealth = $row['health'];
if (($o == "None" || $o == NULL) || ($ohealth < 1)) {
echo "<div id=\"ltable\" align=\"center\">
<p>This Airport currently has no owner! Would you like to have it?
<form name=\"pickup\" method=\"post\" action=\"members/appickup.php\">
<input type=\"hidden\" name=\"location\" value=\"$l\" />
<input type=\"submit\" name=\"submit\" value=\"Claim it!\" />
<input type=\"hidden\" name=\"submitted\" value=\"TRUE\" />
</form></div>";
include("members/footer.php");
} else {
$result = mysql_query("SELECT owner FROM airport WHERE id='1' LIMIT 1");
$row = mysql_fetch_array($result);
$oo = $row['owner'];
$result = mysql_query("SELECT owner FROM airport WHERE id='2' LIMIT 1");
$row = mysql_fetch_array ($result);
$ot = $row['owner'];
$result = mysql_query("SELECT owner FROM airport WHERE id='3' LIMIT 1");
$row = mysql_fetch_array($result);
$oth = $row['owner'];
$result = mysql_query("SELECT owner FROM airport WHERE id='4' LIMIT 1");
$row = mysql_fetch_array($result);
$of = $row['owner'];
$result = mysql_query("SELECT owner FROM airport WHERE id='5' LIMIT 1");
$row = mysql_fetch_array($result);
$ofi = $row['owner'];
$result = mysql_query("SELECT owner FROM airport WHERE id='6' LIMIT 1");
$row = mysql_fetch_array ($result);
$os = $row['owner'];
$result = mysql_query("SELECT owner FROM airport WHERE location='$l' LIMIT 1");
$row = mysql_fetch_array($result);
$owner = $row['owner'];
$sql = mysql_query("SELECT * FROM apescrow WHERE other='$u'");
$row = mysql_fetch_array($sql);
if (mysql_num_rows($sql) == 1) {
$own = $row['username'];
$query = mysql_query("SELECT id, health FROM Players WHERE username='$own' LIMIT 1");
$row1 = mysql_fetch_array($query);
$ownerid = $row1['id'];
$money = $row['money'];
$taxm = floor($money * 0.09);
$tmoney = $money + $taxm;
$bullets = $row['bullets'];
$tokens = $row['tokens'];
$location = $row['location'];
echo "<div id='crimestext' align='center'><table><tr><td><center><a href='members/profile.php?id=$ownerid'>$own</a> has started an escrow for $location Airport</center></td></tr>
<tr><td><center>Money: $".number_format($tmoney)." ($".number_format($money)." + $".number_format($taxm).")</center></td></tr>
<tr><td><center>Bullets: ".number_format($bullets)."</center></td></tr>
<tr><td><center>Tokens: ".number_format($tokens)."</center></td></tr></table><br><br>
<form action='members/apescrow.php' method='POST'><input type='submit' value='Accept!' name='Accept'><input type='submit' value='Decline!' name='Decline'></form></div>";
include("members/footer.php");
exit();
}
$now = time();
if ($now < $travel) {
$sl = $travel - $now;
$ml = floor($sl/60);
if ($sl > 89) {
if ($u == $o OR $oo == $u OR $ot == $u OR $oth == $u OR $of == $u OR $ofi == $u OR $os == $u) {
echo "<div id=\"ltable\" align=\"center\"><h1 align=\"center\"><a href=\"members/airporto.php\">Ownership</a></h1></div>";
}
echo "<div id=\"crimestext\"><center>Not so fast! The next flight leaves in $ml minutes!</center></div>";
include("members/footer.php");
} elseif ($sl < 90) {
if ($u == $o OR $oo == $u OR $ot == $u OR $oth == $u OR $of == $u OR $ofi == $u OR $os == $u) {
echo "<div id=\"gameplay\"><h1 align=\"center\"><a href=\"members/airporto.php\">Ownership</a></h1><br></div>";
}
echo "<div id=\"crimestext\"><center>Not so fast! The next flight leaves in $sl seconds!</center></div>";
include("members/footer.php");
}
exit();
} else {
if ($u == $o OR $oo == $u OR $ot == $u OR $oth == $u OR $of == $u OR $ofi == $u OR $os == $u) {
echo "<div id=\"ltable\" align=\"center\"><h1 align=\"center\"><a href=\"members/airporto.php\">Ownership</a></h1><br />";
} else {
echo "<div id=\"ltable\" align=\"center\">";
}
$sql1 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Training Plane'");
$sql2 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Glider'");
$sql3 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Passenger Plane'");
$sql4 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Jumbo Jet'");
$sql5 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Vulcan Bomber'");
$sql6 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='F15 Fighter'");
$sql7 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Eagle Fighter'");
$sql8 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Stealth Fighter'");
$sql9 = mysql_query("SELECT * FROM hanger WHERE username='$u' AND percent=100 AND plane='Eurofighter Typhoon'");
$planes = array();
if (mysql_num_rows($sql1) >= 1) {
$planes[] = "<option value='Training'>Training Plane</option>";
}
if (mysql_num_rows($sql2) > 0) {
$planes[] = "<option value='Gilder'>Glider</option>";
}
if (mysql_num_rows($sql3) > 0) {
$planes[] = "<option value='PP'>Passenger Plane</option>";
}
if (mysql_num_rows($sql4) > 0) {
$planes[] = "<option value='JJ'>Jumbo Jet</option>";
}
if (mysql_num_rows($sql5) > 0) {
$planes[] = "<option value='VB'>Vulcan Bomber</option>";
}
if (mysql_num_rows($sql6) > 0) {
$planes[] = "<option value='F15'>F15 Fighter</option>";
}
if (mysql_num_rows($sql7) > 0) {
$planes[] = "<option value='Eagle'>Eagle Fighter</option>";
}
if (mysql_num_rows($sql8) > 0) {
$planes[] = "<option value='Stealth'>Stealth Fighter</option>";
}
if (mysql_num_rows($sql9) > 0) {
$planes[] = "<option value='Euro'>Eurofighter Typhoon</option>";
}
echo "<h1>Airport</h1>
<p>Select a location from the list below to travel there.</p>
<table><tr><td>
<form action=\"members/airport.php\" method=\"post\">
<input type=\"radio\" name=\"travel\" value=\"UK\" /> UK
<br>
<input type=\"radio\" name=\"travel\" value=\"Russia\" /> Russia
<br>
<input type=\"radio\" name=\"travel\" value=\"USA\" /> USA
<br>
<input type=\"radio\" name=\"travel\" value=\"Australia\" /> Australia
<br>
<input type=\"radio\" name=\"travel\" value=\"Philippines\" /> Philippines
<br>
<select name='Plane'><option value='Airport'>Borrow Airport's</option>";
foreach ($planes as $msg) {
echo "$msg";
}
echo "</select><br /><input type=\"submit\" name=\"submit\" value=\"Do It!\" />
<input type=\"hidden\" name=\"submitted\" value=\"TRUE\" />
</form>
</td></tr></table>
<br />This Airport is owned by <a href=\"members/profile.php?id={$ownerid}\">$owner</a>
</div>";
include("members/footer.php");
}
}
?>