Code Duplication    Length = 15-16 lines in 2 locations

core/process/queries/QueryManagerMonocleHydro.php 1 location

@@ 207-221 (lines=15) @@
204
		return $points;
205
	}
206
207
	public function getPokemonGraph($pokemon_id) {
208
		$req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour
209
					FROM (SELECT FROM_UNIXTIME(expire_timestamp) as disappear_time FROM sightings WHERE pokemon_id = '".$pokemon_id."' ORDER BY disappear_time LIMIT 100000) AS pokemonFiltered
210
				GROUP BY disappear_hour
211
				ORDER BY disappear_hour";
212
		$result = $this->mysqli->query($req);
213
		$array = array_fill(0, 24, 0);
214
		while ($result && $data = $result->fetch_object()) {
215
			$array[$data->disappear_hour] = $data->total;
216
		}
217
		// shift array because AM/PM starts at 1AM not 0:00
218
		$array[] = $array[0];
219
		array_shift($array);
220
		return $array;
221
	}
222
223
	public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons) {
224
		$inmap_pkms_filter = "";

core/process/queries/QueryManagerRocketmap.php 1 location

@@ 208-223 (lines=16) @@
205
		return $points;
206
	}
207
208
	public function getPokemonGraph($pokemon_id) {
209
		$req = "SELECT COUNT(*) AS total,
210
					HOUR(CONVERT_TZ(disappear_time, '+00:00', '".self::$time_offset."')) AS disappear_hour
211
					FROM (SELECT disappear_time FROM pokemon WHERE pokemon_id = '".$pokemon_id."' ORDER BY disappear_time LIMIT 100000) AS pokemonFiltered
212
					GROUP BY disappear_hour
213
					ORDER BY disappear_hour";
214
		$result = $this->mysqli->query($req);
215
		$array = array_fill(0, 24, 0);
216
		while ($result && $data = $result->fetch_object()) {
217
			$array[$data->disappear_hour] = $data->total;
218
		}
219
		// shift array because AM/PM starts at 1AM not 0:00
220
		$array[] = $array[0];
221
		array_shift($array);
222
		return $array;
223
	}
224
225
	public function getPokemonLive($pokemon_id, $ivMin, $ivMax, $inmap_pokemons) {
226
		$inmap_pkms_filter = "";