@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | date_default_timezone_set('UTC'); |
27 | 27 | //waypoint plotting |
28 | 28 | $output .= '{"type": "Feature",'; |
29 | - $output .= '"properties": {'; |
|
29 | + $output .= '"properties": {'; |
|
30 | 30 | $output .= '"segment_name": "'.$spotter_item['segment_name'].'",'; |
31 | 31 | $output .= '"base": "'.$spotter_item['base'].'",'; |
32 | 32 | $output .= '"top": "'.$spotter_item['top'].'",'; |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | $output .= '"stroke": "#f0f0f0",'; |
50 | 50 | $output .= '"stroke-width": 2'; |
51 | 51 | // } |
52 | - $output .= '},'; |
|
53 | - $output .= '"geometry": {'; |
|
52 | + $output .= '},'; |
|
53 | + $output .= '"geometry": {'; |
|
54 | 54 | $output .= '"type": "LineString",'; |
55 | 55 | $output .= '"coordinates": ['; |
56 | - //$output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].'], ['.$spotter_item['longitude_end_seg2'].', '.$spotter_item['latitude_end_seg2'].']'; |
|
57 | - $output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].','.round($spotter_item['base']*100*0.3048).'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].','.round($spotter_item['base']*100*0.3048).']'; |
|
56 | + //$output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].'], ['.$spotter_item['longitude_end_seg2'].', '.$spotter_item['latitude_end_seg2'].']'; |
|
57 | + $output .= '['.$spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].','.round($spotter_item['base']*100*0.3048).'], ['.$spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].','.round($spotter_item['base']*100*0.3048).']'; |
|
58 | 58 | // $output .= '['.$spotter_item['latitude_begin'].', '.$spotter_item['longitude_begin'].'], ['.$spotter_item['latitude_end'].', '.$spotter_item['longitude_end'].']'; |
59 | 59 | $output .= ']'; |
60 | - $output .= '}'; |
|
60 | + $output .= '}'; |
|
61 | 61 | /* $output .= '"geometry": {'; |
62 | 62 | $output .= '"type": "Point",'; |
63 | 63 | $output .= '"coordinates": ['; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $output .= '},'; |
69 | 69 | //waypoint plotting |
70 | 70 | $output .= '{"type": "Feature",'; |
71 | - $output .= '"properties": {'; |
|
71 | + $output .= '"properties": {'; |
|
72 | 72 | $output .= '"ident": "'.$spotter_item['name_begin'].'",'; |
73 | 73 | $output .= '"high": "'.$spotter_item['high'].'",'; |
74 | 74 | $output .= '"alt": "'.$spotter_item['base'].'",'; |
@@ -98,17 +98,17 @@ discard block |
||
98 | 98 | $output .= '"marker-size": "small",'; |
99 | 99 | $output .= '"marker-color": "#0000ff"'; |
100 | 100 | } |
101 | - $output .= '},'; |
|
102 | - $output .= '"geometry": {'; |
|
101 | + $output .= '},'; |
|
102 | + $output .= '"geometry": {'; |
|
103 | 103 | $output .= '"type": "Point",'; |
104 | 104 | $output .= '"coordinates": ['; |
105 | - $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);; |
|
105 | + $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);; |
|
106 | 106 | $output .= ']'; |
107 | - $output .= '}'; |
|
107 | + $output .= '}'; |
|
108 | 108 | |
109 | 109 | $output .= '},'; |
110 | 110 | $output .= '{"type": "Feature",'; |
111 | - $output .= '"properties": {'; |
|
111 | + $output .= '"properties": {'; |
|
112 | 112 | $output .= '"ident": "'.$spotter_item['name_end'].'",'; |
113 | 113 | $output .= '"high": "'.$spotter_item['high'].'",'; |
114 | 114 | $output .= '"alt": "'.$spotter_item['top'].'",'; |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | $output .= '"marker-size": "small",'; |
146 | 146 | $output .= '"marker-color": "#0000ff"'; |
147 | 147 | } |
148 | - $output .= '},'; |
|
149 | - $output .= '"geometry": {'; |
|
148 | + $output .= '},'; |
|
149 | + $output .= '"geometry": {'; |
|
150 | 150 | $output .= '"type": "Point",'; |
151 | 151 | $output .= '"coordinates": ['; |
152 | - $output .= $spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].', '.round($spotter_item['base']*100*0.3048); |
|
152 | + $output .= $spotter_item['longitude_end'].', '.$spotter_item['latitude_end'].', '.round($spotter_item['base']*100*0.3048); |
|
153 | 153 | $output .= ']'; |
154 | - $output .= '}'; |
|
154 | + $output .= '}'; |
|
155 | 155 | |
156 | 156 | $output .= '},'; |
157 | 157 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | if (isset($_GET['coord'])) |
12 | 12 | { |
13 | - $coords = explode(',',$_GET['coord']); |
|
13 | + $coords = explode(',', $_GET['coord']); |
|
14 | 14 | $spotter_array = $Spotter->getAllWaypointsInfobyCoord($coords); |
15 | 15 | } else { |
16 | 16 | die; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | if (!empty($spotter_array)) |
22 | 22 | { |
23 | 23 | // print_r($spotter_array); |
24 | - foreach($spotter_array as $spotter_item) |
|
24 | + foreach ($spotter_array as $spotter_item) |
|
25 | 25 | { |
26 | 26 | date_default_timezone_set('UTC'); |
27 | 27 | //waypoint plotting |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $output .= '"geometry": {'; |
103 | 103 | $output .= '"type": "Point",'; |
104 | 104 | $output .= '"coordinates": ['; |
105 | - $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048);; |
|
105 | + $output .= $spotter_item['longitude_begin'].', '.$spotter_item['latitude_begin'].', '.round($spotter_item['base']*100*0.3048); ; |
|
106 | 106 | $output .= ']'; |
107 | 107 | $output .= '}'; |
108 | 108 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | <button type="button" class="close">×</button> |
8 | 8 | <?php |
9 | 9 | |
10 | -$airspaceid = filter_input(INPUT_GET,'airspace',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$airspaceid = filter_input(INPUT_GET, 'airspace', FILTER_SANITIZE_NUMBER_INT); |
|
11 | 11 | //$notamref = urldecode($notamref); |
12 | 12 | if ($globalDBdriver == 'mysql') { |
13 | 13 | $query = "SELECT * FROM airspace WHERE ogr_fid = :id"; |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | try { |
19 | 19 | $sth = $Connection->db->prepare($query); |
20 | 20 | $sth->execute(array(':id' => $airspaceid)); |
21 | -} catch(PDOException $e) { |
|
21 | +} catch (PDOException $e) { |
|
22 | 22 | echo "error"; |
23 | 23 | } |
24 | -$result=$sth->fetchAll(PDO::FETCH_ASSOC); |
|
24 | +$result = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
25 | 25 | $airspace = $result[0]; |
26 | 26 | date_default_timezone_set('UTC'); |
27 | 27 | print '<div class="top">'; |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | $airspace = $result[0]; |
26 | 26 | date_default_timezone_set('UTC'); |
27 | 27 | print '<div class="top">'; |
28 | -if (isset($airspace['name'])) $airspace['title'] = $airspace['name']; |
|
28 | +if (isset($airspace['name'])) { |
|
29 | + $airspace['title'] = $airspace['name']; |
|
30 | +} |
|
29 | 31 | print '<div class="right"><div class="callsign-details"><div class="callsign">'.$airspace['title'].'</a></div>'; |
30 | 32 | print '</div>'; |
31 | 33 | print '<div class="details">'; |
@@ -44,13 +46,17 @@ discard block |
||
44 | 46 | print '</div>'; |
45 | 47 | } |
46 | 48 | |
47 | -if (isset($airspace['ceiling'])) $airspace['tops'] = $airspace['ceiling']; |
|
49 | +if (isset($airspace['ceiling'])) { |
|
50 | + $airspace['tops'] = $airspace['ceiling']; |
|
51 | +} |
|
48 | 52 | print '<div>'; |
49 | 53 | print '<span>'._("Tops").'</span>'; |
50 | 54 | print $airspace['tops']; |
51 | 55 | print '</div>'; |
52 | 56 | |
53 | -if (isset($airspace['floor'])) $airspace['base'] = $airspace['floor']; |
|
57 | +if (isset($airspace['floor'])) { |
|
58 | + $airspace['base'] = $airspace['floor']; |
|
59 | +} |
|
54 | 60 | print '<div>'; |
55 | 61 | print '<span>'._("Base").'</span>'; |
56 | 62 | print $airspace['base']; |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | |
17 | 17 | if (isset($_GET['coord'])) |
18 | 18 | { |
19 | - $coords = explode(',',$_GET['coord']); |
|
19 | + $coords = explode(',', $_GET['coord']); |
|
20 | 20 | if ($globalDBdriver == 'mysql') { |
21 | 21 | $query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))"; |
22 | 22 | try { |
23 | 23 | $sth = $Connection->db->prepare($query); |
24 | - $sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3])); |
|
24 | + $sth->execute(array(':minlon' => $coords[0], ':minlat' => $coords[1], ':maxlon' => $coords[2], ':maxlat' => $coords[3])); |
|
25 | 25 | //$sth->execute(); |
26 | - } catch(PDOException $e) { |
|
26 | + } catch (PDOException $e) { |
|
27 | 27 | echo "error"; |
28 | 28 | } |
29 | 29 | } else { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $sth = $Connection->db->prepare($query); |
33 | 33 | //$sth->execute(array(':minlon' => $coords[0],':minlat' => $coords[1],':maxlon' => $coords[2],':maxlat' => $coords[3])); |
34 | 34 | $sth->execute(); |
35 | - } catch(PDOException $e) { |
|
35 | + } catch (PDOException $e) { |
|
36 | 36 | echo "error"; |
37 | 37 | } |
38 | 38 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | try { |
46 | 46 | $sth = $Connection->db->prepare($query); |
47 | 47 | $sth->execute(); |
48 | - } catch(PDOException $e) { |
|
48 | + } catch (PDOException $e) { |
|
49 | 49 | echo "error"; |
50 | 50 | } |
51 | 51 | } |
@@ -73,20 +73,20 @@ discard block |
||
73 | 73 | elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid']; |
74 | 74 | if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling']; |
75 | 75 | if (isset($properties['floor'])) $properties['base'] = $properties['floor']; |
76 | - if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) { |
|
76 | + if (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['tops']), $matches)) { |
|
77 | 77 | $properties['upper_limit'] = round($matches['alt']*100*0.38048); |
78 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) { |
|
78 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['tops']), $matches)) { |
|
79 | 79 | $properties['upper_limit'] = round($matches['alt']*0.38048); |
80 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['tops']),$matches)) { |
|
80 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['tops']), $matches)) { |
|
81 | 81 | $properties['upper_limit'] = $matches['alt']; |
82 | 82 | } |
83 | 83 | if ($properties['base'] == 'SFC' || $properties['base'] == 'MSL' || $properties['base'] == 'GROUND' || $properties['base'] == 'GND') { |
84 | 84 | $properties['lower_limit'] = 0; |
85 | - } elseif (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['base']),$matches)) { |
|
85 | + } elseif (preg_match('/^FL(\s)*(?<alt>\d+)/', strtoupper($properties['base']), $matches)) { |
|
86 | 86 | $properties['lower_limit'] = round($matches['alt']*100*0.38048); |
87 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['base']),$matches)) { |
|
87 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/', strtoupper($properties['base']), $matches)) { |
|
88 | 88 | $properties['lower_limit'] = round($matches['alt']*0.38048); |
89 | - } elseif (preg_match('/^(?<alt>\d+)(\s)*M/',strtoupper($properties['base']),$matches)) { |
|
89 | + } elseif (preg_match('/^(?<alt>\d+)(\s)*M/', strtoupper($properties['base']), $matches)) { |
|
90 | 90 | $properties['lower_limit'] = $matches['alt']; |
91 | 91 | } |
92 | 92 | if ($properties['type'] == 'RESTRICTED' || $properties['type'] == 'R') { |
@@ -67,12 +67,22 @@ |
||
67 | 67 | } else { |
68 | 68 | $geom = geoPHP::load(stream_get_contents($row['wkb'])); |
69 | 69 | } |
70 | - if (isset($properties['type'])) $properties['type'] = trim($properties['type']); |
|
71 | - elseif (isset($properties['class'])) $properties['type'] = trim($properties['class']); |
|
72 | - if (isset($properties['ogr_fid'])) $properties['id'] = $properties['ogr_fid']; |
|
73 | - elseif (isset($properties['ogc_fid'])) $properties['id'] = $properties['ogc_fid']; |
|
74 | - if (isset($properties['ceiling'])) $properties['tops'] = $properties['ceiling']; |
|
75 | - if (isset($properties['floor'])) $properties['base'] = $properties['floor']; |
|
70 | + if (isset($properties['type'])) { |
|
71 | + $properties['type'] = trim($properties['type']); |
|
72 | + } elseif (isset($properties['class'])) { |
|
73 | + $properties['type'] = trim($properties['class']); |
|
74 | + } |
|
75 | + if (isset($properties['ogr_fid'])) { |
|
76 | + $properties['id'] = $properties['ogr_fid']; |
|
77 | + } elseif (isset($properties['ogc_fid'])) { |
|
78 | + $properties['id'] = $properties['ogc_fid']; |
|
79 | + } |
|
80 | + if (isset($properties['ceiling'])) { |
|
81 | + $properties['tops'] = $properties['ceiling']; |
|
82 | + } |
|
83 | + if (isset($properties['floor'])) { |
|
84 | + $properties['base'] = $properties['floor']; |
|
85 | + } |
|
76 | 86 | if (preg_match('/^FL(\s)*(?<alt>\d+)/',strtoupper($properties['tops']),$matches)) { |
77 | 87 | $properties['upper_limit'] = round($matches['alt']*100*0.38048); |
78 | 88 | } elseif (preg_match('/^(?<alt>\d+)(\s)*(FT|AGL|ALT|MSL)/',strtoupper($properties['tops']),$matches)) { |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | $Connection = new Connection(); |
12 | 12 | |
13 | 13 | if (!$Connection->tableExists('airspace')) { |
14 | - die; |
|
14 | + die; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | if (isset($_GET['coord'])) |
18 | 18 | { |
19 | 19 | $coords = explode(',',$_GET['coord']); |
20 | - if ($globalDBdriver == 'mysql') { |
|
20 | + if ($globalDBdriver == 'mysql') { |
|
21 | 21 | $query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace WHERE ST_Intersects(SHAPE, ST_Envelope(linestring(point(:minlon,:minlat), point(:maxlon,:maxlat))))"; |
22 | 22 | try { |
23 | 23 | $sth = $Connection->db->prepare($query); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | } |
39 | 39 | } else { |
40 | - if ($globalDBdriver == 'mysql') { |
|
40 | + if ($globalDBdriver == 'mysql') { |
|
41 | 41 | $query = "SELECT *, ST_AsWKB(SHAPE) AS wkb FROM airspace"; |
42 | 42 | } else { |
43 | 43 | $query = "SELECT *, ST_AsBinary(wkb_geometry,'NDR') AS wkb FROM airspace"; |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | $geojson = array( |
54 | - 'type' => 'FeatureCollection', |
|
55 | - 'features' => array() |
|
54 | + 'type' => 'FeatureCollection', |
|
55 | + 'features' => array() |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | $properties['color'] = '#d9ffcb'; |
110 | 110 | } |
111 | 111 | $feature = array( |
112 | - 'type' => 'Feature', |
|
113 | - 'geometry' => json_decode($geom->out('json')), |
|
114 | - 'properties' => $properties |
|
112 | + 'type' => 'Feature', |
|
113 | + 'geometry' => json_decode($geom->out('json')), |
|
114 | + 'properties' => $properties |
|
115 | 115 | ); |
116 | 116 | array_push($geojson['features'], $feature); |
117 | 117 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
10 | 10 | exec("ps ux", $output, $result); |
11 | 11 | $j = 0; |
12 | - foreach ($output as $line) if(strpos($line, "update_db.php") && !strpos($line, "sh ")) $j++; |
|
12 | + foreach ($output as $line) if (strpos($line, "update_db.php") && !strpos($line, "sh ")) $j++; |
|
13 | 13 | if ($j > 1) { |
14 | 14 | echo "Script is already runnning..."; |
15 | 15 | die(); |
@@ -9,7 +9,9 @@ discard block |
||
9 | 9 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
10 | 10 | exec("ps ux", $output, $result); |
11 | 11 | $j = 0; |
12 | - foreach ($output as $line) if(strpos($line, "update_db.php") && !strpos($line, "sh ")) $j++; |
|
12 | + foreach ($output as $line) { |
|
13 | + if(strpos($line, "update_db.php") && !strpos($line, "sh ")) $j++; |
|
14 | + } |
|
13 | 15 | if ($j > 1) { |
14 | 16 | echo "Script is already runnning..."; |
15 | 17 | die(); |
@@ -29,14 +31,18 @@ discard block |
||
29 | 31 | $update_db->update_notam(); |
30 | 32 | } |
31 | 33 | $update_db->insert_last_notam_update(); |
32 | - } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) echo "NOTAM are only updated once a day.\n"; |
|
34 | + } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) { |
|
35 | + echo "NOTAM are only updated once a day.\n"; |
|
36 | + } |
|
33 | 37 | if ($update_db->check_last_update() && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
34 | 38 | $update_db->update_all(); |
35 | 39 | // require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
36 | 40 | // $Spotter = new Spotter(); |
37 | 41 | // $Spotter->updateFieldsFromOtherTables(); |
38 | 42 | $update_db->insert_last_update(); |
39 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
43 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) { |
|
44 | + echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
45 | + } |
|
40 | 46 | if (isset($globalWaypoints) && $globalWaypoints && $update_db->check_last_airspace_update()) { |
41 | 47 | echo "Check if new airspace version exist..."; |
42 | 48 | echo $update_db->update_airspace_fam(); |
@@ -45,8 +51,11 @@ discard block |
||
45 | 51 | if (isset($globalGeoid) && $globalGeoid && $update_db->check_last_geoid_update()) { |
46 | 52 | echo "Check if new geoid version exist..."; |
47 | 53 | $error = $update_db->update_geoid_fam(); |
48 | - if ($error == '') $update_db->insert_last_geoid_update(); |
|
49 | - else echo $error; |
|
54 | + if ($error == '') { |
|
55 | + $update_db->insert_last_geoid_update(); |
|
56 | + } else { |
|
57 | + echo $error; |
|
58 | + } |
|
50 | 59 | } |
51 | 60 | if (isset($globalMarine) && $globalMarine && $update_db->check_last_marine_identity_update()) { |
52 | 61 | echo "Check if new marine identity version exist..."; |
@@ -62,7 +71,9 @@ discard block |
||
62 | 71 | $update_db->delete_duplicateowner(); |
63 | 72 | } |
64 | 73 | $update_db->insert_last_owner_update(); |
65 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Owner are only updated every 15 days.\n"; |
|
74 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
75 | + echo "Owner are only updated every 15 days.\n"; |
|
76 | + } |
|
66 | 77 | |
67 | 78 | if (isset($globalAccidents) && $globalAccidents && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
68 | 79 | require_once(dirname(__FILE__).'/../require/class.Accident.php'); |
@@ -71,7 +82,9 @@ discard block |
||
71 | 82 | if ($Accident->check_last_accidents_update()) { |
72 | 83 | $Accident->download_update(); |
73 | 84 | $Accident->insert_last_accidents_update(); |
74 | - } else echo "Accidents are updated once a day.\n"; |
|
85 | + } else { |
|
86 | + echo "Accidents are updated once a day.\n"; |
|
87 | + } |
|
75 | 88 | } |
76 | 89 | |
77 | 90 | } |
@@ -84,15 +97,19 @@ discard block |
||
84 | 97 | if ($METAR->check_last_update()) { |
85 | 98 | $METAR->addMETARCycle(); |
86 | 99 | $METAR->insert_last_update(); |
87 | - } else echo "METAR are only updated every 30 minutes.\n"; |
|
88 | -} |
|
100 | + } else { |
|
101 | + echo "METAR are only updated every 30 minutes.\n"; |
|
102 | + } |
|
103 | + } |
|
89 | 104 | |
90 | 105 | if (isset($globalSchedules) && $globalSchedules && $update_db->check_last_schedules_update() && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
91 | 106 | echo "Updating schedules..."; |
92 | 107 | //$update_db->update_oneworld(); |
93 | 108 | $update_db->update_skyteam(); |
94 | 109 | $update_db->insert_last_schedules_update(); |
95 | -} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Schedules are only updated every 15 days.\n"; |
|
110 | +} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
111 | + echo "Schedules are only updated every 15 days.\n"; |
|
112 | +} |
|
96 | 113 | |
97 | 114 | if (isset($globalArchiveMonths) && $globalArchiveMonths > 0) { |
98 | 115 | echo "Updating statistics and archive old data..."; |
@@ -11,27 +11,27 @@ |
||
11 | 11 | die(); |
12 | 12 | } |
13 | 13 | $query = 'select * from vam_live_flights rc, gvausers gu where gu.gvauser_id = rc.gvauser_id'; |
14 | -$json_data=array(); |
|
14 | +$json_data = array(); |
|
15 | 15 | $result = $db->query($query); |
16 | 16 | while ($rec = $result->fetch_assoc()) |
17 | 17 | { |
18 | - $json_array['gvauser_id']=$rec['gvauser_id']; // users "pilot unique ID" "40" |
|
19 | - $json_array['flight_id']=$rec['flight_id']; // flight_id |
|
20 | - $json_array['pilot_id']=$rec['callsign']; // users pilot_id "VAM500" |
|
21 | - $json_array['callsign']=substr($rec['flight_id'],-7); // substr icao Flight "AFR524" |
|
22 | - $json_array['pilot_name']=$rec['name'] .' '.$rec['surname'] ; // Users "name + surname" |
|
23 | - $json_array['plane_type']=$rec['plane_type']; // type Plane "B739" |
|
24 | - $json_array['departure']=$rec['departure']; // departure ICAO |
|
25 | - $json_array['arrival']=$rec['arrival']; // arrival Ident |
|
26 | - $json_array['latitude']=$rec['latitude']; // return 55.7328860921521 |
|
27 | - $json_array['longitude']=$rec['longitude']; // return 8.87433614409404 |
|
28 | - $json_array['altitude']=$rec['altitude']; // return "147" |
|
29 | - $json_array['heading']=$rec['heading']; // return "307" |
|
30 | - $json_array['ias']=$rec['ias']; // return speed "IAS" |
|
31 | - $json_array['gs']=$rec['gs']; // return speed "GS" |
|
18 | + $json_array['gvauser_id'] = $rec['gvauser_id']; // users "pilot unique ID" "40" |
|
19 | + $json_array['flight_id'] = $rec['flight_id']; // flight_id |
|
20 | + $json_array['pilot_id'] = $rec['callsign']; // users pilot_id "VAM500" |
|
21 | + $json_array['callsign'] = substr($rec['flight_id'], -7); // substr icao Flight "AFR524" |
|
22 | + $json_array['pilot_name'] = $rec['name'].' '.$rec['surname']; // Users "name + surname" |
|
23 | + $json_array['plane_type'] = $rec['plane_type']; // type Plane "B739" |
|
24 | + $json_array['departure'] = $rec['departure']; // departure ICAO |
|
25 | + $json_array['arrival'] = $rec['arrival']; // arrival Ident |
|
26 | + $json_array['latitude'] = $rec['latitude']; // return 55.7328860921521 |
|
27 | + $json_array['longitude'] = $rec['longitude']; // return 8.87433614409404 |
|
28 | + $json_array['altitude'] = $rec['altitude']; // return "147" |
|
29 | + $json_array['heading'] = $rec['heading']; // return "307" |
|
30 | + $json_array['ias'] = $rec['ias']; // return speed "IAS" |
|
31 | + $json_array['gs'] = $rec['gs']; // return speed "GS" |
|
32 | 32 | // $json_array['routes']=$rec['routes']; // (unusable) |
33 | - $json_array['flight_status']=$rec['flight_status']; // "return Status" |
|
34 | - $json_array['last_update']=$rec['last_update']; // return "DateTime" |
|
33 | + $json_array['flight_status'] = $rec['flight_status']; // "return Status" |
|
34 | + $json_array['last_update'] = $rec['last_update']; // return "DateTime" |
|
35 | 35 | $json_data[] = $json_array; |
36 | 36 | } |
37 | 37 | echo json_encode($json_data); |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | print '<option></option>'; |
22 | 22 | $Stats = new Stats(); |
23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
24 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
24 | + if (empty($airline_names)) { |
|
25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
26 | + } |
|
25 | 27 | foreach($airline_names as $airline_name) |
26 | 28 | { |
27 | 29 | if($airline == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
44 | 46 | { |
45 | 47 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
46 | - } |
|
47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | 49 | { |
49 | 50 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
50 | 51 | } |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airline'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
10 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Departure Airports by Country from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
16 | + $title = sprintf(_("Most Common Departure Airports by Country from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="select-item">'; |
19 | 19 | print '<form action="'.$globalURL.'/airline" method="post">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | $Stats = new Stats(); |
23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
24 | 24 | if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
25 | - foreach($airline_names as $airline_name) |
|
25 | + foreach ($airline_names as $airline_name) |
|
26 | 26 | { |
27 | - if($airline == $airline_name['airline_icao']) |
|
27 | + if ($airline == $airline_name['airline_icao']) |
|
28 | 28 | { |
29 | 29 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
30 | 30 | } else { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | include('airline-sub-menu.php'); |
63 | 63 | print '<div class="column">'; |
64 | 64 | print '<h2>'._("Most Common Departure Airports by Country").'</h2>'; |
65 | - print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
65 | + print '<p>'.sprintf(_("The statistic below shows all departure airports by Country of origin of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
66 | 66 | $airport_country_array = $Spotter->countAllDepartureAirportCountriesByAirline($airline); |
67 | 67 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
68 | 68 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
71 | 71 | print 'var series = ['; |
72 | 72 | $country_data = ''; |
73 | - foreach($airport_country_array as $airport_item) |
|
73 | + foreach ($airport_country_array as $airport_item) |
|
74 | 74 | { |
75 | 75 | $country_data .= '[ "'.$airport_item['departure_airport_country_iso3'].'",'.$airport_item['airport_departure_country_count'].'],'; |
76 | 76 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | print '</thead>'; |
118 | 118 | print '<tbody>'; |
119 | 119 | $i = 1; |
120 | - foreach($airport_country_array as $airport_item) |
|
120 | + foreach ($airport_country_array as $airport_item) |
|
121 | 121 | { |
122 | 122 | print '<tr>'; |
123 | 123 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | require_once('require/class.Stats.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['airline'])) { |
7 | - header('Location: '.$globalURL.'/airline'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/airline'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
11 | 11 | $Spotter = new Spotter(); |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | } |
77 | 77 | $country_data = substr($country_data, 0, -1); |
78 | 78 | print $country_data; |
79 | - print '];'; |
|
80 | - print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
81 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
82 | - print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
83 | - print 'new Datamap({ |
|
79 | + print '];'; |
|
80 | + print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
81 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
82 | + print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
83 | + print 'new Datamap({ |
|
84 | 84 | element: document.getElementById("chartCountry"), |
85 | 85 | projection: "mercator", // big world map |
86 | 86 | fills: { defaultFill: "#F5F5F5" }, |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | print '<option></option>'; |
22 | 22 | $Stats = new Stats(); |
23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
24 | - if (empty($ariline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
24 | + if (empty($ariline_names)) { |
|
25 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
26 | + } |
|
25 | 27 | foreach($airline_names as $airline_name) |
26 | 28 | { |
27 | 29 | if($_GET['airline'] == $airline_name['airline_icao']) |
@@ -43,8 +45,7 @@ discard block |
||
43 | 45 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
44 | 46 | { |
45 | 47 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
46 | - } |
|
47 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
48 | 49 | { |
49 | 50 | print '<img src="'.$globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png" alt="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" title="'.$spotter_array[0]['airline_name'].' ('.$spotter_array[0]['airline_icao'].')" class="logo" />'; |
50 | 51 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | require_once('require/class.Stats.php'); |
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | if (!isset($_GET['airline'])) { |
7 | - header('Location: '.$globalURL.'/airline'); |
|
8 | - die(); |
|
7 | + header('Location: '.$globalURL.'/airline'); |
|
8 | + die(); |
|
9 | 9 | } |
10 | 10 | $airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
11 | 11 | $Spotter = new Spotter(); |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | header('Location: '.$globalURL.'/airline'); |
8 | 8 | die(); |
9 | 9 | } |
10 | -$airline = filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
10 | +$airline = filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
11 | 11 | $Spotter = new Spotter(); |
12 | -$spotter_array = $Spotter->getSpotterDataByAirline($airline,"0,1",""); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByAirline($airline, "0,1", ""); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Arrival Airports from %s (%s)"),$spotter_array[0]['airline_name'],$spotter_array[0]['airline_icao']); |
|
16 | + $title = sprintf(_("Most Common Arrival Airports from %s (%s)"), $spotter_array[0]['airline_name'], $spotter_array[0]['airline_icao']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="select-item">'; |
19 | 19 | print '<form action="'.$globalURL.'/airline" method="post">'; |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | $Stats = new Stats(); |
23 | 23 | $airline_names = $Stats->getAllAirlineNames(); |
24 | 24 | if (empty($ariline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
25 | - foreach($airline_names as $airline_name) |
|
25 | + foreach ($airline_names as $airline_name) |
|
26 | 26 | { |
27 | - if($_GET['airline'] == $airline_name['airline_icao']) |
|
27 | + if ($_GET['airline'] == $airline_name['airline_icao']) |
|
28 | 28 | { |
29 | 29 | print '<option value="'.$airline_name['airline_icao'].'" selected="selected">'.$airline_name['airline_name'].' ('.$airline_name['airline_icao'].')</option>'; |
30 | 30 | } else { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | include('airline-sub-menu.php'); |
63 | 63 | print '<div class="column">'; |
64 | 64 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
65 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."),$spotter_array[0]['airline_name']).'</p>'; |
|
65 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights from <strong>%s</strong>."), $spotter_array[0]['airline_name']).'</p>'; |
|
66 | 66 | $airport_airport_array = $Spotter->countAllArrivalAirportsByAirline($airline); |
67 | 67 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
68 | 68 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | print '<script>'; |
72 | 72 | print 'var series = ['; |
73 | 73 | $airport_data = ''; |
74 | - foreach($airport_airport_array as $airport_item) |
|
74 | + foreach ($airport_airport_array as $airport_item) |
|
75 | 75 | { |
76 | 76 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_name'].' ('.$airport_item['airport_arrival_icao'].')",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
77 | 77 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | print '</thead>'; |
127 | 127 | print '<tbody>'; |
128 | 128 | $i = 1; |
129 | - foreach($airport_airport_array as $airport_item) |
|
129 | + foreach ($airport_airport_array as $airport_item) |
|
130 | 130 | { |
131 | 131 | print '<tr>'; |
132 | 132 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -24,7 +24,9 @@ |
||
24 | 24 | print '<option></option>'; |
25 | 25 | $Stats = new Stats(); |
26 | 26 | $aircraft_types = $Stats->getAllAircraftTypes(); |
27 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
27 | + if (empty($aircraft_types)) { |
|
28 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
29 | + } |
|
28 | 30 | foreach($aircraft_types as $aircrafttype) |
29 | 31 | { |
30 | 32 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | header('Location: '.$globalURL.'/aircraft'); |
10 | 10 | die(); |
11 | 11 | } |
12 | -$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
13 | -$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,"0,1",""); |
|
12 | +$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
13 | +$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, "0,1", ""); |
|
14 | 14 | |
15 | 15 | |
16 | 16 | if (!empty($spotter_array)) |
17 | 17 | { |
18 | - $title = sprintf(_("Most Common Airlines by Country from %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
18 | + $title = sprintf(_("Most Common Airlines by Country from %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
19 | 19 | require_once('header.php'); |
20 | 20 | |
21 | 21 | print '<div class="select-item">'; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | $Stats = new Stats(); |
26 | 26 | $aircraft_types = $Stats->getAllAircraftTypes(); |
27 | 27 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
28 | - foreach($aircraft_types as $aircrafttype) |
|
28 | + foreach ($aircraft_types as $aircrafttype) |
|
29 | 29 | { |
30 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
30 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
31 | 31 | { |
32 | 32 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
33 | 33 | } else { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | include('aircraft-sub-menu.php'); |
54 | 54 | print '<div class="column">'; |
55 | 55 | print '<h2>'._("Most Common Airlines by Country").'</h2>'; |
56 | - print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
56 | + print '<p>'.sprintf(_("The statistic below shows the most common airlines by Country of origin of flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
57 | 57 | |
58 | 58 | $airline_array = $Spotter->countAllAirlineCountriesByAircraft($aircraft_type); |
59 | 59 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
63 | 63 | print 'var series = ['; |
64 | 64 | $country_data = ''; |
65 | - foreach($airline_array as $airline_item) |
|
65 | + foreach ($airline_array as $airline_item) |
|
66 | 66 | { |
67 | 67 | $country_data .= '[ "'.$airline_item['airline_country_iso3'].'",'.$airline_item['airline_country_count'].'],'; |
68 | 68 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | print '</thead>'; |
110 | 110 | print '<tbody>'; |
111 | 111 | $i = 1; |
112 | - foreach($airline_array as $airline_item) |
|
112 | + foreach ($airline_array as $airline_item) |
|
113 | 113 | { |
114 | 114 | print '<tr>'; |
115 | 115 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | print '<div class="select-item">'; |
22 | 22 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
23 | 23 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
24 | - print '<option></option>'; |
|
25 | - $Stats = new Stats(); |
|
26 | - $aircraft_types = $Stats->getAllAircraftTypes(); |
|
27 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
28 | - foreach($aircraft_types as $aircrafttype) |
|
29 | - { |
|
30 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
31 | - { |
|
32 | - print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
33 | - } else { |
|
34 | - print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
35 | - } |
|
24 | + print '<option></option>'; |
|
25 | + $Stats = new Stats(); |
|
26 | + $aircraft_types = $Stats->getAllAircraftTypes(); |
|
27 | + if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
28 | + foreach($aircraft_types as $aircrafttype) |
|
29 | + { |
|
30 | + if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
31 | + { |
|
32 | + print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
33 | + } else { |
|
34 | + print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | print '</select>'; |
38 | 38 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
@@ -61,18 +61,18 @@ discard block |
||
61 | 61 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>'; |
62 | 62 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
63 | 63 | print 'var series = ['; |
64 | - $country_data = ''; |
|
64 | + $country_data = ''; |
|
65 | 65 | foreach($airline_array as $airline_item) |
66 | 66 | { |
67 | 67 | $country_data .= '[ "'.$airline_item['airline_country_iso3'].'",'.$airline_item['airline_country_count'].'],'; |
68 | 68 | } |
69 | - $country_data = substr($country_data, 0, -1); |
|
70 | - print $country_data; |
|
71 | - print '];'; |
|
72 | - print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
73 | - print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
74 | - print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
75 | - print 'new Datamap({ |
|
69 | + $country_data = substr($country_data, 0, -1); |
|
70 | + print $country_data; |
|
71 | + print '];'; |
|
72 | + print 'var dataset = {};var onlyValues = series.map(function(obj){ return obj[1]; });var minValue = Math.min.apply(null, onlyValues), maxValue = Math.max.apply(null, onlyValues);'; |
|
73 | + print 'var paletteScale = d3.scale.log().domain([minValue,maxValue]).range(["#EFEFFF","#001830"]);'; |
|
74 | + print 'series.forEach(function(item){var iso = item[0], value = item[1]; dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };});'; |
|
75 | + print 'new Datamap({ |
|
76 | 76 | element: document.getElementById("chartCountry"), |
77 | 77 | projection: "mercator", // big world map |
78 | 78 | fills: { defaultFill: "#F5F5F5" }, |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | print '<div class="select-item">'; |
43 | 43 | print '<form action="'.$globalURL.'/aircraft" method="post">'; |
44 | 44 | print '<select name="aircraft_type" class="selectpicker" data-live-search="true">'; |
45 | - print '<option></option>'; |
|
46 | - $Stats = new Stats(); |
|
45 | + print '<option></option>'; |
|
46 | + $Stats = new Stats(); |
|
47 | 47 | $aircraft_types = $Stats->getAllAircraftTypes(); |
48 | 48 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
49 | 49 | foreach($aircraft_types as $aircrafttype) |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | } else { |
55 | 55 | print '<option value="'.$aircrafttype['aircraft_icao'].'">'.$aircrafttype['aircraft_manufacturer'].' '.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
56 | 56 | } |
57 | - } |
|
58 | - print '</select>'; |
|
59 | - print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
57 | + } |
|
58 | + print '</select>'; |
|
59 | + print '<button type="submit"><i class="fa fa-angle-double-right"></i></button>'; |
|
60 | 60 | print '</form>'; |
61 | 61 | print '</div>'; |
62 | 62 | |
63 | 63 | if ($aircraft_type != "NA") |
64 | 64 | { |
65 | - print '<div class="info column">'; |
|
66 | - print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
|
67 | - print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
|
68 | - print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
|
69 | - if (isset($spotter_array[0]['aircraft_manufacturer'])) print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
70 | - print '</div>'; |
|
65 | + print '<div class="info column">'; |
|
66 | + print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
|
67 | + print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
|
68 | + print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
|
69 | + if (isset($spotter_array[0]['aircraft_manufacturer'])) print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
70 | + print '</div>'; |
|
71 | 71 | } else { |
72 | 72 | print '<div class="alert alert-warning">'._("This special aircraft profile shows all flights in where the aircraft type is unknown.").'</div>'; |
73 | 73 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $limit_start = 0; |
15 | 15 | $limit_end = 25; |
16 | 16 | $absolute_difference = 25; |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
19 | 19 | $limit_start = $limit_explode[0]; |
20 | 20 | $limit_end = $limit_explode[1]; |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | print '<option></option>'; |
46 | 46 | $Stats = new Stats(); |
47 | 47 | $aircraft_types = $Stats->getAllAircraftTypes(); |
48 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
48 | + if (empty($aircraft_types)) { |
|
49 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
50 | + } |
|
49 | 51 | foreach($aircraft_types as $aircrafttype) |
50 | 52 | { |
51 | 53 | if($aircraft_type == $aircrafttype['aircraft_icao']) |
@@ -66,7 +68,9 @@ discard block |
||
66 | 68 | print '<h1>'.$spotter_array[0]['aircraft_name'].' ('.$spotter_array[0]['aircraft_type'].')</h1>'; |
67 | 69 | print '<div><span class="label">'._("Name").'</span>'.$spotter_array[0]['aircraft_name'].'</div>'; |
68 | 70 | print '<div><span class="label">'._("ICAO").'</span>'.$spotter_array[0]['aircraft_type'].'</div>'; |
69 | - if (isset($spotter_array[0]['aircraft_manufacturer'])) print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
71 | + if (isset($spotter_array[0]['aircraft_manufacturer'])) { |
|
72 | + print '<div><span class="label">'._("Manufacturer").'</span><a href="'.$globalURL.'/manufacturer/'.strtolower(str_replace(" ", "-", $spotter_array[0]['aircraft_manufacturer'])).'">'.$spotter_array[0]['aircraft_manufacturer'].'</a></div>'; |
|
73 | + } |
|
70 | 74 | print '</div>'; |
71 | 75 | } else { |
72 | 76 | print '<div class="alert alert-warning">'._("This special aircraft profile shows all flights in where the aircraft type is unknown.").'</div>'; |
@@ -5,16 +5,16 @@ discard block |
||
5 | 5 | require_once('require/class.Language.php'); |
6 | 6 | $Spotter = new Spotter(); |
7 | 7 | |
8 | -if (!isset($_GET['aircraft_type'])){ |
|
8 | +if (!isset($_GET['aircraft_type'])) { |
|
9 | 9 | header('Location: '.$globalURL.'/aircraft'); |
10 | 10 | } else { |
11 | 11 | //calculuation for the pagination |
12 | - if(!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
12 | + if (!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2) |
|
13 | 13 | { |
14 | 14 | $limit_start = 0; |
15 | 15 | $limit_end = 25; |
16 | 16 | $absolute_difference = 25; |
17 | - } else { |
|
17 | + } else { |
|
18 | 18 | $limit_explode = explode(",", $_GET['limit']); |
19 | 19 | $limit_start = $limit_explode[0]; |
20 | 20 | $limit_end = $limit_explode[1]; |
@@ -28,15 +28,15 @@ discard block |
||
28 | 28 | $limit_previous_1 = $limit_start - $absolute_difference; |
29 | 29 | $limit_previous_2 = $limit_end - $absolute_difference; |
30 | 30 | |
31 | - $aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING); |
|
31 | + $aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING); |
|
32 | 32 | $page_url = $globalURL.'/aircraft/'.$aircraft_type; |
33 | 33 | |
34 | - $sort = htmlspecialchars(filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING)); |
|
35 | - $spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,$limit_start.",".$absolute_difference, $sort); |
|
34 | + $sort = htmlspecialchars(filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING)); |
|
35 | + $spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, $limit_start.",".$absolute_difference, $sort); |
|
36 | 36 | |
37 | 37 | if (!empty($spotter_array)) |
38 | 38 | { |
39 | - $title = sprintf(_("Detailed View for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']); |
|
39 | + $title = sprintf(_("Detailed View for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']); |
|
40 | 40 | require_once('header.php'); |
41 | 41 | |
42 | 42 | print '<div class="select-item">'; |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | $Stats = new Stats(); |
47 | 47 | $aircraft_types = $Stats->getAllAircraftTypes(); |
48 | 48 | if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
49 | - foreach($aircraft_types as $aircrafttype) |
|
49 | + foreach ($aircraft_types as $aircrafttype) |
|
50 | 50 | { |
51 | - if($aircraft_type == $aircrafttype['aircraft_icao']) |
|
51 | + if ($aircraft_type == $aircrafttype['aircraft_icao']) |
|
52 | 52 | { |
53 | 53 | print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_manufacturer'].' '.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>'; |
54 | 54 | } else { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | include('aircraft-sub-menu.php'); |
76 | 76 | |
77 | 77 | print '<div class="table column">'; |
78 | - print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>'; |
|
78 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>'; |
|
79 | 79 | |
80 | 80 | include('table-output.php'); |
81 | 81 |