Failed Conditions
Pull Request — master (#353)
by Florian
02:54 queued 17s
created
core/cron/pokemon.cron.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 $rarityarray = array();
23 23
 foreach ($counts as $poke_id => $total) {
24 24
 	$rarity = $pokemons->pokemon->$poke_id->rarity;
25
-	isset($rarityarray[$rarity]) ? $rarityarray[$rarity]+=$total : $rarityarray[$rarity]=$total;
25
+	isset($rarityarray[$rarity]) ? $rarityarray[$rarity] += $total : $rarityarray[$rarity] = $total;
26 26
 }
27 27
 
28 28
 // Set amount of Pokemon for each rarity to 0 if there weren't any at that time
Please login to merge, or discard this patch.
core/cron/crontabs.include.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 // Load Query Manager
30 30
 // ###################
31 31
 
32
-include_once __DIR__ . '/../process/queries/QueryManager.php';
32
+include_once __DIR__.'/../process/queries/QueryManager.php';
33 33
 $manager = QueryManager::current();
34 34
 
35 35
 
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 	$pokedatas	= json_decode(file_get_contents($pokemonstats_file), true);
52 52
 }
53 53
 if (is_file($pokedex_counts_file)) {
54
-	$pokecountdatas	= json_decode(file_get_contents($pokedex_counts_file), true);
54
+	$pokecountdatas = json_decode(file_get_contents($pokedex_counts_file), true);
55 55
 }
56 56
 if (is_file($pokedex_raids_file)) {
57
-	$raiddatas	= json_decode(file_get_contents($pokedex_raids_file), true);
57
+	$raiddatas = json_decode(file_get_contents($pokedex_raids_file), true);
58 58
 }
59 59
 
60 60
 
Please login to merge, or discard this patch.
core/js/trainer.graph.js.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 $trainer_lvl = [];
29 29
 # For all 3 teams
30 30
 for ($teamid = 1; $teamid <= 3; $teamid++) {
31
-    $data = $manager->getTrainerLevelCount($teamid);
31
+	$data = $manager->getTrainerLevelCount($teamid);
32 32
 	$trainer_lvl[$teamid] = $data;
33 33
 }
34 34
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 // Load Query Manager
21 21
 // ###################
22 22
 
23
-include_once __DIR__ . '/../process/queries/QueryManager.php';
23
+include_once __DIR__.'/../process/queries/QueryManager.php';
24 24
 $manager = QueryManager::current();
25 25
 
26 26
 # Chart Graph datas	 
Please login to merge, or discard this patch.
core/process/data.loader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 // Load Query Manager
70 70
 // ###################
71 71
 
72
-include_once __DIR__ . '/queries/QueryManager.php';
72
+include_once __DIR__.'/queries/QueryManager.php';
73 73
 $manager = QueryManager::current();
74 74
 
75 75
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
 
270 270
 				// Gym owned and average points
271
-				$data	= $manager->getOwnedAndPoints($team_values->id);
271
+				$data = $manager->getOwnedAndPoints($team_values->id);
272 272
 
273 273
 				$teams->$team_key->gym_owned = $data->total;
274 274
 				$teams->$team_key->average = $data->average_points;
Please login to merge, or discard this patch.
core/process/queries/QueryManagerMysql.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/QueryManagerRocketmap.php';
4
-include_once __DIR__ . '/QueryManagerMonocleHydro.php';
3
+include_once __DIR__.'/QueryManagerRocketmap.php';
4
+include_once __DIR__.'/QueryManagerMonocleHydro.php';
5 5
 
6 6
 
7 7
 abstract class QueryManagerMysql extends QueryManager {
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,11 +4,13 @@  discard block
 block discarded – undo
4 4
 include_once __DIR__ . '/QueryManagerMonocleHydro.php';
5 5
 
6 6
 
7
-abstract class QueryManagerMysql extends QueryManager {
7
+abstract class QueryManagerMysql extends QueryManager
8
+{
8 9
 
9 10
 	protected $mysqli;
10 11
 
11
-	protected function __construct() {
12
+	protected function __construct()
13
+	{
12 14
 		$this->mysqli = new mysqli(SYS_DB_HOST, SYS_DB_USER, SYS_DB_PSWD, SYS_DB_NAME, SYS_DB_PORT);
13 15
 		if ($this->mysqli->connect_error != '') {
14 16
 			header('Location:'.HOST_URL.'offline.html');
@@ -22,7 +24,8 @@  discard block
 block discarded – undo
22 24
 		}
23 25
 	}
24 26
 
25
-	public function __destruct() {
27
+	public function __destruct()
28
+	{
26 29
 		$this->mysqli->close();
27 30
 	}
28 31
 
@@ -30,7 +33,8 @@  discard block
 block discarded – undo
30 33
 	// Misc
31 34
 	/////////
32 35
 
33
-	public function getEcapedString($string) {
36
+	public function getEcapedString($string)
37
+	{
34 38
 		return mysqli_real_escape_string($this->mysqli, $string);
35 39
 	}
36 40
 
Please login to merge, or discard this patch.
core/process/queries/QueryManagerMonocleHydro.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 cp, atk_iv+0 as individual_attack, def_iv+0 as individual_defense, sta_iv+0 as individual_stamina,
158 158
                 ROUND(100*(atk_iv+def_iv+sta_iv)/45,1) AS IV, move_1+0 as move_1, move_2, form
159 159
                 FROM sightings
160
-	            WHERE pokemon_id+0 = '" . $pokemon_id . "' AND move_1+0 IS NOT NULL AND move_1+0 <> '0'
160
+	            WHERE pokemon_id+0 = '" . $pokemon_id."' AND move_1+0 IS NOT NULL AND move_1+0 <> '0'
161 161
 	            GROUP BY encounter_id+0
162 162
 	            ORDER BY $top_order_by $top_direction, expire_timestamp+0 DESC
163 163
 	            LIMIT 0,50";
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
 	function getTop50Trainers($pokemon_id, $best_order_by, $best_direction) {
174 174
 		$trainer_blacklist = "";
175 175
 		if (!empty(self::$config->system->trainer_blacklist)) {
176
-			$trainer_blacklist = " AND owner_name NOT IN ('" . implode("','", self::$config->system->trainer_blacklist) . "')";
176
+			$trainer_blacklist = " AND owner_name NOT IN ('".implode("','", self::$config->system->trainer_blacklist)."')";
177 177
 		}
178 178
 
179 179
 		$req = "SELECT owner_name as trainer_name, ROUND(SUM(100*((atk_iv+0)+(def_iv+0)+(sta_iv+0))/45),1) AS IV, move_1, move_2, cp+0 as cp,
180 180
                 FROM_UNIXTIME(last_modified+0) AS lasttime, last_modified+0 as last_seen
181 181
                 FROM gym_defenders
182
-				WHERE pokemon_id+0 = '" . $pokemon_id . "'" . $trainer_blacklist . "
182
+				WHERE pokemon_id+0 = '" . $pokemon_id."'".$trainer_blacklist."
183 183
 				GROUP BY external_id
184 184
 				ORDER BY $best_order_by $best_direction, owner_name+'' ASC
185 185
 				LIMIT 0,50";
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
 
223 223
 	public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons) {
224 224
 		$inmap_pkms_filter = "";
225
-		$where = " WHERE expire_timestamp >= UNIX_TIMESTAMP() AND pokemon_id = " . $pokemon_id;
225
+		$where = " WHERE expire_timestamp >= UNIX_TIMESTAMP() AND pokemon_id = ".$pokemon_id;
226 226
 
227
-		$reqTestIv = "SELECT MAX(atk_iv) AS iv FROM sightings " . $where;
227
+		$reqTestIv = "SELECT MAX(atk_iv) AS iv FROM sightings ".$where;
228 228
 		$resultTestIv = $this->mysqli->query($reqTestIv);
229 229
 		$testIv = $resultTestIv->fetch_object();
230 230
 		if (!is_null($inmap_pokemons) && ($inmap_pokemons != "")) {
@@ -232,20 +232,20 @@  discard block
 block discarded – undo
232 232
 				$inmap_pkms_filter .= "'".$inmap."',";
233 233
 			}
234 234
 			$inmap_pkms_filter = rtrim($inmap_pkms_filter, ",");
235
-			$where .= " AND encounter_id NOT IN (" . $inmap_pkms_filter . ") ";
235
+			$where .= " AND encounter_id NOT IN (".$inmap_pkms_filter.") ";
236 236
 		}
237 237
 		if ($testIv->iv != null && !is_null($ivMin) && ($ivMin != "")) {
238
-			$where .= " AND ((100/45)*(atk_iv + def_iv + sta_iv)) >= (" . $ivMin . ") ";
238
+			$where .= " AND ((100/45)*(atk_iv + def_iv + sta_iv)) >= (".$ivMin.") ";
239 239
 		}
240 240
 		if ($testIv->iv != null && !is_null($ivMax) && ($ivMax != "")) {
241
-			$where .= " AND ((100/45)*(atk_iv + def_iv + sta_iv)) <= (" . $ivMax . ") ";
241
+			$where .= " AND ((100/45)*(atk_iv + def_iv + sta_iv)) <= (".$ivMax.") ";
242 242
 		}
243 243
 		$req = "SELECT pokemon_id, lat AS latitude, lon AS longitude,
244 244
     					FROM_UNIXTIME(expire_timestamp) AS disappear_time,
245 245
     					FROM_UNIXTIME(expire_timestamp) AS disappear_time_real,
246 246
     					atk_iv AS individual_attack, def_iv AS individual_defense, sta_iv AS individual_stamina,
247 247
    						move_1, move_2
248
-					FROM sightings " . $where . "
248
+					FROM sightings " . $where."
249 249
 					ORDER BY disappear_time DESC
250 250
 					LIMIT 5000";
251 251
 		$result = $this->mysqli->query($req);
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		$req = "SELECT COUNT(DISTINCT(fs.fort_id)) AS total, ROUND((SUM(gd.cp)) / COUNT(DISTINCT(fs.fort_id)),0) AS average_points
315 315
         			FROM fort_sightings fs
316 316
         			JOIN gym_defenders gd ON fs.fort_id = gd.fort_id
317
-        			WHERE fs.team = '" . $team_id . "'";
317
+        			WHERE fs.team = '" . $team_id."'";
318 318
 		$result = $this->mysqli->query($req);
319 319
 		$data = $result->fetch_object();
320 320
 		return $data;
@@ -461,13 +461,13 @@  discard block
 block discarded – undo
461 461
 	public function getNestData() {
462 462
 		$pokemon_exclude_sql = "";
463 463
 		if (!empty(self::$config->system->nest_exclude_pokemon)) {
464
-			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (" . implode(",", self::$config->system->nest_exclude_pokemon) . ")";
464
+			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (".implode(",", self::$config->system->nest_exclude_pokemon).")";
465 465
 		}
466 466
 		$req = "SELECT p.pokemon_id, p.lat AS latitude, p.lon AS longitude, count(p.pokemon_id) AS total_pokemon, s.updated, coalesce(duration,30)*60 as duration
467 467
 			          FROM sightings p
468 468
 			          INNER JOIN spawnpoints s ON (p.spawn_id = s.spawn_id)
469 469
 			          WHERE p.expire_timestamp > UNIX_TIMESTAMP() - 86400
470
-			          " . $pokemon_exclude_sql . "
470
+			          " . $pokemon_exclude_sql."
471 471
 			          GROUP BY p.spawn_id, p.pokemon_id
472 472
 			          HAVING COUNT(p.pokemon_id) >= 6
473 473
 			          ORDER BY p.pokemon_id";
Please login to merge, or discard this patch.
Braces   +76 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,12 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class QueryManagerMonocleHydro extends QueryManagerMysql {
3
+class QueryManagerMonocleHydro extends QueryManagerMysql
4
+{
4 5
 
5
-	public function __construct() {
6
+	public function __construct()
7
+	{
6 8
 		parent::__construct();
7 9
 	}
8 10
 
9
-	public function __destruct() {
11
+	public function __destruct()
12
+	{
10 13
 		parent::__destruct();
11 14
 	}
12 15
 
@@ -14,7 +17,8 @@  discard block
 block discarded – undo
14 17
 	// TesterF
15 18
 	///////////
16 19
 
17
-	function testTotalPokemon() {
20
+	function testTotalPokemon()
21
+	{
18 22
 		$req = "SELECT COUNT(*) as total FROM sightings";
19 23
 		$result = $this->mysqli->query($req);
20 24
 		if (!is_object($result)) {
@@ -30,7 +34,8 @@  discard block
 block discarded – undo
30 34
 		return 0;
31 35
 	}
32 36
 
33
-	function testTotalGyms() {
37
+	function testTotalGyms()
38
+	{
34 39
 		$req = "SELECT COUNT(*) as total FROM forts";
35 40
 		$result = $this->mysqli->query($req);
36 41
 		if (!is_object($result)) {
@@ -46,7 +51,8 @@  discard block
 block discarded – undo
46 51
 		return 0;
47 52
 	}
48 53
 
49
-	function testTotalPokestops() {
54
+	function testTotalPokestops()
55
+	{
50 56
 		$req = "SELECT COUNT(*) as total FROM pokestops";
51 57
 		$result = $this->mysqli->query($req);
52 58
 		if (!is_object($result)) {
@@ -67,26 +73,30 @@  discard block
 block discarded – undo
67 73
 	// Homepage
68 74
 	/////////////
69 75
 
70
-	function getTotalPokemon() {
76
+	function getTotalPokemon()
77
+	{
71 78
 		$req = "SELECT COUNT(*) AS total FROM sightings WHERE expire_timestamp >= UNIX_TIMESTAMP()";
72 79
 		$result = $this->mysqli->query($req);
73 80
 		$data = $result->fetch_object();
74 81
 		return $data;
75 82
 	}
76 83
 
77
-	function getTotalLures() {
84
+	function getTotalLures()
85
+	{
78 86
 		$data = (object) array("total" => 0);
79 87
 		return $data;
80 88
 	}
81 89
 
82
-	function getTotalGyms() {
90
+	function getTotalGyms()
91
+	{
83 92
 		$req = "SELECT COUNT(*) AS total FROM forts";
84 93
 		$result = $this->mysqli->query($req);
85 94
 		$data = $result->fetch_object();
86 95
 		return $data;
87 96
 	}
88 97
 
89
-	function getTotalRaids() {
98
+	function getTotalRaids()
99
+	{
90 100
 		$req = "SELECT COUNT(*) AS total FROM raids WHERE time_battle <= UNIX_TIMESTAMP() AND time_end >= UNIX_TIMESTAMP()";
91 101
 		$result = $this->mysqli->query($req);
92 102
 		$data = $result->fetch_object();
@@ -94,14 +104,16 @@  discard block
 block discarded – undo
94 104
 	}
95 105
 
96 106
 
97
-	function getTotalGymsForTeam($team_id) {
107
+	function getTotalGymsForTeam($team_id)
108
+	{
98 109
 		$req = "SELECT COUNT(*) AS total FROM fort_sightings WHERE team = '$team_id'";
99 110
 		$result = $this->mysqli->query($req);
100 111
 		$data = $result->fetch_object();
101 112
 		return $data;
102 113
 	}
103 114
 
104
-	function getRecentAll() {
115
+	function getRecentAll()
116
+	{
105 117
 		$req = "SELECT DISTINCT pokemon_id, encounter_id, FROM_UNIXTIME(expire_timestamp) AS disappear_time, FROM_UNIXTIME(updated+0) AS last_modified, FROM_UNIXTIME(expire_timestamp) AS disappear_time_real,
106 118
               lat AS latitude, lon AS longitude, cp, atk_iv AS individual_attack, def_iv AS individual_defense, sta_iv AS individual_stamina
107 119
               FROM sightings
@@ -117,7 +129,8 @@  discard block
 block discarded – undo
117 129
 		return $data;
118 130
 	}
119 131
 
120
-	function getRecentMythic($mythic_pokemon) {
132
+	function getRecentMythic($mythic_pokemon)
133
+	{
121 134
 		$req = "SELECT DISTINCT pokemon_id as pokemon_id, CONCAT('A', encounter_id) as encounter_id, FROM_UNIXTIME(expire_timestamp) AS disappear_time, FROM_UNIXTIME(updated+0) AS last_modified, FROM_UNIXTIME(expire_timestamp) AS disappear_time_real,
122 135
                 lat AS latitude, lon AS longitude, cp, atk_iv AS individual_attack, def_iv AS individual_defense, sta_iv AS individual_stamina
123 136
                 FROM sightings
@@ -138,14 +151,16 @@  discard block
 block discarded – undo
138 151
 	// Single Pokemon
139 152
 	///////////////////
140 153
 
141
-	function getGymsProtectedByPokemon($pokemon_id) {
154
+	function getGymsProtectedByPokemon($pokemon_id)
155
+	{
142 156
 		$req = "SELECT COUNT(DISTINCT(fort_id)) AS total FROM fort_sightings WHERE guard_pokemon_id = '".$pokemon_id."'";
143 157
 		$result = $this->mysqli->query($req);
144 158
 		$data = $result->fetch_object();
145 159
 		return $data;
146 160
 	}
147 161
 
148
-	function getPokemonLastSeen($pokemon_id) {
162
+	function getPokemonLastSeen($pokemon_id)
163
+	{
149 164
 		$req = "SELECT FROM_UNIXTIME(expire_timestamp) AS expire_timestamp, FROM_UNIXTIME(expire_timestamp) AS disappear_time_real, lat AS latitude, lon AS longitude
150 165
                 FROM sightings
151 166
                 WHERE pokemon_id = '".$pokemon_id."'
@@ -156,7 +171,8 @@  discard block
 block discarded – undo
156 171
 		return $data;
157 172
 	}
158 173
 
159
-	function getTop50Pokemon($pokemon_id, $top_order_by, $top_direction) {
174
+	function getTop50Pokemon($pokemon_id, $top_order_by, $top_direction)
175
+	{
160 176
 		$req = "SELECT FROM_UNIXTIME(expire_timestamp+0) AS distime, pokemon_id+0 as pokemon_id, FROM_UNIXTIME(expire_timestamp+0) as disappear_time, lat as latitude, lon as longitude,
161 177
                 cp, atk_iv+0 as individual_attack, def_iv+0 as individual_defense, sta_iv+0 as individual_stamina,
162 178
                 ROUND(100*(atk_iv+def_iv+sta_iv)/45,1) AS IV, move_1+0 as move_1, move_2, form
@@ -174,7 +190,8 @@  discard block
 block discarded – undo
174 190
 		return $top;
175 191
 	}
176 192
 
177
-	function getTop50Trainers($pokemon_id, $best_order_by, $best_direction) {
193
+	function getTop50Trainers($pokemon_id, $best_order_by, $best_direction)
194
+	{
178 195
 		$trainer_blacklist = "";
179 196
 		if (!empty(self::$config->system->trainer_blacklist)) {
180 197
 			$trainer_blacklist = " AND owner_name NOT IN ('" . implode("','", self::$config->system->trainer_blacklist) . "')";
@@ -196,7 +213,8 @@  discard block
 block discarded – undo
196 213
 		return $toptrainer;
197 214
 	}
198 215
 
199
-	public function getPokemonHeatmap($pokemon_id, $start, $end) {
216
+	public function getPokemonHeatmap($pokemon_id, $start, $end)
217
+	{
200 218
 		$where = " WHERE pokemon_id = ".$pokemon_id." "
201 219
 			. "AND FROM_UNIXTIME(expire_timestamp) BETWEEN '".$start."' AND '".$end."'";
202 220
 		$req 		= "SELECT lat AS latitude, lon AS longitude FROM sightings".$where." ORDER BY expire_timestamp DESC LIMIT 100000";
@@ -208,7 +226,8 @@  discard block
 block discarded – undo
208 226
 		return $points;
209 227
 	}
210 228
 
211
-	public function getPokemonGraph($pokemon_id) {
229
+	public function getPokemonGraph($pokemon_id)
230
+	{
212 231
 		$req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour
213 232
 					FROM (SELECT FROM_UNIXTIME(expire_timestamp) as disappear_time FROM sightings WHERE pokemon_id = '".$pokemon_id."' ORDER BY disappear_time LIMIT 100000) AS pokemonFiltered
214 233
 				GROUP BY disappear_hour
@@ -224,7 +243,8 @@  discard block
 block discarded – undo
224 243
 		return $array;
225 244
 	}
226 245
 
227
-	public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons) {
246
+	public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons)
247
+	{
228 248
 		$inmap_pkms_filter = "";
229 249
 		$where = " WHERE expire_timestamp >= UNIX_TIMESTAMP() AND pokemon_id = " . $pokemon_id;
230 250
 
@@ -260,14 +280,16 @@  discard block
 block discarded – undo
260 280
 		return $spawns;
261 281
 	}
262 282
 
263
-	public function getPokemonSliederMinMax() {
283
+	public function getPokemonSliederMinMax()
284
+	{
264 285
 		$req = "SELECT FROM_UNIXTIME(MIN(expire_timestamp)) AS min, FROM_UNIXTIME(MAX(expire_timestamp)) AS max FROM sightings";
265 286
 		$result = $this->mysqli->query($req);
266 287
 		$data = $result->fetch_object();
267 288
 		return $data;
268 289
 	}
269 290
 
270
-	public function getMapsCoords() {
291
+	public function getMapsCoords()
292
+	{
271 293
 		$req = "SELECT MAX(lat) AS max_latitude, MIN(lat) AS min_latitude, MAX(lon) AS max_longitude, MIN(lon) as min_longitude FROM spawnpoints";
272 294
 		$result = $this->mysqli->query($req);
273 295
 		$data = $result->fetch_object();
@@ -280,14 +302,16 @@  discard block
 block discarded – undo
280 302
 	//////////////
281 303
 
282 304
 
283
-	function getTotalPokestops() {
305
+	function getTotalPokestops()
306
+	{
284 307
 		$req = "SELECT COUNT(*) as total FROM pokestops";
285 308
 		$result = $this->mysqli->query($req);
286 309
 		$data = $result->fetch_object();
287 310
 		return $data;
288 311
 	}
289 312
 
290
-	public function getAllPokestops() {
313
+	public function getAllPokestops()
314
+	{
291 315
 		$req = "SELECT lat as latitude, lon as longitude, null AS lure_expiration, UNIX_TIMESTAMP() AS now, null AS lure_expiration_real FROM pokestops";
292 316
 		$result = $this->mysqli->query($req);
293 317
 		$pokestops = array();
@@ -302,7 +326,8 @@  discard block
 block discarded – undo
302 326
 	// Gyms
303 327
 	/////////
304 328
 
305
-	function getTeamGuardians($team_id) {
329
+	function getTeamGuardians($team_id)
330
+	{
306 331
 		$req = "SELECT COUNT(*) AS total, guard_pokemon_id FROM fort_sightings WHERE team = '".$team_id."' GROUP BY guard_pokemon_id ORDER BY total DESC LIMIT 0,3";
307 332
 		$result = $this->mysqli->query($req);
308 333
 
@@ -314,7 +339,8 @@  discard block
 block discarded – undo
314 339
 		return $datas;
315 340
 	}
316 341
 
317
-	function getOwnedAndPoints($team_id) {
342
+	function getOwnedAndPoints($team_id)
343
+	{
318 344
 		$req = "SELECT COUNT(DISTINCT(fs.fort_id)) AS total, ROUND((SUM(gd.cp)) / COUNT(DISTINCT(fs.fort_id)),0) AS average_points
319 345
         			FROM fort_sightings fs
320 346
         			JOIN gym_defenders gd ON fs.fort_id = gd.fort_id
@@ -324,7 +350,8 @@  discard block
 block discarded – undo
324 350
 		return $data;
325 351
 	}
326 352
 
327
-	function getAllGyms() {
353
+	function getAllGyms()
354
+	{
328 355
 		$req = "SELECT f.id as gym_id, team as team_id, f.lat as latitude, f.lon as longitude, updated as last_scanned, (6 - fs.slots_available) AS level FROM forts f LEFT JOIN fort_sightings fs ON f.id = fs.fort_id;";
329 356
 		$result = $this->mysqli->query($req);
330 357
 		$gyms = array();
@@ -334,7 +361,8 @@  discard block
 block discarded – undo
334 361
 		return $gyms;
335 362
 	}
336 363
 
337
-	public function getGymData($gym_id) {
364
+	public function getGymData($gym_id)
365
+	{
338 366
 		$gym_id = $this->mysqli->real_escape_string($_GET['gym_id']);
339 367
 		$req = "SELECT f.name AS name, null AS description, f.url AS url, fs.team AS team, FROM_UNIXTIME(fs.updated) AS last_scanned, fs.guard_pokemon_id AS guard_pokemon_id, (6 - fs.slots_available) AS level, SUM(gd.cp) as total_cp	
340 368
 			FROM fort_sightings fs
@@ -346,7 +374,8 @@  discard block
 block discarded – undo
346 374
 		return $data;
347 375
 	}
348 376
 
349
-	public function getGymDefenders($gym_id) {
377
+	public function getGymDefenders($gym_id)
378
+	{
350 379
 		$req = "SELECT DISTINCT external_id as pokemon_uid, pokemon_id, atk_iv as iv_attack, def_iv as iv_defense, sta_iv as iv_stamina, cp, fort_id as gym_id
351 380
 			FROM gym_defenders 
352 381
 			WHERE fort_id='".$gym_id."'
@@ -364,7 +393,8 @@  discard block
 block discarded – undo
364 393
 	// Raids
365 394
 	///////////
366 395
 
367
-	public function getAllRaids($page) {
396
+	public function getAllRaids($page)
397
+	{
368 398
 		$limit = " LIMIT ".($page * 10).",10";
369 399
 		$req = "SELECT r.fort_id AS gym_id, r.level AS level, r.pokemon_id AS pokemon_id, r.cp AS cp, r.move_1 AS move_1, r.move_2 AS move_2, FROM_UNIXTIME(r.time_spawn) AS spawn, FROM_UNIXTIME(r.time_battle) AS start, FROM_UNIXTIME(r.time_end) AS end, FROM_UNIXTIME(fs.updated) AS last_scanned, f.name, f.lat AS latitude, f.lon as longitude 
370 400
 					FROM raids r 
@@ -385,11 +415,13 @@  discard block
 block discarded – undo
385 415
 	// Trainers
386 416
 	//////////////
387 417
 
388
-	public function getTrainers($trainer_name, $team, $page, $ranking) {
418
+	public function getTrainers($trainer_name, $team, $page, $ranking)
419
+	{
389 420
 		return array(); // Waiting for Monocle to store level
390 421
 	}
391 422
 
392
-	public function getTrainerLevelCount($team_id) {
423
+	public function getTrainerLevelCount($team_id)
424
+	{
393 425
 		$levelData = array();
394 426
 		for ($i = 5; $i <= 40; $i++) {
395 427
 			if (!isset($levelData[$i])) {
@@ -404,7 +436,8 @@  discard block
 block discarded – undo
404 436
 	// Cron
405 437
 	/////////
406 438
 
407
-	public function getPokemonCountsActive() {
439
+	public function getPokemonCountsActive()
440
+	{
408 441
 		$req = "SELECT pokemon_id, COUNT(*) as total FROM sightings WHERE expire_timestamp >= UNIX_TIMESTAMP() GROUP BY pokemon_id";
409 442
 		$result = $this->mysqli->query($req);
410 443
 		$counts = array();
@@ -414,7 +447,8 @@  discard block
 block discarded – undo
414 447
 		return $counts;
415 448
 	}
416 449
 
417
-	public function getPoekmonCountsLastDay() {
450
+	public function getPoekmonCountsLastDay()
451
+	{
418 452
 		$req = "SELECT pokemon_id, COUNT(*) AS spawns_last_day
419 453
 					FROM sightings
420 454
 					WHERE FROM_UNIXTIME(expire_timestamp) >= (SELECT FROM_UNIXTIME(MAX(expire_timestamp)) FROM sightings) - INTERVAL 1 DAY
@@ -428,7 +462,8 @@  discard block
 block discarded – undo
428 462
 		return $counts;
429 463
 	}
430 464
 
431
-	public function getPokemonSinceLastUpdate($pokemon_id, $last_update) {
465
+	public function getPokemonSinceLastUpdate($pokemon_id, $last_update)
466
+	{
432 467
 		$req = "SELECT COUNT(*) AS count, MAX(expire_timestamp) AS last_timestamp, (FROM_UNIXTIME(MAX(expire_timestamp))) AS disappear_time_real, lat as latitude, lon as longitude
433 468
 					FROM sightings
434 469
 					WHERE pokemon_id = '".$pokemon_id."' && expire_timestamp > '".$last_update."'";
@@ -437,7 +472,8 @@  discard block
 block discarded – undo
437 472
 		return $data;
438 473
 	}
439 474
 
440
-	public function getRaidsSinceLastUpdate($pokemon_id, $last_update) {
475
+	public function getRaidsSinceLastUpdate($pokemon_id, $last_update)
476
+	{
441 477
 		$where = "WHERE pokemon_id = '".$pokemon_id."' && time_battle > '".$last_update."'";
442 478
 		$req = "SELECT time_battle AS start_timestamp, time_end as end, (FROM_UNIXTIME(time_end)) AS end_time_real, lat as latitude, lon as longitude, count
443 479
 					FROM raids r
@@ -455,14 +491,16 @@  discard block
 block discarded – undo
455 491
 		return $data;
456 492
 	}
457 493
 
458
-	public function getCaptchaCount() {
494
+	public function getCaptchaCount()
495
+	{
459 496
 		$req = " SELECT COUNT(*) as total FROM accounts WHERE captchaed IS NOT NULL AND reason IS NULL";
460 497
 		$result = $this->mysqli->query($req);
461 498
 		$data = $result->fetch_object();
462 499
 		return $data;
463 500
 	}
464 501
 
465
-	public function getNestData() {
502
+	public function getNestData()
503
+	{
466 504
 		$pokemon_exclude_sql = "";
467 505
 		if (!empty(self::$config->system->nest_exclude_pokemon)) {
468 506
 			$pokemon_exclude_sql = "AND p.pokemon_id NOT IN (" . implode(",", self::$config->system->nest_exclude_pokemon) . ")";
Please login to merge, or discard this patch.
core/process/aru.php 2 patches
Switch Indentation   +309 added lines, -309 removed lines patch added patch discarded remove patch
@@ -59,118 +59,118 @@  discard block
 block discarded – undo
59 59
 	//
60 60
 	############################
61 61
 
62
-	case 'home_update':
63
-		$values = [];
64
-		// Right now
65
-		// ---------
66
-		$data = $manager->getTotalPokemon();
67
-		$values[] = $data->total;
62
+		case 'home_update':
63
+			$values = [];
64
+			// Right now
65
+			// ---------
66
+			$data = $manager->getTotalPokemon();
67
+			$values[] = $data->total;
68 68
 
69
-		// Lured stops
70
-		// -----------
71
-		$data = $manager->getTotalLures();
72
-		$values[] = $data->total;
69
+			// Lured stops
70
+			// -----------
71
+			$data = $manager->getTotalLures();
72
+			$values[] = $data->total;
73 73
 
74
-		// Active Raids
75
-		// -----------
76
-		$data = $manager->getTotalRaids();
77
-		$values[] = $data->total;
74
+			// Active Raids
75
+			// -----------
76
+			$data = $manager->getTotalRaids();
77
+			$values[] = $data->total;
78 78
 
79
-		// Team battle
80
-		// -----------
81
-		$data = $manager->getTotalGyms();
82
-		$values[] = $data->total;
79
+			// Team battle
80
+			// -----------
81
+			$data = $manager->getTotalGyms();
82
+			$values[] = $data->total;
83 83
 
84
-		// Red
85
-		$data = $manager->getTotalGymsForTeam(2);
86
-		$values[] = $data->total;
84
+			// Red
85
+			$data = $manager->getTotalGymsForTeam(2);
86
+			$values[] = $data->total;
87 87
 
88
-		// Blue
89
-		$data = $manager->getTotalGymsForTeam(1);
90
-		$values[] = $data->total;
88
+			// Blue
89
+			$data = $manager->getTotalGymsForTeam(1);
90
+			$values[] = $data->total;
91 91
 
92
-		// Yellow
93
-		$data = $manager->getTotalGymsForTeam(3);
94
-		$values[] = $data->total;
92
+			// Yellow
93
+			$data = $manager->getTotalGymsForTeam(3);
94
+			$values[] = $data->total;
95 95
 
96
-		// Neutral
97
-		$data = $manager->getTotalGymsForTeam(0);
98
-		$values[] = $data->total;
96
+			// Neutral
97
+			$data = $manager->getTotalGymsForTeam(0);
98
+			$values[] = $data->total;
99 99
 
100 100
 
101
-		header('Content-Type: application/json');
102
-		echo json_encode($values);
101
+			header('Content-Type: application/json');
102
+			echo json_encode($values);
103 103
 
104
-		break;
104
+			break;
105 105
 
106 106
 
107
-	####################################
108
-	//
109
-	// Update latests spawn on homepage
110
-	//
111
-	####################################
107
+		####################################
108
+		//
109
+		// Update latests spawn on homepage
110
+		//
111
+		####################################
112 112
 
113
-	case 'spawnlist_update':
114
-		// Recent spawn
115
-		// ------------
116
-		$total_spawns = array();
117
-		$last_uid_param = "";
118
-		if (isset($_GET['last_uid'])) {
119
-			$last_uid_param = $_GET['last_uid'];
120
-		}
121
-		if ($config->system->recents_filter) {
122
-			// get all mythic pokemon ids
123
-			$mythic_pokemons = array();
124
-			foreach ($pokemons->pokemon as $id => $pokemon) {
125
-				if ($pokemon->spawn_rate < $config->system->recents_filter_rarity && $pokemon->rating >= $config->system->recents_filter_rating) {
126
-					$mythic_pokemons[] = $id;
127
-				}
113
+		case 'spawnlist_update':
114
+			// Recent spawn
115
+			// ------------
116
+			$total_spawns = array();
117
+			$last_uid_param = "";
118
+			if (isset($_GET['last_uid'])) {
119
+				$last_uid_param = $_GET['last_uid'];
128 120
 			}
121
+			if ($config->system->recents_filter) {
122
+				// get all mythic pokemon ids
123
+				$mythic_pokemons = array();
124
+				foreach ($pokemons->pokemon as $id => $pokemon) {
125
+					if ($pokemon->spawn_rate < $config->system->recents_filter_rarity && $pokemon->rating >= $config->system->recents_filter_rating) {
126
+						$mythic_pokemons[] = $id;
127
+					}
128
+				}
129 129
 
130
-			// get last mythic pokemon
131
-			$result = $manager->getRecentMythic($mythic_pokemons);
132
-		} else {
133
-			// get last pokemon
134
-			$result = $manager->getRecentAll();
135
-		}
130
+				// get last mythic pokemon
131
+				$result = $manager->getRecentMythic($mythic_pokemons);
132
+			} else {
133
+				// get last pokemon
134
+				$result = $manager->getRecentAll();
135
+			}
136 136
 
137
-		if (count($result) > 0) {
138
-			foreach ($result as $data) {
139
-				$new_spawn = array();
140
-				$pokeid = $data->pokemon_id;
141
-				$pokeuid = $data->encounter_id;
142
-
143
-				if ($last_uid_param != $pokeuid) {
144
-					$last_seen = strtotime($data->disappear_time_real);
145
-
146
-					$location_link = isset($config->system->location_url) ? $config->system->location_url : 'https://maps.google.com/?q={latitude},{longitude}&ll={latitude},{longitude}&z=16';
147
-					$location_link = str_replace('{latitude}', $data->latitude, $location_link);
148
-					$location_link = str_replace('{longitude}', $data->longitude, $location_link);
149
-
150
-					if ($config->system->recents_encounter_details) {
151
-						$encdetails = new stdClass();
152
-						$encdetails->cp = $data->cp;
153
-						$encdetails->attack = $data->individual_attack;
154
-						$encdetails->defense = $data->individual_defense;
155
-						$encdetails->stamina = $data->individual_stamina;
156
-						if (isset($encdetails->cp) && isset($encdetails->attack) && isset($encdetails->defense) && isset($encdetails->stamina)) {
157
-							$encdetails->available = true;
158
-						} else {
159
-							$encdetails->available = false;
137
+			if (count($result) > 0) {
138
+				foreach ($result as $data) {
139
+					$new_spawn = array();
140
+					$pokeid = $data->pokemon_id;
141
+					$pokeuid = $data->encounter_id;
142
+
143
+					if ($last_uid_param != $pokeuid) {
144
+						$last_seen = strtotime($data->disappear_time_real);
145
+
146
+						$location_link = isset($config->system->location_url) ? $config->system->location_url : 'https://maps.google.com/?q={latitude},{longitude}&ll={latitude},{longitude}&z=16';
147
+						$location_link = str_replace('{latitude}', $data->latitude, $location_link);
148
+						$location_link = str_replace('{longitude}', $data->longitude, $location_link);
149
+
150
+						if ($config->system->recents_encounter_details) {
151
+							$encdetails = new stdClass();
152
+							$encdetails->cp = $data->cp;
153
+							$encdetails->attack = $data->individual_attack;
154
+							$encdetails->defense = $data->individual_defense;
155
+							$encdetails->stamina = $data->individual_stamina;
156
+							if (isset($encdetails->cp) && isset($encdetails->attack) && isset($encdetails->defense) && isset($encdetails->stamina)) {
157
+								$encdetails->available = true;
158
+							} else {
159
+								$encdetails->available = false;
160
+							}
160 161
 						}
161
-					}
162 162
 
163
-					$html = '
163
+						$html = '
164 164
                     <div class="col-md-1 col-xs-4 pokemon-single" data-pokeid="' . $pokeid . '" data-pokeuid="' . $pokeuid . '" style="display: none;">
165 165
                     <a href="pokemon/' . $pokeid . '"><img src="' . $pokemons->pokemon->$pokeid->img . '" alt="' . $pokemons->pokemon->$pokeid->name . '" class="img-responsive"></a>
166 166
                     <a href="pokemon/' . $pokeid . '"><p class="pkmn-name">' . $pokemons->pokemon->$pokeid->name . '</p></a>
167 167
                     <a href="' . $location_link . '" target="_blank">
168 168
                         <small class="pokemon-timer">00:00:00</small>
169 169
                     </a>';
170
-					if ($config->system->recents_encounter_details) {
171
-						if ($encdetails->available) {
172
-							if ($config->system->iv_numbers) {
173
-								$html .= '
170
+						if ($config->system->recents_encounter_details) {
171
+							if ($encdetails->available) {
172
+								if ($config->system->iv_numbers) {
173
+									$html .= '
174 174
                                 <div class="progress" style="height: 15px; margin-bottom: 0">
175 175
                                     <div title="' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $encdetails->attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
176 176
                                         <span class="sr-only">' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '</span>' . $encdetails->attack . '
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
                                         <span class="sr-only">' . $locales->IV_STAMINA . ': ' . $encdetails->stamina . '</span>' . $encdetails->stamina . '
183 183
                                     </div>
184 184
                                 </div>';
185
-							} else {
186
-								$html .= '
185
+								} else {
186
+									$html .= '
187 187
                                 <div class="progress" style="height: 6px; width: 80%; margin: 5px auto 0 auto">
188 188
                                 <div title="' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $encdetails->attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (((100 / 15) * $encdetails->attack) / 3) . '%">
189 189
                                         <span class="sr-only">' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '</span>
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
                                         <span class="sr-only">' . $locales->IV_STAMINA . ': ' . $encdetails->stamina . '</span>
196 196
                                 </div>
197 197
                                 </div>';
198
-							}
199
-							$html .= '<small>' . $encdetails->cp . '</small>';
200
-						} else {
201
-							if ($config->system->iv_numbers) {
202
-								$html .= '
198
+								}
199
+								$html .= '<small>' . $encdetails->cp . '</small>';
200
+							} else {
201
+								if ($config->system->iv_numbers) {
202
+									$html .= '
203 203
                                 <div class="progress" style="height: 15px; margin-bottom: 0">
204 204
                                     <div title="' . $locales->IV_ATTACK . ': not available" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $encdetails->attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
205 205
                                         <span class="sr-only">' . $locales->IV_ATTACK . ': ' . $locales->NOT_AVAILABLE . '</span>?
@@ -211,116 +211,116 @@  discard block
 block discarded – undo
211 211
                                         <span class="sr-only">' . $locales->IV_STAMINA . ': ' . $locales->NOT_AVAILABLE . '</span>?
212 212
                                     </div>
213 213
                                 </div>';
214
-							} else {
215
-								$html .= '
214
+								} else {
215
+									$html .= '
216 216
                             <div class="progress" style="height: 6px; width: 80%; margin: 5px auto 0 auto">
217 217
                                 <div title="IV not available" class="progress-bar" role="progressbar" style="width: 100%; background-color: rgb(210,210,210)" aria-valuenow="1" aria-valuemin="0" aria-valuemax="1">
218 218
                                     <span class="sr-only">IV ' . $locales->NOT_AVAILABLE . '</span>
219 219
                                 </div>
220 220
                             </div>';
221
+								}
222
+								$html .= '<small>???</small>';
221 223
 							}
222
-							$html .= '<small>???</small>';
223 224
 						}
224
-					}
225
-					$html .= '
225
+						$html .= '
226 226
                     </div>';
227
-					$new_spawn['html'] = $html;
228
-					$countdown = $last_seen - time();
229
-					$new_spawn['countdown'] = $countdown;
230
-					$new_spawn['pokemon_uid'] = $pokeuid;
231
-					$total_spawns[] = $new_spawn;
232
-				} else {
233
-					break;
227
+						$new_spawn['html'] = $html;
228
+						$countdown = $last_seen - time();
229
+						$new_spawn['countdown'] = $countdown;
230
+						$new_spawn['pokemon_uid'] = $pokeuid;
231
+						$total_spawns[] = $new_spawn;
232
+					} else {
233
+						break;
234
+					}
234 235
 				}
235 236
 			}
236
-		}
237 237
 
238
-		header('Content-Type: application/json');
239
-		echo json_encode($total_spawns);
238
+			header('Content-Type: application/json');
239
+			echo json_encode($total_spawns);
240 240
 
241
-		break;
241
+			break;
242 242
 
243 243
 
244
-	####################################
245
-	//
246
-	// List Pokestop
247
-	//
248
-	####################################
244
+		####################################
245
+		//
246
+		// List Pokestop
247
+		//
248
+		####################################
249 249
 
250
-	case 'pokestop':
251
-		$datas = $manager->getAllPokestops();
250
+		case 'pokestop':
251
+			$datas = $manager->getAllPokestops();
252 252
 
253
-		$pokestops = [];
254
-		foreach ($datas as $data) {
255
-			if ($data->lure_expiration >= $data->now) {
256
-				$icon = 'pokestap_lured.png';
257
-				$text = sprintf($locales->POKESTOPS_MAP_LURED, date('H:i:s', strtotime($data->lure_expiration_real)));
258
-				$lured = true;
259
-			} else {
260
-				$icon = 'pokestap.png';
261
-				$text = $locales->POKESTOPS_MAP_REGULAR;
262
-				$lured = false;
263
-			}
253
+			$pokestops = [];
254
+			foreach ($datas as $data) {
255
+				if ($data->lure_expiration >= $data->now) {
256
+					$icon = 'pokestap_lured.png';
257
+					$text = sprintf($locales->POKESTOPS_MAP_LURED, date('H:i:s', strtotime($data->lure_expiration_real)));
258
+					$lured = true;
259
+				} else {
260
+					$icon = 'pokestap.png';
261
+					$text = $locales->POKESTOPS_MAP_REGULAR;
262
+					$lured = false;
263
+				}
264 264
 
265
-			$pokestops[] = [
266
-				$text,
267
-				$icon,
268
-				$data->latitude,
269
-				$data->longitude,
270
-				$lured
271
-			];
272
-		}
265
+				$pokestops[] = [
266
+					$text,
267
+					$icon,
268
+					$data->latitude,
269
+					$data->longitude,
270
+					$lured
271
+				];
272
+			}
273 273
 
274
-		header('Content-Type: application/json');
275
-		echo json_encode($pokestops);
274
+			header('Content-Type: application/json');
275
+			echo json_encode($pokestops);
276 276
 
277
-		break;
277
+			break;
278 278
 
279 279
 
280
-	####################################
281
-	//
282
-	// Update data for the gym battle
283
-	//
284
-	####################################
280
+		####################################
281
+		//
282
+		// Update data for the gym battle
283
+		//
284
+		####################################
285 285
 
286
-	case 'update_gym':
287
-		$teams = new stdClass();
288
-		$teams->mystic = 1;
289
-		$teams->valor = 2;
290
-		$teams->instinct = 3;
286
+		case 'update_gym':
287
+			$teams = new stdClass();
288
+			$teams->mystic = 1;
289
+			$teams->valor = 2;
290
+			$teams->instinct = 3;
291 291
 
292
-		foreach ($teams as $team_name => $team_id) {
292
+			foreach ($teams as $team_name => $team_id) {
293 293
 
294
-			$data	= $manager->getOwnedAndPoints($team_id);
294
+				$data	= $manager->getOwnedAndPoints($team_id);
295 295
 
296
-			$return[] = $data->total;
297
-			$return[] = $data->average_points;
298
-		}
296
+				$return[] = $data->total;
297
+				$return[] = $data->average_points;
298
+			}
299 299
 
300
-		header('Content-Type: application/json');
301
-		echo json_encode($return);
300
+			header('Content-Type: application/json');
301
+			echo json_encode($return);
302 302
 
303
-		break;
303
+			break;
304 304
 
305 305
 
306
-	####################################
307
-	//
308
-	// Get datas for the gym map
309
-	//
310
-	####################################
306
+		####################################
307
+		//
308
+		// Get datas for the gym map
309
+		//
310
+		####################################
311 311
 
312 312
 
313
-	case 'gym_map':
314
-		$datas = $manager->getAllGyms();
313
+		case 'gym_map':
314
+			$datas = $manager->getAllGyms();
315 315
 
316
-		$gyms = [];
317
-		foreach ($datas as $data) {
318
-			// Team
319
-			// 1 = bleu
320
-			// 2 = rouge
321
-			// 3 = jaune
316
+			$gyms = [];
317
+			foreach ($datas as $data) {
318
+				// Team
319
+				// 1 = bleu
320
+				// 2 = rouge
321
+				// 3 = jaune
322 322
 
323
-			switch ($data->team_id) {
323
+				switch ($data->team_id) {
324 324
 				case 0:
325 325
 					$icon	= 'map_white.png';
326 326
 					$team	= 'No Team (yet)';
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 					$team	= 'Team Instinct';
345 345
 					$color = 'rgba(254, 217, 40, .6)';
346 346
 					break;
347
-			}
347
+				}
348 348
 
349 349
 			if ($data->team_id != 0) {
350 350
 				$icon .= $data->level.".png";
@@ -370,37 +370,37 @@  discard block
 block discarded – undo
370 370
 	//
371 371
 	####################################
372 372
 
373
-	case 'gym_defenders':
374
-		$gym_id = $manager->getEcapedString($_GET['gym_id']);
373
+		case 'gym_defenders':
374
+			$gym_id = $manager->getEcapedString($_GET['gym_id']);
375 375
 
376
-		$data = $manager->getGymData($gym_id);
377
-		$gymData['gymDetails']['gymInfos'] = false;
376
+			$data = $manager->getGymData($gym_id);
377
+			$gymData['gymDetails']['gymInfos'] = false;
378 378
 
379
-		if (!is_null($data)) {
380
-			$gymData['gymDetails']['gymInfos']['name'] = $data->name;
381
-			$gymData['gymDetails']['gymInfos']['description'] = $data->description;
382
-			if ($data->url == null) {
383
-				$gymData['gymDetails']['gymInfos']['url'] = '';
384
-			} else {
385
-				$gymData['gymDetails']['gymInfos']['url'] = $data->url;
386
-			}
387
-			$gymData['gymDetails']['gymInfos']['points'] = $data->total_cp;
388
-			$gymData['gymDetails']['gymInfos']['level'] = $data->level;
389
-			$gymData['gymDetails']['gymInfos']['last_scanned'] = $data->last_scanned;
390
-			$gymData['gymDetails']['gymInfos']['team'] = $data->team;
391
-			$gymData['gymDetails']['gymInfos']['guardPokemonId'] = $data->guard_pokemon_id;
392
-
393
-			// Skip Query if team is none
394
-			if ($data->team > 0) {
395
-				$datas = $manager->getGymDefenders($gym_id);
396
-				$gymData['infoWindow'] = '
379
+			if (!is_null($data)) {
380
+				$gymData['gymDetails']['gymInfos']['name'] = $data->name;
381
+				$gymData['gymDetails']['gymInfos']['description'] = $data->description;
382
+				if ($data->url == null) {
383
+					$gymData['gymDetails']['gymInfos']['url'] = '';
384
+				} else {
385
+					$gymData['gymDetails']['gymInfos']['url'] = $data->url;
386
+				}
387
+				$gymData['gymDetails']['gymInfos']['points'] = $data->total_cp;
388
+				$gymData['gymDetails']['gymInfos']['level'] = $data->level;
389
+				$gymData['gymDetails']['gymInfos']['last_scanned'] = $data->last_scanned;
390
+				$gymData['gymDetails']['gymInfos']['team'] = $data->team;
391
+				$gymData['gymDetails']['gymInfos']['guardPokemonId'] = $data->guard_pokemon_id;
392
+
393
+				// Skip Query if team is none
394
+				if ($data->team > 0) {
395
+					$datas = $manager->getGymDefenders($gym_id);
396
+					$gymData['infoWindow'] = '
397 397
 				<div class="gym_defenders">
398 398
 				';
399
-				foreach ($datas as $data) {
400
-					$gymData['gymDetails']['pokemons'][] = $data;
401
-					$pokemon_id = $data->pokemon_id;
402
-					if ($config->system->iv_numbers) {
403
-						$gymData['infoWindow'] .= '
399
+					foreach ($datas as $data) {
400
+						$gymData['gymDetails']['pokemons'][] = $data;
401
+						$pokemon_id = $data->pokemon_id;
402
+						if ($config->system->iv_numbers) {
403
+							$gymData['infoWindow'] .= '
404 404
 					<div style="text-align: center; width: 50px; display: inline-block; margin-right: 3px">
405 405
 						<a href="pokemon/' . $data->pokemon_id . '">
406 406
 						<img src="' . $pokemons->pokemon->$pokemon_id->img . '" height="50" style="display:inline-block" >
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 								</div>
419 419
 							</div>
420 420
 						</div>';
421
-					} else {
422
-						$gymData['infoWindow'] .= '
421
+						} else {
422
+							$gymData['infoWindow'] .= '
423 423
 					<div style="text-align: center; width: 50px; display: inline-block; margin-right: 3px">
424 424
 						<a href="pokemon/' . $data->pokemon_id . '">
425 425
 						<img src="' . $pokemons->pokemon->$pokemon_id->img . '" height="50" style="display:inline-block" >
@@ -437,148 +437,148 @@  discard block
 block discarded – undo
437 437
 							</div>
438 438
 						</div>
439 439
 					</div>';
440
+						}
440 441
 					}
441 442
 				}
442 443
 			}
443
-		}
444
-
445
-		$gymData['infoWindow'] = $gymData['infoWindow'].'</div>';
446 444
 
447
-		header('Content-Type: application/json');
448
-		echo json_encode($gymData);
445
+			$gymData['infoWindow'] = $gymData['infoWindow'].'</div>';
449 446
 
450
-		break;
447
+			header('Content-Type: application/json');
448
+			echo json_encode($gymData);
451 449
 
450
+			break;
452 451
 
453
-	case 'trainer':
454
-		$name = "";
455
-		$page = "0";
456
-		$team = 0;
457
-		$ranking = 0;
458
-		if (isset($_GET['name'])) {
459
-			$trainer_name = $manager->getEcapedString($_GET['name']);
460
-		}
461
-		if (isset($_GET['team'])) {
462
-			$team = $manager->getEcapedString($_GET['team']);
463
-		}
464
-		if (isset($_GET['page'])) {
465
-			$page = $manager->getEcapedString($_GET['page']);
466
-		}
467
-		if (isset($_GET['ranking'])) {
468
-			$ranking = $manager->getEcapedString($_GET['ranking']);
469
-		}
470 452
 
471
-		$trainers = $manager->getTrainers($trainer_name, $team, $page, $ranking);
472
-		$json = array();
473
-		$json['trainers'] = $trainers;
474
-		$locale = array();
475
-		$locale["today"] = $locales->TODAY;
476
-		$locale["day"] = $locales->DAY;
477
-		$locale["days"] = $locales->DAYS;
478
-		$locale["ivAttack"] = $locales->IV_ATTACK;
479
-		$locale["ivDefense"] = $locales->IV_DEFENSE;
480
-		$locale["ivStamina"] = $locales->IV_STAMINA;
481
-		$json['locale'] = $locale;
453
+		case 'trainer':
454
+			$name = "";
455
+			$page = "0";
456
+			$team = 0;
457
+			$ranking = 0;
458
+			if (isset($_GET['name'])) {
459
+				$trainer_name = $manager->getEcapedString($_GET['name']);
460
+			}
461
+			if (isset($_GET['team'])) {
462
+				$team = $manager->getEcapedString($_GET['team']);
463
+			}
464
+			if (isset($_GET['page'])) {
465
+				$page = $manager->getEcapedString($_GET['page']);
466
+			}
467
+			if (isset($_GET['ranking'])) {
468
+				$ranking = $manager->getEcapedString($_GET['ranking']);
469
+			}
482 470
 
483
-		header('Content-Type: application/json');
484
-		echo json_encode($json);
471
+			$trainers = $manager->getTrainers($trainer_name, $team, $page, $ranking);
472
+			$json = array();
473
+			$json['trainers'] = $trainers;
474
+			$locale = array();
475
+			$locale["today"] = $locales->TODAY;
476
+			$locale["day"] = $locales->DAY;
477
+			$locale["days"] = $locales->DAYS;
478
+			$locale["ivAttack"] = $locales->IV_ATTACK;
479
+			$locale["ivDefense"] = $locales->IV_DEFENSE;
480
+			$locale["ivStamina"] = $locales->IV_STAMINA;
481
+			$json['locale'] = $locale;
485 482
 
486
-		break;
483
+			header('Content-Type: application/json');
484
+			echo json_encode($json);
487 485
 
486
+			break;
488 487
 
489
-	case 'raids':
490
-		$page = "0";
491
-		if (isset($_GET['page'])) {
492
-			$page = $manager->getEcapedString($_GET['page']);
493
-		}
494 488
 
495
-		$datas = $manager->getAllRaids($page);
496
-		$i = 1;
497
-		foreach ($datas as $data) {
498
-			$data->starttime = date("H:i", strtotime($data->start));
499
-			$data->endtime = date("H:i", strtotime($data->end));
500
-			$data->gym_id = str_replace('.', '_', $data->gym_id);
501
-			if (isset($data->move_1)) {
502
-				$move1 = $data->move_1;
503
-				$data->quick_move = $move->$move1->name;
504
-			} else {
505
-				$data->quick_move = "?";
489
+		case 'raids':
490
+			$page = "0";
491
+			if (isset($_GET['page'])) {
492
+				$page = $manager->getEcapedString($_GET['page']);
506 493
 			}
507
-			if (isset($data->move_2)) {
508
-				$move2 = $data->move_2;
509
-				$data->charge_move = $move->$move2->name;
510
-			} else {
511
-				$data->charge_move = "?";
494
+
495
+			$datas = $manager->getAllRaids($page);
496
+			$i = 1;
497
+			foreach ($datas as $data) {
498
+				$data->starttime = date("H:i", strtotime($data->start));
499
+				$data->endtime = date("H:i", strtotime($data->end));
500
+				$data->gym_id = str_replace('.', '_', $data->gym_id);
501
+				if (isset($data->move_1)) {
502
+					$move1 = $data->move_1;
503
+					$data->quick_move = $move->$move1->name;
504
+				} else {
505
+					$data->quick_move = "?";
506
+				}
507
+				if (isset($data->move_2)) {
508
+					$move2 = $data->move_2;
509
+					$data->charge_move = $move->$move2->name;
510
+				} else {
511
+					$data->charge_move = "?";
512
+				}
513
+				$raids[10*$page + $i] = $data;
514
+				$i++;
512 515
 			}
513
-			$raids[10*$page + $i] = $data;
514
-			$i++;
515
-		}
516
-		$json = array();
517
-		$json['raids'] = $raids;
518
-		$locale = array();
519
-		$locale['noraids'] = $locales->RAIDS_NONE;
520
-		$json['locale'] = $locale;
516
+			$json = array();
517
+			$json['raids'] = $raids;
518
+			$locale = array();
519
+			$locale['noraids'] = $locales->RAIDS_NONE;
520
+			$json['locale'] = $locale;
521 521
 
522
-		header('Content-Type: application/json');
523
-		echo json_encode($json);
522
+			header('Content-Type: application/json');
523
+			echo json_encode($json);
524 524
 
525
-		break;
525
+			break;
526 526
 
527
-	case 'pokemon_slider_init':
528
-		$bounds		= $manager->getPokemonSliederMinMax();
527
+		case 'pokemon_slider_init':
528
+			$bounds		= $manager->getPokemonSliederMinMax();
529 529
 
530
-		header('Content-Type: application/json');
531
-		echo json_encode($bounds);
530
+			header('Content-Type: application/json');
531
+			echo json_encode($bounds);
532 532
 
533
-		break;
533
+			break;
534 534
 
535 535
 
536
-	case 'pokemon_heatmap_points':
537
-		$json = "";
538
-		if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['pokemon_id'])) {
539
-			$start = date("Y-m-d H:i", (int) $_GET['start']);
540
-			$end = date("Y-m-d H:i", (int) $_GET['end']);
541
-			$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
542
-			$points = $manager->getPokemonHeatmap($pokemon_id, $start, $end);
536
+		case 'pokemon_heatmap_points':
537
+			$json = "";
538
+			if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['pokemon_id'])) {
539
+				$start = date("Y-m-d H:i", (int) $_GET['start']);
540
+				$end = date("Y-m-d H:i", (int) $_GET['end']);
541
+				$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
542
+				$points = $manager->getPokemonHeatmap($pokemon_id, $start, $end);
543 543
 
544
-			$json = json_encode($points);
545
-		}
544
+				$json = json_encode($points);
545
+			}
546 546
 
547
-		header('Content-Type: application/json');
548
-		echo $json;
549
-		break;
547
+			header('Content-Type: application/json');
548
+			echo $json;
549
+			break;
550 550
 
551 551
 
552
-	case 'maps_localization_coordinates':
553
-		$coordinates = $manager->getMapsCoords();
552
+		case 'maps_localization_coordinates':
553
+			$coordinates = $manager->getMapsCoords();
554 554
 
555
-		header('Content-Type: application/json');
556
-		echo json_encode($coordinates);
555
+			header('Content-Type: application/json');
556
+			echo json_encode($coordinates);
557 557
 
558
-		break;
558
+			break;
559 559
 
560 560
 
561
-	case 'pokemon_graph_data':
562
-		$json = "";
563
-		if (isset($_GET['pokemon_id'])) {
564
-			$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
565
-			$array = $manager->getPokemonGraph($pokemon_id);
561
+		case 'pokemon_graph_data':
562
+			$json = "";
563
+			if (isset($_GET['pokemon_id'])) {
564
+				$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
565
+				$array = $manager->getPokemonGraph($pokemon_id);
566 566
 
567
-			$json = json_encode($array);
568
-		}
567
+				$json = json_encode($array);
568
+			}
569 569
 
570
-		header('Content-Type: application/json');
571
-		echo $json;
572
-		break;
570
+			header('Content-Type: application/json');
571
+			echo $json;
572
+			break;
573 573
 
574 574
 
575
-	case 'postRequest':
576
-		break;
575
+		case 'postRequest':
576
+			break;
577 577
 
578
-	default:
579
-		echo "What do you mean?";
580
-		exit();
581
-	break;
578
+		default:
579
+			echo "What do you mean?";
580
+			exit();
581
+		break;
582 582
 }
583 583
 
584 584
 if ($postRequest != "") {
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 // Load Query Manager
41 41
 // ###################
42 42
 
43
-include_once __DIR__ . '/queries/QueryManager.php';
43
+include_once __DIR__.'/queries/QueryManager.php';
44 44
 $manager = QueryManager::current();
45 45
 
46 46
 $request = "";
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 					}
162 162
 
163 163
 					$html = '
164
-                    <div class="col-md-1 col-xs-4 pokemon-single" data-pokeid="' . $pokeid . '" data-pokeuid="' . $pokeuid . '" style="display: none;">
165
-                    <a href="pokemon/' . $pokeid . '"><img src="' . $pokemons->pokemon->$pokeid->img . '" alt="' . $pokemons->pokemon->$pokeid->name . '" class="img-responsive"></a>
166
-                    <a href="pokemon/' . $pokeid . '"><p class="pkmn-name">' . $pokemons->pokemon->$pokeid->name . '</p></a>
167
-                    <a href="' . $location_link . '" target="_blank">
164
+                    <div class="col-md-1 col-xs-4 pokemon-single" data-pokeid="' . $pokeid.'" data-pokeuid="'.$pokeuid.'" style="display: none;">
165
+                    <a href="pokemon/' . $pokeid.'"><img src="'.$pokemons->pokemon->$pokeid->img.'" alt="'.$pokemons->pokemon->$pokeid->name.'" class="img-responsive"></a>
166
+                    <a href="pokemon/' . $pokeid.'"><p class="pkmn-name">'.$pokemons->pokemon->$pokeid->name.'</p></a>
167
+                    <a href="' . $location_link.'" target="_blank">
168 168
                         <small class="pokemon-timer">00:00:00</small>
169 169
                     </a>';
170 170
 					if ($config->system->recents_encounter_details) {
@@ -172,50 +172,50 @@  discard block
 block discarded – undo
172 172
 							if ($config->system->iv_numbers) {
173 173
 								$html .= '
174 174
                                 <div class="progress" style="height: 15px; margin-bottom: 0">
175
-                                    <div title="' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $encdetails->attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
176
-                                        <span class="sr-only">' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '</span>' . $encdetails->attack . '
175
+                                    <div title="' . $locales->IV_ATTACK.': '.$encdetails->attack.'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$encdetails->attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 16px">
176
+                                        <span class="sr-only">' . $locales->IV_ATTACK.': '.$encdetails->attack.'</span>'.$encdetails->attack.'
177 177
                                     </div>
178
-                                    <div title="' . $locales->IV_DEFENSE . ': ' . $encdetails->defense . '" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="' . $encdetails->defense . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
179
-                                        <span class="sr-only">' . $locales->IV_DEFENSE . ': ' . $encdetails->defense . '</span>' . $encdetails->defense . '
178
+                                    <div title="' . $locales->IV_DEFENSE.': '.$encdetails->defense.'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$encdetails->defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 16px">
179
+                                        <span class="sr-only">' . $locales->IV_DEFENSE.': '.$encdetails->defense.'</span>'.$encdetails->defense.'
180 180
                                     </div>
181
-                                    <div title="' . $locales->IV_STAMINA . ': ' . $encdetails->stamina . '" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $encdetails->stamina . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
182
-                                        <span class="sr-only">' . $locales->IV_STAMINA . ': ' . $encdetails->stamina . '</span>' . $encdetails->stamina . '
181
+                                    <div title="' . $locales->IV_STAMINA.': '.$encdetails->stamina.'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$encdetails->stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 16px">
182
+                                        <span class="sr-only">' . $locales->IV_STAMINA.': '.$encdetails->stamina.'</span>'.$encdetails->stamina.'
183 183
                                     </div>
184 184
                                 </div>';
185 185
 							} else {
186 186
 								$html .= '
187 187
                                 <div class="progress" style="height: 6px; width: 80%; margin: 5px auto 0 auto">
188
-                                <div title="' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $encdetails->attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (((100 / 15) * $encdetails->attack) / 3) . '%">
189
-                                        <span class="sr-only">' . $locales->IV_ATTACK . ': ' . $encdetails->attack . '</span>
188
+                                <div title="' . $locales->IV_ATTACK.': '.$encdetails->attack.'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$encdetails->attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $encdetails->attack) / 3).'%">
189
+                                        <span class="sr-only">' . $locales->IV_ATTACK.': '.$encdetails->attack.'</span>
190 190
                                 </div>
191
-                                <div title="' . $locales->IV_DEFENSE . ': ' . $encdetails->defense . '" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="' . $encdetails->defense . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (((100 / 15) * $encdetails->defense) / 3) . '%">
192
-                                        <span class="sr-only">' . $locales->IV_DEFENSE . ': ' . $encdetails->defense . '</span>
191
+                                <div title="' . $locales->IV_DEFENSE.': '.$encdetails->defense.'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$encdetails->defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $encdetails->defense) / 3).'%">
192
+                                        <span class="sr-only">' . $locales->IV_DEFENSE.': '.$encdetails->defense.'</span>
193 193
                                 </div>
194
-                                <div title="' . $locales->IV_STAMINA . ': ' . $encdetails->stamina . '" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $encdetails->stamina . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (((100 / 15) * $encdetails->stamina) / 3) . '%">
195
-                                        <span class="sr-only">' . $locales->IV_STAMINA . ': ' . $encdetails->stamina . '</span>
194
+                                <div title="' . $locales->IV_STAMINA.': '.$encdetails->stamina.'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$encdetails->stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $encdetails->stamina) / 3).'%">
195
+                                        <span class="sr-only">' . $locales->IV_STAMINA.': '.$encdetails->stamina.'</span>
196 196
                                 </div>
197 197
                                 </div>';
198 198
 							}
199
-							$html .= '<small>' . $encdetails->cp . '</small>';
199
+							$html .= '<small>'.$encdetails->cp.'</small>';
200 200
 						} else {
201 201
 							if ($config->system->iv_numbers) {
202 202
 								$html .= '
203 203
                                 <div class="progress" style="height: 15px; margin-bottom: 0">
204
-                                    <div title="' . $locales->IV_ATTACK . ': not available" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $encdetails->attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
205
-                                        <span class="sr-only">' . $locales->IV_ATTACK . ': ' . $locales->NOT_AVAILABLE . '</span>?
204
+                                    <div title="' . $locales->IV_ATTACK.': not available" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$encdetails->attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 16px">
205
+                                        <span class="sr-only">' . $locales->IV_ATTACK.': '.$locales->NOT_AVAILABLE.'</span>?
206 206
                                     </div>
207
-                                    <div title="' . $locales->IV_DEFENSE . ': not available" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="' . $encdetails->defense . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
208
-                                        <span class="sr-only">' . $locales->IV_DEFENSE . ': ' . $locales->NOT_AVAILABLE . '</span>?
207
+                                    <div title="' . $locales->IV_DEFENSE.': not available" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$encdetails->defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 16px">
208
+                                        <span class="sr-only">' . $locales->IV_DEFENSE.': '.$locales->NOT_AVAILABLE.'</span>?
209 209
                                     </div>
210
-                                    <div title="' . $locales->IV_STAMINA . ': not available" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $encdetails->stamina . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 16px">
211
-                                        <span class="sr-only">' . $locales->IV_STAMINA . ': ' . $locales->NOT_AVAILABLE . '</span>?
210
+                                    <div title="' . $locales->IV_STAMINA.': not available" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$encdetails->stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 16px">
211
+                                        <span class="sr-only">' . $locales->IV_STAMINA.': '.$locales->NOT_AVAILABLE.'</span>?
212 212
                                     </div>
213 213
                                 </div>';
214 214
 							} else {
215 215
 								$html .= '
216 216
                             <div class="progress" style="height: 6px; width: 80%; margin: 5px auto 0 auto">
217 217
                                 <div title="IV not available" class="progress-bar" role="progressbar" style="width: 100%; background-color: rgb(210,210,210)" aria-valuenow="1" aria-valuemin="0" aria-valuemax="1">
218
-                                    <span class="sr-only">IV ' . $locales->NOT_AVAILABLE . '</span>
218
+                                    <span class="sr-only">IV ' . $locales->NOT_AVAILABLE.'</span>
219 219
                                 </div>
220 220
                             </div>';
221 221
 							}
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
 		foreach ($teams as $team_name => $team_id) {
293 293
 
294
-			$data	= $manager->getOwnedAndPoints($team_id);
294
+			$data = $manager->getOwnedAndPoints($team_id);
295 295
 
296 296
 			$return[] = $data->total;
297 297
 			$return[] = $data->average_points;
@@ -402,38 +402,38 @@  discard block
 block discarded – undo
402 402
 					if ($config->system->iv_numbers) {
403 403
 						$gymData['infoWindow'] .= '
404 404
 					<div style="text-align: center; width: 50px; display: inline-block; margin-right: 3px">
405
-						<a href="pokemon/' . $data->pokemon_id . '">
406
-						<img src="' . $pokemons->pokemon->$pokemon_id->img . '" height="50" style="display:inline-block" >
405
+						<a href="pokemon/' . $data->pokemon_id.'">
406
+						<img src="' . $pokemons->pokemon->$pokemon_id->img.'" height="50" style="display:inline-block" >
407 407
 						</a>
408
-						<p class="pkmn-name">' . $data->cp . '</p>
408
+						<p class="pkmn-name">' . $data->cp.'</p>
409 409
 						<div class="progress" style="height: 12px; margin-bottom: 0">
410
-							<div title="' . $locales->IV_ATTACK . ': ' . $data->iv_attack . '" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $data->iv_attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 13px; font-size: 11px">
411
-								<span class="sr-only">' . $locales->IV_ATTACK . ' : ' . $data->iv_attack . '</span>' . $data->iv_attack . '
410
+							<div title="' . $locales->IV_ATTACK.': '.$data->iv_attack.'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$data->iv_attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 13px; font-size: 11px">
411
+								<span class="sr-only">' . $locales->IV_ATTACK.' : '.$data->iv_attack.'</span>'.$data->iv_attack.'
412 412
 								</div>
413
-								<div title="' . $locales->IV_DEFENSE . ': ' . $data->iv_defense . '" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="' . $data->iv_defense . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 13px; font-size: 11px">
414
-									<span class="sr-only">' . $locales->IV_DEFENSE . ' : ' . $data->iv_defense . '</span>' . $data->iv_defense . '
413
+								<div title="' . $locales->IV_DEFENSE.': '.$data->iv_defense.'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$data->iv_defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 13px; font-size: 11px">
414
+									<span class="sr-only">' . $locales->IV_DEFENSE.' : '.$data->iv_defense.'</span>'.$data->iv_defense.'
415 415
 								</div>
416
-								<div title="' . $locales->IV_STAMINA . ': ' . $data->iv_stamina . '" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $data->iv_stamina . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (100 / 3) . '%; line-height: 13px; font-size: 11px">
417
-									<span class="sr-only">' . $locales->IV_STAMINA . ' : ' . $data->iv_stamina . '</span>' . $data->iv_stamina . '
416
+								<div title="' . $locales->IV_STAMINA.': '.$data->iv_stamina.'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$data->iv_stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(100 / 3).'%; line-height: 13px; font-size: 11px">
417
+									<span class="sr-only">' . $locales->IV_STAMINA.' : '.$data->iv_stamina.'</span>'.$data->iv_stamina.'
418 418
 								</div>
419 419
 							</div>
420 420
 						</div>';
421 421
 					} else {
422 422
 						$gymData['infoWindow'] .= '
423 423
 					<div style="text-align: center; width: 50px; display: inline-block; margin-right: 3px">
424
-						<a href="pokemon/' . $data->pokemon_id . '">
425
-						<img src="' . $pokemons->pokemon->$pokemon_id->img . '" height="50" style="display:inline-block" >
424
+						<a href="pokemon/' . $data->pokemon_id.'">
425
+						<img src="' . $pokemons->pokemon->$pokemon_id->img.'" height="50" style="display:inline-block" >
426 426
 						</a>
427
-						<p class="pkmn-name">' . $data->cp . '</p>
427
+						<p class="pkmn-name">' . $data->cp.'</p>
428 428
 						<div class="progress" style="height: 4px; width: 40px; margin-bottom: 10px; margin-top: 2px; margin-left: auto; margin-right: auto">
429
-							<div title="' . $locales->IV_ATTACK . ': ' . $data->iv_attack . '" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="' . $data->iv_attack . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (((100 / 15) * $data->iv_attack) / 3) . '%">
430
-								<span class="sr-only">' . $locales->IV_ATTACK . ': ' . $data->iv_attack . '</span>
429
+							<div title="' . $locales->IV_ATTACK.': '.$data->iv_attack.'" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$data->iv_attack.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $data->iv_attack) / 3).'%">
430
+								<span class="sr-only">' . $locales->IV_ATTACK.': '.$data->iv_attack.'</span>
431 431
 							</div>
432
-							<div title="' . $locales->IV_DEFENSE . ': ' . $data->iv_defense . '" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="' . $data->iv_defense . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (((100 / 15) * $data->iv_defense) / 3) . '%">
433
-								<span class="sr-only">' . $locales->IV_DEFENSE . ': ' . $data->iv_defense . '</span>
432
+							<div title="' . $locales->IV_DEFENSE.': '.$data->iv_defense.'" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="'.$data->iv_defense.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $data->iv_defense) / 3).'%">
433
+								<span class="sr-only">' . $locales->IV_DEFENSE.': '.$data->iv_defense.'</span>
434 434
 							</div>
435
-							<div title="' . $locales->IV_STAMINA . ': ' . $data->iv_stamina . '" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $data->iv_stamina . '" aria-valuemin="0" aria-valuemax="45" style="width: ' . (((100 / 15) * $data->iv_stamina) / 3) . '%">
436
-								<span class="sr-only">' . $locales->IV_STAMINA . ': ' . $data->iv_stamina . '</span>
435
+							<div title="' . $locales->IV_STAMINA.': '.$data->iv_stamina.'" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="'.$data->iv_stamina.'" aria-valuemin="0" aria-valuemax="45" style="width: '.(((100 / 15) * $data->iv_stamina) / 3).'%">
436
+								<span class="sr-only">' . $locales->IV_STAMINA.': '.$data->iv_stamina.'</span>
437 437
 							</div>
438 438
 						</div>
439 439
 					</div>';
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 			} else {
511 511
 				$data->charge_move = "?";
512 512
 			}
513
-			$raids[10*$page + $i] = $data;
513
+			$raids[10 * $page + $i] = $data;
514 514
 			$i++;
515 515
 		}
516 516
 		$json = array();
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 		break;
526 526
 
527 527
 	case 'pokemon_slider_init':
528
-		$bounds		= $manager->getPokemonSliederMinMax();
528
+		$bounds = $manager->getPokemonSliederMinMax();
529 529
 
530 530
 		header('Content-Type: application/json');
531 531
 		echo json_encode($bounds);
Please login to merge, or discard this patch.
core/process/queries/QueryManager.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../../../config.php';
4
-include_once __DIR__ . '/QueryManagerMysql.php';
3
+include_once __DIR__.'/../../../config.php';
4
+include_once __DIR__.'/QueryManagerMysql.php';
5 5
 
6 6
 abstract class QueryManager {
7 7
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 		if (self::$current == null) {
16 16
 
17
-			$variables = realpath(dirname(__FILE__)) . '/../../json/variables.json';
17
+			$variables = realpath(dirname(__FILE__)).'/../../json/variables.json';
18 18
 			self::$config = json_decode(file_get_contents($variables));
19 19
 
20 20
 			include_once(SYS_PATH.'/core/process/timezone.loader.php');
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		}
33 33
 		return self::$current;
34 34
 	}
35
-	private function __construct(){}
35
+	private function __construct() {}
36 36
 
37 37
 	// Misc
38 38
 	abstract public function getEcapedString($string);
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,13 +3,15 @@  discard block
 block discarded – undo
3 3
 include_once __DIR__ . '/../../../config.php';
4 4
 include_once __DIR__ . '/QueryManagerMysql.php';
5 5
 
6
-abstract class QueryManager {
6
+abstract class QueryManager
7
+{
7 8
 
8 9
 	protected static $time_offset;
9 10
 	protected static $config;
10 11
 
11 12
 	private static $current;
12
-	public static function current() {
13
+	public static function current()
14
+	{
13 15
 		global $time_offset;
14 16
 
15 17
 		if (self::$current == null) {
@@ -32,7 +34,9 @@  discard block
 block discarded – undo
32 34
 		}
33 35
 		return self::$current;
34 36
 	}
35
-	private function __construct(){}
37
+	private function __construct()
38
+	{
39
+}
36 40
 
37 41
 	// Misc
38 42
 	abstract public function getEcapedString($string);
Please login to merge, or discard this patch.
install/tester.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 // Load Query Manager
4 4
 // ###################
5 5
 
6
-include_once __DIR__ . '/../core/process/queries/QueryManager.php';
6
+include_once __DIR__.'/../core/process/queries/QueryManager.php';
7 7
 
8 8
 
9 9
 ########################################################################
Please login to merge, or discard this patch.