Code Duplication    Length = 6-8 lines in 2 locations

install/class.update_db.php 2 locations

@@ 859-866 (lines=8) @@
856
				if($i > 12) {
857
					$data = $row;
858
					$operator = $data[2];
859
					if ($operator != '' && is_numeric(substr(substr($operator, 0, 3), -1, 1))) {
860
                                                $airline_array = $Spotter->getAllAirlineInfo(substr($operator, 0, 2));
861
                                                //echo substr($operator, 0, 2)."\n";;
862
                                                if (count($airline_array) > 0) {
863
							//print_r($airline_array);
864
							$operator = $airline_array[0]['icao'].substr($operator,2);
865
                                                }
866
                                        }
867
					
868
					$operator_correct = $data[3];
869
					if ($operator_correct != '' && is_numeric(substr(substr($operator_correct, 0, 3), -1, 1))) {
@@ 869-874 (lines=6) @@
866
                                        }
867
					
868
					$operator_correct = $data[3];
869
					if ($operator_correct != '' && is_numeric(substr(substr($operator_correct, 0, 3), -1, 1))) {
870
                                                $airline_array = $Spotter->getAllAirlineInfo(substr($operator_correct, 0, 2));
871
                                                if (count($airline_array) > 0) {
872
                                            		$operator_correct = $airline_array[0]['icao'].substr($operator_correct,2);
873
                                            	}
874
                                        }
875
					$query = 'INSERT INTO translation (Reg,Reg_correct,Operator,Operator_correct,Source) VALUES (:Reg, :Reg_correct, :Operator, :Operator_correct, :source)';
876
					try {
877
						$sth = $Connection->db->prepare($query);