Code Duplication    Length = 9-12 lines in 2 locations

require/class.Spotter.php 2 locations

@@ 2391-2399 (lines=9) @@
2388
		$sth->execute();
2389
2390
		$temp_array = array();
2391
		while($row = $sth->fetch(PDO::FETCH_ASSOC))
2392
		{
2393
			$temp_array['airport_icao'] = $row['airport_icao'];
2394
			$temp_array['airport_name'] = $row['airport_name'];
2395
			$temp_array['airport_city'] = $row['airport_city'];
2396
			$temp_array['airport_country'] = $row['airport_country'];
2397
2398
			$airport_array[$row['airport_city'].",".$row['airport_name']] = $temp_array;
2399
		}
2400
2401
		$query  = "SELECT DISTINCT spotter_output.arrival_airport_icao AS airport_icao, spotter_output.arrival_airport_name AS airport_name, spotter_output.arrival_airport_city AS airport_city, spotter_output.arrival_airport_country AS airport_country
2402
								FROM spotter_output 
@@ 2409-2420 (lines=12) @@
2406
		$sth = $this->db->prepare($query);
2407
		$sth->execute();
2408
2409
		while($row = $sth->fetch(PDO::FETCH_ASSOC))
2410
			{
2411
		//	if ($airport_array[$row['airport_city'].",".$row['airport_name']]['airport_icao'] != $row['airport_icao'])
2412
		//	{
2413
				$temp_array['airport_icao'] = $row['airport_icao'];
2414
				$temp_array['airport_name'] = $row['airport_name'];
2415
				$temp_array['airport_city'] = $row['airport_city'];
2416
				$temp_array['airport_country'] = $row['airport_country'];
2417
				
2418
				$airport_array[$row['airport_city'].",".$row['airport_name']] = $temp_array;
2419
		//	}
2420
		}
2421
2422
		return $airport_array;
2423
	}