Code Duplication    Length = 12-13 lines in 2 locations

require/class.Spotter.php 2 locations

@@ 8575-8586 (lines=12) @@
8572
		}
8573
8574
		//if we didn't find a two chracter prefix lets just search the one with one character
8575
		if ($registration_prefix == "")
8576
		{
8577
			$query  = "SELECT aircraft_registration.registration_prefix FROM aircraft_registration WHERE registration_prefix = :registration_1";
8578
	      
8579
			$sth = $this->db->prepare($query);
8580
			$sth->execute(array(':registration_1' => $registration_1));
8581
	        
8582
			while($row = $sth->fetch(PDO::FETCH_ASSOC))
8583
			{
8584
				$registration_prefix = $row['registration_prefix'];
8585
			}
8586
		}
8587
8588
		//determine which characters are being used and convert the registration code appropiately
8589
		if (strlen($registration_prefix) == 1)
@@ 8652-8664 (lines=13) @@
8649
			}
8650
8651
			//if we didn't find a two chracter prefix lets just search the one with one character
8652
			if ($registration_prefix == "")
8653
			{
8654
				$query  = "SELECT aircraft_registration.registration_prefix, aircraft_registration.country FROM aircraft_registration WHERE registration_prefix = :registration_1 LIMIT 1";
8655
	      
8656
				$sth = $this->db->prepare($query);
8657
				$sth->execute(array(':registration_1' => $registration_1));
8658
	        
8659
				while($row = $sth->fetch(PDO::FETCH_ASSOC))
8660
				{
8661
					$registration_prefix = $row['registration_prefix'];
8662
					$country = $row['country'];
8663
				}
8664
			}
8665
		}
8666
    
8667
		return $country;