Code Duplication    Length = 9-20 lines in 3 locations

notam-geojson.php 1 location

@@ 45-53 (lines=9) @@
42
//			$output .= '"image_thumb": "'.$spotter_item['image_thumb'].'"';
43
//			$output .= '"photo": "'.$spotter_item['image_thumbnail'].'",';
44
//			if ($spotter_item['radius'] > 30) $spotter_item['radius'] = 30;
45
			if ($spotter_item['scope'] == 'Airport warning') {
46
			    $output .= '"color": "#EACC04",';
47
			} elseif ($spotter_item['scope'] == 'Airport/Enroute warning') {
48
			    $output .= '"color": "#EA7D00",';
49
			} elseif ($spotter_item['scope'] == 'Navigation warning') {
50
			    $output .= '"color": "#BBEA00",';
51
			} else {
52
			    $output .= '"color": "#FF0000",';
53
			}
54
			$radius = $spotter_item['radius']*1852;
55
			$output .= '"radiusm": "'.$radius.'",';
56
			$output .= '"radiusnm": "'.$spotter_item['radius'].'",';

waypoints-geojson.php 2 locations

@@ 74-86 (lines=13) @@
71
			$output .= '"high": "'.$spotter_item['high'].'",';
72
			$output .= '"alt": "'.$spotter_item['base'].'",';
73
//			$output .= '"popupContent": "'.$spotter_item['name_begin'].'",';
74
			if ($spotter_item['high'] == '') {
75
				$output .= '"icon": "images/flag_green.png"';
76
			} elseif ($spotter_item['high'] == '2') {
77
				$output .= '"icon": "images/flag_red.png"';
78
			} elseif ($spotter_item['high'] == '1') {
79
				$output .= '"icon": "images/flag_yellow.png"';
80
//			} elseif ($spotter_item['usage'] == 'High and Low Level') {
81
//				$output .= '"icon": "images/flag_orange.png"';
82
//			} elseif ($spotter_item['usage'] == 'Terminal') {
83
//				$output .= '"icon": "images/flag_finish.png"';
84
			} else {
85
				$output .= '"icon": "images/flag_blue.png"';
86
			}
87
		    $output .= '},';
88
		    $output .= '"geometry": {';
89
			$output .= '"type": "Point",';
@@ 102-121 (lines=20) @@
99
			$output .= '"high": "'.$spotter_item['high'].'",';
100
			$output .= '"alt": "'.$spotter_item['top'].'",';
101
//			$output .= '"popupContent": "'.$spotter_item['name_begin'].'",';
102
			if ($spotter_item['high'] == '') {
103
				$output .= '"icon": "images/flag_green.png"';
104
			} elseif ($spotter_item['high'] == '2') {
105
				$output .= '"icon": "images/flag_red.png"';
106
			} elseif ($spotter_item['high'] == '1') {
107
				$output .= '"icon": "images/flag_yellow.png"';
108
/*			if ($spotter_item['usage'] == 'RNAV') {
109
				$output .= '"icon": "images/flag_green.png"';
110
			} elseif ($spotter_item['usage'] == 'High Level') {
111
				$output .= '"icon": "images/flag_red.png"';
112
			} elseif ($spotter_item['usage'] == 'Low Level') {
113
				$output .= '"icon": "images/flag_yellow.png"';
114
			} elseif ($spotter_item['usage'] == 'High and Low Level') {
115
				$output .= '"icon": "images/flag_orange.png"';
116
			} elseif ($spotter_item['usage'] == 'Terminal') {
117
				$output .= '"icon": "images/flag_finish.png"';
118
*/
119
			} else {
120
				$output .= '"icon": "images/flag_blue.png"';
121
			}
122
		    $output .= '},';
123
		    $output .= '"geometry": {';
124
			$output .= '"type": "Point",';