-
Notifications
You must be signed in to change notification settings - Fork 3
/
territory_battle_scores_dark.php
300 lines (277 loc) · 14.3 KB
/
territory_battle_scores_dark.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<?
if(strpos($_SERVER['SERVER_NAME'], "docker")===false) {
require_once("../vars.php");
require_once("../libs.php");
$db = new mymysqli("swgoh");
error_reporting(0);
} else {
require_once("../../vars.php");
require_once("../libs.php");
$db = new mymysqli("swgoh");
error_reporting(E_ALL);
}
$self = explode("/",$_SERVER['PHP_SELF']);
$self = array_pop($self);
function makeInteger($value) {
$value=preg_replace("/[^0-9]/","",$value); //remove non numeric
return intval($value);
}
$gp = empty($_POST['gp']) ? "" : makeInteger(trim($_POST['gp']));
$stars = empty($_POST['stars']) ? "" : makeInteger(trim($_POST['stars']));
$time = empty($_POST['time']) ? "" : makeInteger(trim($_POST['time']));
$recorded = false;
if(!empty($gp) && !empty($stars)) {
$rs = $db->query("INSERT INTO swgoh_tb_scores(gp,stars,stamp,dark) VALUES(".intval($gp).",".intval($stars).",".intval($time).",1)");
$recorded = true;
header("Location: http://shard.swgoh.life/territory_battle_scores_dark.php?recorded=1");
}
if(!empty($_GET['recorded'])) $recorded = true;
?><!DOCTYPE html>
<html>
<head>
<title>SWGOH Tools - Territory Battle Readiness</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<meta charset="utf-8" />
<style>
p { max-width: 800px;}
.swgoh_ad {
position: absolute;
left:0;
top:90px;
width:0;
height:0px;
}
#ad {
width:100%;
height:60px;
}
table { margin-left: 0; border: 1px solid #000;}
td,th { border: 1px solid #666; padding: 10px;}
td:first-child,
th:first-child {
border-left: 1px solid #666;
}
@media(min-width: 520px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 328px; height: 90px; } }
@media(min-width: 720px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 528px; height: 90px; } }
@media(min-width: 920px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 728px; height: 90px; } }
@media(min-width: 1200px) { #top { padding-bottom:0px} #ad { height:90px;} .swgoh_ad { left:inherit; top:0; right:0; width: 1000px; height: 90px; } }
</style>
<script src="https://use.fontawesome.com/c278e2b3ff.js"></script>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
var storage = null;
if(window.localStorage) storage = window.localStorage;
else if(window.globalStorage) storage = window.globalStorage[location.hostname];
$('#gp').on("blur", function() {
var val = $('#gp').val();
val = val.replace(/[.,]/g,"");
val = parseInt(val);
if(val<1000) val=0;
if(val>200000000) val=0;
var value = val.toLocaleString('en-US');
$('#gp').val(value)
});
$('#stars').on("blur", function() {
var val = $('#stars').val();
if(val>45) $('#stars').val(0);
});
function store(key,val) {
storage.setItem(key,val);
}
function fetch(key) {
return storage.getItem(key);
}
});
</script>
</head>
<body>
<div id="top">
<a href="http://www.swgoh.life/index.html" id="logoClick"></a>
<div id="ad">
<!-- Swgoh.life -->
<ins class="adsbygoogle swgoh_ad"
style="display:block"
data-ad-client="ca-pub-0176506581219642"
data-ad-slot="9855290481"
data-ad-format="horizontal"></ins>
<script>
//https://support.google.com/adsense/answer/6307124
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
<div id="middleSolo">
<h1><a href="http://www.swgoh.life/index.html">More Tools</a> > Territory Battle Scores</h1>
<p>The goal of this page is to gather scores from Territory Battle so that we can all see how many stars we can expect to get from TB.</p>
<div class="half">
<? if(!$recorded) { ?>
<form action="<?=$self?>" method="post">
<input type="hidden" name="time" value="<?=time()?>" />
<b>What is your Guild's total GP:</b><br />
<input type="text" id="gp" name="gp" value="" placeholder="50,000,000" /><br /><br />
<b>How many stars did you get in the last Territory Battle:</b><br />
<input type="text" id="stars" name="stars" value="" placeholder="25" /><br /><br />
<input type="submit" value="Record Score" class="btn" />
</form>
<? } else { ?>
<br />
<b>Your score has been recorded</b>
<br />
Please do not enter your score multiple times.
<br />
<? } ?>
</div>
<div class="half">
<b>Results</b><br />
<table>
<tr><th>Guild GP</th><th>Average Stars <i class="fa fa-star"></i></th><th>Range</th><th>Data Points</th></tr>
<?
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>10000 AND gp<=5000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>0 - 5,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>0 - 5,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>5000000 AND gp<=10000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>5,000,000 - 10,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>5,000,000 - 10,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>10000000 AND gp<=20000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>10,000,000 - 20,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>10,000,000 - 20,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>20000000 AND gp<=30000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>20,000,000 - 30,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>20,000,000 - 30,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>30000000 AND gp<=40000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>30,000,000 - 40,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>30,000,000 - 40,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>40000000 AND gp<=50000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>40,000,000 - 50,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>40,000,000 - 50,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>50000000 AND gp<=60000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>50,000,000 - 60,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>50,000,000 - 60,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>60000000 AND gp<=65000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>60,000,000 - 65,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>60,000,000 - 65,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>65000000 AND gp<=70000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>65,000,000 - 70,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>65,000,000 - 70,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>70000000 AND gp<=75000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>70,000,000 - 75,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>70,000,000 - 75,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>75000000 AND gp<=80000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>75,000,000 - 80,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>75,000,000 - 80,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>80000000 AND gp<=85000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>80,000,000 - 85,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>80,000,000 - 85,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>85000000 AND gp<=90000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>85,000,000 - 90,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>85,000,000 - 90,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>90000000 AND gp<=95000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>90,000,000 - 95,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>90,000,000 - 95,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>95000000 AND gp<=100000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>95,000,000 - 100,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>95,000,000 - 100,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>100000000 AND gp<=110000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>100,000,000 - 110,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>100,000,000 - 110,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>110000000 AND gp<=120000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>110,000,000 - 120,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>110,000,000 - 120,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>120000000 AND gp<=130000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>120,000,000 - 130,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>120,000,000 - 130,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>130000000 AND gp<=140000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>130,000,000 - 140,000,000</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>130,000,000 - 140,000,000</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
$rs = $db->query("SELECT avg(stars),count(stars),min(stars),max(stars) FROM swgoh_tb_scores WHERE dark=1 AND gp>140000000");
while($row = $db->getNext($rs)) {
if($row[1]>2) echo "<tr><td>140,000,000+</td><td>".round($row[0])."</td><td>".$row[2]."-".$row[3]."</td>";
else echo "<tr><td>140,000,000+</td><td colspan='2'>Not Enough data</td>";
echo "<td>".$row[1]."</td></tr>";
}
?>
</table>
</div>
<br /><br /><hr /><ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-0176506581219642"
data-ad-slot="6732943283"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-92624-14', 'auto');
ga('send', 'pageview');
</script>
</div>
<div id="foot">
<p>SWGOH.LIFE is not affiliated with EA, EA Capital Games, Disney or Lucasfilm LTD.</p>
</div>
</body>
</html>