Failed Conditions
Pull Request — master (#353)
by Florian
02:31
created
core/process/locales.loader.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return array Sorted list of "accept" options
21 21
  */
22
-$sortAccept = function ($header) {
22
+$sortAccept = function($header) {
23 23
 	$matches = array();
24 24
 	foreach (explode(',', $header) as $option) {
25 25
 		$option = array_map('trim', explode(';', $option));
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
  *
53 53
  * @return string|NULL a matched option, or NULL if no match
54 54
  */
55
-$matchAccept = function ($header, $supported) use ($sortAccept) {
55
+$matchAccept = function($header, $supported) use ($sortAccept) {
56 56
 	$matches = $sortAccept($header);
57 57
 	foreach ($matches as $key => $q) {
58 58
 		if (isset($supported[$key])) {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
  *
84 84
  * @return string The negotiated language result or the supplied default.
85 85
  */
86
-$negotiateLanguage = function ($supported, $default = 'en-US') use ($matchAccept) {
86
+$negotiateLanguage = function($supported, $default = 'en-US') use ($matchAccept) {
87 87
 	$supp = array();
88 88
 	foreach ($supported as $lang => $isSupported) {
89 89
 		if ($isSupported) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return array Sorted list of "accept" options
21 21
  */
22
-$sortAccept = function ($header) {
22
+$sortAccept = function ($header)
23
+{
23 24
 	$matches = array();
24 25
 	foreach (explode(',', $header) as $option) {
25 26
 		$option = array_map('trim', explode(';', $option));
@@ -52,7 +53,8 @@  discard block
 block discarded – undo
52 53
  *
53 54
  * @return string|NULL a matched option, or NULL if no match
54 55
  */
55
-$matchAccept = function ($header, $supported) use ($sortAccept) {
56
+$matchAccept = function ($header, $supported) use ($sortAccept)
57
+{
56 58
 	$matches = $sortAccept($header);
57 59
 	foreach ($matches as $key => $q) {
58 60
 		if (isset($supported[$key])) {
@@ -83,7 +85,8 @@  discard block
 block discarded – undo
83 85
  *
84 86
  * @return string The negotiated language result or the supplied default.
85 87
  */
86
-$negotiateLanguage = function ($supported, $default = 'en-US') use ($matchAccept) {
88
+$negotiateLanguage = function ($supported, $default = 'en-US') use ($matchAccept)
89
+{
87 90
 	$supp = array();
88 91
 	foreach ($supported as $lang => $isSupported) {
89 92
 		if ($isSupported) {
Please login to merge, or discard this patch.
functions.php 1 patch
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -177,7 +177,8 @@  discard block
 block discarded – undo
177 177
 //
178 178
 // Retruns max depth of array
179 179
 ########################################################################
180
-function get_depth($arr) {
180
+function get_depth($arr)
181
+{
181 182
 	$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($arr));
182 183
 	$depth = 0;
183 184
 	foreach ($it as $v) {
@@ -195,12 +196,16 @@  discard block
 block discarded – undo
195 196
 //
196 197
 // Return all pokemon with data at a certain tree depth
197 198
 ########################################################################
198
-function get_tree_at_depth($trees, $depth, $max_pokemon, $currentDepth = 0) {
199
-	if ($depth == $currentDepth) { // Found depth
199
+function get_tree_at_depth($trees, $depth, $max_pokemon, $currentDepth = 0)
200
+{
201
+	if ($depth == $currentDepth) {
202
+// Found depth
200 203
 		return tree_remove_bellow($trees, $max_pokemon);
201
-	} else { // Go deeper
204
+	} else {
205
+// Go deeper
202 206
 		$arr = array();
203
-		foreach ($trees as $temp) { // Go into all trees
207
+		foreach ($trees as $temp) {
208
+// Go into all trees
204 209
 			$tree = $temp->evolutions;
205 210
 			$results = tree_remove_bellow(get_tree_at_depth($tree, $depth, $max_pokemon, $currentDepth + 1), $max_pokemon);
206 211
 			$arr = tree_check_array($results, $arr, $depth - $currentDepth == 1);
@@ -212,12 +217,16 @@  discard block
 block discarded – undo
212 217
 ########################################################################
213 218
 // used in get_tree_at_depth
214 219
 ########################################################################
215
-function tree_check_array($array_check, $array_add, $correct_arrow) {
220
+function tree_check_array($array_check, $array_add, $correct_arrow)
221
+{
216 222
 	$count = count($array_check);
217 223
 	$i = 0;
218
-	if (!is_null($array_check)) { // check if exists
219
-		foreach ($array_check as $res) { // Check if above, equal or bellow center
220
-			if ($count != 1 && $correct_arrow) { // only add arrow once
224
+	if (!is_null($array_check)) {
225
+// check if exists
226
+		foreach ($array_check as $res) {
227
+// Check if above, equal or bellow center
228
+			if ($count != 1 && $correct_arrow) {
229
+// only add arrow once
221 230
 				$num = $i / ($count - 1);
222 231
 				if ($num < 0.5) {
223 232
 					$res->array_sufix = "_up";
@@ -241,7 +250,8 @@  discard block
 block discarded – undo
241 250
 		return null;
242 251
 	}
243 252
 	$arr = array();
244
-	foreach ($tree as $item) { // Check if above, equal or bellow center
253
+	foreach ($tree as $item) {
254
+// Check if above, equal or bellow center
245 255
 		if ($item->id <= $max_pokemon) {
246 256
 			$arr[] = $item;
247 257
 		}
Please login to merge, or discard this patch.
pages/pokemon.page.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -323,8 +323,7 @@
 block discarded – undo
323 323
 									} elseif (isset($obj->info)) {
324 324
 										$infoName = 'INFO_' . $obj->info;
325 325
 										echo '<br>(' . $locales->$infoName . ')';
326
-									}
327
-									else {
326
+									} else {
328 327
 										echo '<br> </br>';
329 328
 									}
330 329
 									?>
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -316,11 +316,11 @@
 block discarded – undo
316 316
 								<img src="core/img/arrow<?=$obj->array_sufix?>.png" alt="Arrow" class="img">
317 317
 								<p class="pkmn-name">
318 318
 									<?php
319
-                                    if (isset($obj->candies)) {
320
-                                        echo $obj->candies . ' ' . $locales->POKEMON_CANDIES;
321
-                                    } else {
322
-                                        echo '? ' . $locales->POKEMON_CANDIES;
323
-                                    }
319
+									if (isset($obj->candies)) {
320
+										echo $obj->candies . ' ' . $locales->POKEMON_CANDIES;
321
+									} else {
322
+										echo '? ' . $locales->POKEMON_CANDIES;
323
+									}
324 324
 
325 325
 									if (isset($obj->item)) {
326 326
 										$itemName = 'ITEM_' . $obj->item;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -317,17 +317,17 @@
 block discarded – undo
317 317
 								<p class="pkmn-name">
318 318
 									<?php
319 319
                                     if (isset($obj->candies)) {
320
-                                        echo $obj->candies . ' ' . $locales->POKEMON_CANDIES;
320
+                                        echo $obj->candies.' '.$locales->POKEMON_CANDIES;
321 321
                                     } else {
322
-                                        echo '? ' . $locales->POKEMON_CANDIES;
322
+                                        echo '? '.$locales->POKEMON_CANDIES;
323 323
                                     }
324 324
 
325 325
 									if (isset($obj->item)) {
326
-										$itemName = 'ITEM_' . $obj->item;
327
-										echo '<br>+ ' . $locales->$itemName;
326
+										$itemName = 'ITEM_'.$obj->item;
327
+										echo '<br>+ '.$locales->$itemName;
328 328
 									} elseif (isset($obj->info)) {
329
-										$infoName = 'INFO_' . $obj->info;
330
-										echo '<br>(' . $locales->$infoName . ')';
329
+										$infoName = 'INFO_'.$obj->info;
330
+										echo '<br>('.$locales->$infoName.')';
331 331
 									}
332 332
 									else {
333 333
 										echo '<br> </br>';
Please login to merge, or discard this patch.
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/aru.php 2 patches
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.
Switch Indentation   +318 added lines, -318 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;
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
+
265
+				$pokestops[] = [
266
+					$text,
267
+					$icon,
268
+					$data->latitude,
269
+					$data->longitude,
270
+					$lured
271
+				];
263 272
 			}
264 273
 
265
-			$pokestops[] = [
266
-				$text,
267
-				$icon,
268
-				$data->latitude,
269
-				$data->longitude,
270
-				$lured
271
-			];
272
-		}
274
+			header('Content-Type: application/json');
275
+			echo json_encode($pokestops);
273 276
 
274
-		header('Content-Type: application/json');
275
-		echo json_encode($pokestops);
277
+			break;
276 278
 
277
-		break;
278 279
 
280
+		####################################
281
+		//
282
+		// Update data for the gym battle
283
+		//
284
+		####################################
279 285
 
280
-	####################################
281
-	//
282
-	// Update data for the gym battle
283
-	//
284
-	####################################
286
+		case 'update_gym':
287
+			$teams = new stdClass();
288
+			$teams->mystic = 1;
289
+			$teams->valor = 2;
290
+			$teams->instinct = 3;
285 291
 
286
-	case 'update_gym':
287
-		$teams = new stdClass();
288
-		$teams->mystic = 1;
289
-		$teams->valor = 2;
290
-		$teams->instinct = 3;
292
+			foreach ($teams as $team_name => $team_id) {
291 293
 
292
-		foreach ($teams as $team_name => $team_id) {
294
+				$data	= $manager->getOwnedAndPoints($team_id);
293 295
 
294
-			$data	= $manager->getOwnedAndPoints($team_id);
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,45 +370,45 @@  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
-			if ($data->name == null) {
381
-				$gymData['gymDetails']['gymInfos']['name'] = "?";
382
-			} else {
383
-				$gymData['gymDetails']['gymInfos']['name'] = $data->name;
384
-			}
385
-			$gymData['gymDetails']['gymInfos']['description'] = $data->description;
386
-			if ($data->url == null) {
387
-				$gymData['gymDetails']['gymInfos']['url'] = 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Solid_grey.svg/200px-Solid_grey.svg.png';
388
-			} else {
389
-				$gymData['gymDetails']['gymInfos']['url'] = $data->url;
390
-			}
391
-			if ($data->url == null) {
392
-				$gymData['gymDetails']['gymInfos']['points'] = "?";
393
-			} else {
394
-				$gymData['gymDetails']['gymInfos']['points'] = $data->total_cp;
395
-			}
396
-			$gymData['gymDetails']['gymInfos']['level'] = $data->level;
397
-			$gymData['gymDetails']['gymInfos']['last_scanned'] = $data->last_scanned;
398
-			$gymData['gymDetails']['gymInfos']['team'] = $data->team;
399
-			$gymData['gymDetails']['gymInfos']['guardPokemonId'] = $data->guard_pokemon_id;
400
-
401
-			// Skip Query if team is none
402
-			if ($data->team > 0) {
403
-				$datas = $manager->getGymDefenders($gym_id);
404
-				$gymData['infoWindow'] = '
379
+			if (!is_null($data)) {
380
+				if ($data->name == null) {
381
+					$gymData['gymDetails']['gymInfos']['name'] = "?";
382
+				} else {
383
+					$gymData['gymDetails']['gymInfos']['name'] = $data->name;
384
+				}
385
+				$gymData['gymDetails']['gymInfos']['description'] = $data->description;
386
+				if ($data->url == null) {
387
+					$gymData['gymDetails']['gymInfos']['url'] = 'https://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Solid_grey.svg/200px-Solid_grey.svg.png';
388
+				} else {
389
+					$gymData['gymDetails']['gymInfos']['url'] = $data->url;
390
+				}
391
+				if ($data->url == null) {
392
+					$gymData['gymDetails']['gymInfos']['points'] = "?";
393
+				} else {
394
+					$gymData['gymDetails']['gymInfos']['points'] = $data->total_cp;
395
+				}
396
+				$gymData['gymDetails']['gymInfos']['level'] = $data->level;
397
+				$gymData['gymDetails']['gymInfos']['last_scanned'] = $data->last_scanned;
398
+				$gymData['gymDetails']['gymInfos']['team'] = $data->team;
399
+				$gymData['gymDetails']['gymInfos']['guardPokemonId'] = $data->guard_pokemon_id;
400
+
401
+				// Skip Query if team is none
402
+				if ($data->team > 0) {
403
+					$datas = $manager->getGymDefenders($gym_id);
404
+					$gymData['infoWindow'] = '
405 405
 				<div class="gym_defenders">
406 406
 				';
407
-				foreach ($datas as $data) {
408
-					$gymData['gymDetails']['pokemons'][] = $data;
409
-					$pokemon_id = $data->pokemon_id;
410
-					if ($config->system->iv_numbers) {
411
-						$gymData['infoWindow'] .= '
407
+					foreach ($datas as $data) {
408
+						$gymData['gymDetails']['pokemons'][] = $data;
409
+						$pokemon_id = $data->pokemon_id;
410
+						if ($config->system->iv_numbers) {
411
+							$gymData['infoWindow'] .= '
412 412
 					<div style="text-align: center; width: 50px; display: inline-block; margin-right: 3px">
413 413
 						<a href="pokemon/' . $data->pokemon_id . '">
414 414
 						<img src="' . $pokemons->pokemon->$pokemon_id->img . '" height="50" style="display:inline-block" >
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
 								</div>
427 427
 							</div>
428 428
 						</div>';
429
-					} else {
430
-						$gymData['infoWindow'] .= '
429
+						} else {
430
+							$gymData['infoWindow'] .= '
431 431
 					<div style="text-align: center; width: 50px; display: inline-block; margin-right: 3px">
432 432
 						<a href="pokemon/' . $data->pokemon_id . '">
433 433
 						<img src="' . $pokemons->pokemon->$pokemon_id->img . '" height="50" style="display:inline-block" >
@@ -445,149 +445,149 @@  discard block
 block discarded – undo
445 445
 							</div>
446 446
 						</div>
447 447
 					</div>';
448
+						}
448 449
 					}
449 450
 				}
451
+				$gymData['infoWindow'] = $gymData['infoWindow'].'</div>';
450 452
 			}
451
-			$gymData['infoWindow'] = $gymData['infoWindow'].'</div>';
452
-		}
453 453
 
454 454
 
455
-		header('Content-Type: application/json');
456
-		echo json_encode($gymData);
457
-
458
-		break;
455
+			header('Content-Type: application/json');
456
+			echo json_encode($gymData);
459 457
 
458
+			break;
460 459
 
461
-	case 'trainer':
462
-		$name = "";
463
-		$page = "0";
464
-		$team = 0;
465
-		$ranking = 0;
466
-		if (isset($_GET['name'])) {
467
-			$trainer_name = $manager->getEcapedString($_GET['name']);
468
-		}
469
-		if (isset($_GET['team'])) {
470
-			$team = $manager->getEcapedString($_GET['team']);
471
-		}
472
-		if (isset($_GET['page'])) {
473
-			$page = $manager->getEcapedString($_GET['page']);
474
-		}
475
-		if (isset($_GET['ranking'])) {
476
-			$ranking = $manager->getEcapedString($_GET['ranking']);
477
-		}
478 460
 
479
-		$trainers = $manager->getTrainers($trainer_name, $team, $page, $ranking);
480
-		$json = array();
481
-		$json['trainers'] = $trainers;
482
-		$locale = array();
483
-		$locale["today"] = $locales->TODAY;
484
-		$locale["day"] = $locales->DAY;
485
-		$locale["days"] = $locales->DAYS;
486
-		$locale["ivAttack"] = $locales->IV_ATTACK;
487
-		$locale["ivDefense"] = $locales->IV_DEFENSE;
488
-		$locale["ivStamina"] = $locales->IV_STAMINA;
489
-		$json['locale'] = $locale;
461
+		case 'trainer':
462
+			$name = "";
463
+			$page = "0";
464
+			$team = 0;
465
+			$ranking = 0;
466
+			if (isset($_GET['name'])) {
467
+				$trainer_name = $manager->getEcapedString($_GET['name']);
468
+			}
469
+			if (isset($_GET['team'])) {
470
+				$team = $manager->getEcapedString($_GET['team']);
471
+			}
472
+			if (isset($_GET['page'])) {
473
+				$page = $manager->getEcapedString($_GET['page']);
474
+			}
475
+			if (isset($_GET['ranking'])) {
476
+				$ranking = $manager->getEcapedString($_GET['ranking']);
477
+			}
490 478
 
491
-		header('Content-Type: application/json');
492
-		echo json_encode($json);
479
+			$trainers = $manager->getTrainers($trainer_name, $team, $page, $ranking);
480
+			$json = array();
481
+			$json['trainers'] = $trainers;
482
+			$locale = array();
483
+			$locale["today"] = $locales->TODAY;
484
+			$locale["day"] = $locales->DAY;
485
+			$locale["days"] = $locales->DAYS;
486
+			$locale["ivAttack"] = $locales->IV_ATTACK;
487
+			$locale["ivDefense"] = $locales->IV_DEFENSE;
488
+			$locale["ivStamina"] = $locales->IV_STAMINA;
489
+			$json['locale'] = $locale;
493 490
 
494
-		break;
491
+			header('Content-Type: application/json');
492
+			echo json_encode($json);
495 493
 
494
+			break;
496 495
 
497
-	case 'raids':
498
-		$page = "0";
499
-		if (isset($_GET['page'])) {
500
-			$page = $manager->getEcapedString($_GET['page']);
501
-		}
502 496
 
503
-		$datas = $manager->getAllRaids($page);
504
-		$i = 1;
505
-		$raids = array();
506
-		foreach ($datas as $data) {
507
-			$data->starttime = date("H:i", strtotime($data->start));
508
-			$data->endtime = date("H:i", strtotime($data->end));
509
-			$data->gym_id = str_replace('.', '_', $data->gym_id);
510
-			if (isset($data->move_1)) {
511
-				$move1 = $data->move_1;
512
-				$data->quick_move = $move->$move1->name;
513
-			} else {
514
-				$data->quick_move = "?";
497
+		case 'raids':
498
+			$page = "0";
499
+			if (isset($_GET['page'])) {
500
+				$page = $manager->getEcapedString($_GET['page']);
515 501
 			}
516
-			if (isset($data->move_2)) {
517
-				$move2 = $data->move_2;
518
-				$data->charge_move = $move->$move2->name;
519
-			} else {
520
-				$data->charge_move = "?";
502
+
503
+			$datas = $manager->getAllRaids($page);
504
+			$i = 1;
505
+			$raids = array();
506
+			foreach ($datas as $data) {
507
+				$data->starttime = date("H:i", strtotime($data->start));
508
+				$data->endtime = date("H:i", strtotime($data->end));
509
+				$data->gym_id = str_replace('.', '_', $data->gym_id);
510
+				if (isset($data->move_1)) {
511
+					$move1 = $data->move_1;
512
+					$data->quick_move = $move->$move1->name;
513
+				} else {
514
+					$data->quick_move = "?";
515
+				}
516
+				if (isset($data->move_2)) {
517
+					$move2 = $data->move_2;
518
+					$data->charge_move = $move->$move2->name;
519
+				} else {
520
+					$data->charge_move = "?";
521
+				}
522
+				$raids[10*$page + $i] = $data;
523
+				$i++;
521 524
 			}
522
-			$raids[10*$page + $i] = $data;
523
-			$i++;
524
-		}
525
-		$json = array();
526
-		$json['raids'] = $raids;
527
-		$locale = array();
528
-		$locale['noraids'] = $locales->RAIDS_NONE;
529
-		$json['locale'] = $locale;
525
+			$json = array();
526
+			$json['raids'] = $raids;
527
+			$locale = array();
528
+			$locale['noraids'] = $locales->RAIDS_NONE;
529
+			$json['locale'] = $locale;
530 530
 
531
-		header('Content-Type: application/json');
532
-		echo json_encode($json);
531
+			header('Content-Type: application/json');
532
+			echo json_encode($json);
533 533
 
534
-		break;
534
+			break;
535 535
 
536
-	case 'pokemon_slider_init':
537
-		$bounds		= $manager->getPokemonSliederMinMax();
536
+		case 'pokemon_slider_init':
537
+			$bounds		= $manager->getPokemonSliederMinMax();
538 538
 
539
-		header('Content-Type: application/json');
540
-		echo json_encode($bounds);
539
+			header('Content-Type: application/json');
540
+			echo json_encode($bounds);
541 541
 
542
-		break;
542
+			break;
543 543
 
544 544
 
545
-	case 'pokemon_heatmap_points':
546
-		$json = "";
547
-		if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['pokemon_id'])) {
548
-			$start = date("Y-m-d H:i", (int) $_GET['start']);
549
-			$end = date("Y-m-d H:i", (int) $_GET['end']);
550
-			$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
551
-			$points = $manager->getPokemonHeatmap($pokemon_id, $start, $end);
545
+		case 'pokemon_heatmap_points':
546
+			$json = "";
547
+			if (isset($_GET['start']) && isset($_GET['end']) && isset($_GET['pokemon_id'])) {
548
+				$start = date("Y-m-d H:i", (int) $_GET['start']);
549
+				$end = date("Y-m-d H:i", (int) $_GET['end']);
550
+				$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
551
+				$points = $manager->getPokemonHeatmap($pokemon_id, $start, $end);
552 552
 
553
-			$json = json_encode($points);
554
-		}
553
+				$json = json_encode($points);
554
+			}
555 555
 
556
-		header('Content-Type: application/json');
557
-		echo $json;
558
-		break;
556
+			header('Content-Type: application/json');
557
+			echo $json;
558
+			break;
559 559
 
560 560
 
561
-	case 'maps_localization_coordinates':
562
-		$coordinates = $manager->getMapsCoords();
561
+		case 'maps_localization_coordinates':
562
+			$coordinates = $manager->getMapsCoords();
563 563
 
564
-		header('Content-Type: application/json');
565
-		echo json_encode($coordinates);
564
+			header('Content-Type: application/json');
565
+			echo json_encode($coordinates);
566 566
 
567
-		break;
567
+			break;
568 568
 
569 569
 
570
-	case 'pokemon_graph_data':
571
-		$json = "";
572
-		if (isset($_GET['pokemon_id'])) {
573
-			$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
574
-			$array = $manager->getPokemonGraph($pokemon_id);
570
+		case 'pokemon_graph_data':
571
+			$json = "";
572
+			if (isset($_GET['pokemon_id'])) {
573
+				$pokemon_id = $manager->getEcapedString($_GET['pokemon_id']);
574
+				$array = $manager->getPokemonGraph($pokemon_id);
575 575
 
576
-			$json = json_encode($array);
577
-		}
576
+				$json = json_encode($array);
577
+			}
578 578
 
579
-		header('Content-Type: application/json');
580
-		echo $json;
581
-		break;
579
+			header('Content-Type: application/json');
580
+			echo $json;
581
+			break;
582 582
 
583 583
 
584
-	case 'postRequest':
585
-		break;
584
+		case 'postRequest':
585
+			break;
586 586
 
587
-	default:
588
-		echo "What do you mean?";
589
-		exit();
590
-	break;
587
+		default:
588
+			echo "What do you mean?";
589
+			exit();
590
+		break;
591 591
 }
592 592
 
593 593
 if ($postRequest != "") {
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.