Code Duplication    Length = 15-16 lines in 2 locations

core/process/queries/QueryManagerMysqlMonocleAlternate.php 1 location

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

core/process/queries/QueryManagerMysqlRocketmap.php 1 location

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