Code Duplication    Length = 15-16 lines in 2 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

@@ 209-223 (lines=15) @@
206
		return $points;
207
	}
208
209
	public function getPokemonGraph($pokemon_id) {
210
		$req = "SELECT COUNT(*) AS total, HOUR(disappear_time) AS disappear_hour
211
					FROM (SELECT FROM_UNIXTIME(expire_timestamp) as disappear_time FROM sightings 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 = "";

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

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