@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | 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" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | 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" />'; |
72 | 73 | } |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | 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" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | 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" />'; |
72 | 73 | } |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | 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" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | 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" />'; |
72 | 73 | } |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | 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" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | 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" />'; |
72 | 73 | } |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | $Stats = new Stats(); |
44 | 44 | $airline_names = $Stats->getAllAirlineNames(); |
45 | - if (empty($airline_names)) $airline_names = $Spotter->getAllAirlineNames(); |
|
45 | + if (empty($airline_names)) { |
|
46 | + $airline_names = $Spotter->getAllAirlineNames(); |
|
47 | + } |
|
46 | 48 | foreach($airline_names as $airline_name) |
47 | 49 | { |
48 | 50 | if($airline == $airline_name['airline_icao']) |
@@ -65,8 +67,7 @@ discard block |
||
65 | 67 | if ($globalIVAO && @getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.gif')) |
66 | 68 | { |
67 | 69 | 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" />'; |
68 | - } |
|
69 | - elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | + } elseif (@getimagesize($globalURL.'/images/airlines/'.$spotter_array[0]['airline_icao'].'.png')) |
|
70 | 71 | { |
71 | 72 | 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" />'; |
72 | 73 | } |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | echo json_encode($marinecnt); |
26 | 26 | } elseif ($ask == 'manufacturer') { |
27 | 27 | $manufacturers = $Stats->getAllManufacturers(); |
28 | - if (empty($manufacturers)) $manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + if (empty($manufacturers)) { |
|
29 | + $manufacturers = $Spotter->getAllManufacturers(); |
|
30 | + } |
|
29 | 31 | $all_manufacturers = array(); |
30 | 32 | foreach($manufacturers as $manufacturer) |
31 | 33 | { |
@@ -34,7 +36,9 @@ discard block |
||
34 | 36 | echo json_encode($all_manufacturers); |
35 | 37 | } elseif ($ask == 'aircrafttypes') { |
36 | 38 | $aircraft_types = $Stats->getAllAircraftTypes(); |
37 | - if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
39 | + if (empty($aircraft_types)) { |
|
40 | + $aircraft_types = $Spotter->getAllAircraftTypes(); |
|
41 | + } |
|
38 | 42 | $all_aircraft_types = array(); |
39 | 43 | foreach($aircraft_types as $aircraft_type) |
40 | 44 | { |
@@ -59,7 +63,9 @@ discard block |
||
59 | 63 | echo json_encode($all_airline_countries); |
60 | 64 | } elseif ($ask == 'airportnames' || $ask == 'departureairportnames' || $ask == 'arrivalairportnames') { |
61 | 65 | $airport_names = $Stats->getAllAirportNames(); |
62 | - if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames(); |
|
66 | + if (empty($airport_names)) { |
|
67 | + $airport_names = $Spotter->getAllAirportNames(); |
|
68 | + } |
|
63 | 69 | ksort($airport_names); |
64 | 70 | $all_airport_names = array(); |
65 | 71 | foreach($airport_names as $airport_name) |
@@ -52,7 +52,12 @@ |
||
52 | 52 | } else { |
53 | 53 | for (var i = 0; i < viewer.dataSources.get(dsn).entities.values.length; i++) { |
54 | 54 | var entity = viewer.dataSources.get(dsn).entities.values[i]; |
55 | - if (parseInt(entity.lastupdatesat) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) print $globalMapRefresh*2000; else print '60000'; ?>)) { |
|
55 | + if (parseInt(entity.lastupdatesat) < Math.floor(Date.now()-<?php if (isset($globalMapRefresh)) { |
|
56 | + print $globalMapRefresh*2000; |
|
57 | +} else { |
|
58 | + print '60000'; |
|
59 | +} |
|
60 | +?>)) { |
|
56 | 61 | viewer.dataSources.get(dsn).entities.remove(entity); |
57 | 62 | } |
58 | 63 | } |
@@ -33,7 +33,9 @@ discard block |
||
33 | 33 | if (file_exists('images/airlines/'.str_replace(' ','_',$alliance['alliance']).'.png')) |
34 | 34 | { |
35 | 35 | print '<img src="'.$globalURL.'/images/airlines/'.str_replace(' ','_',$alliance['alliance']).'.png" alt="'._("Click to see alliance activity").'" title="'._("Click to see alliance activity").'" /> '; |
36 | - } else print $alliance['alliance']; |
|
36 | + } else { |
|
37 | + print $alliance['alliance']; |
|
38 | + } |
|
37 | 39 | print '</a>'; |
38 | 40 | print '</div>'; |
39 | 41 | } |
@@ -42,13 +44,21 @@ discard block |
||
42 | 44 | } |
43 | 45 | print '<div class="select-item"><form action="'.$globalURL.'/airline" method="post"><select name="airline_type" class="selectpicker" data-live-search="true">'; |
44 | 46 | print '<option value="all"'; |
45 | - if ($airline_type == 'all') print 'selected="selected" '; |
|
47 | + if ($airline_type == 'all') { |
|
48 | + print 'selected="selected" '; |
|
49 | + } |
|
46 | 50 | print '>'._("All").'</option><option value="passenger"'; |
47 | - if ($airline_type == 'passenger') print 'selected="selected" '; |
|
51 | + if ($airline_type == 'passenger') { |
|
52 | + print 'selected="selected" '; |
|
53 | + } |
|
48 | 54 | print '>'._("Passenger").'</option><option value="cargo"'; |
49 | - if ($airline_type == 'cargo') print 'selected="selected" '; |
|
55 | + if ($airline_type == 'cargo') { |
|
56 | + print 'selected="selected" '; |
|
57 | + } |
|
50 | 58 | print '>'._("Cargo").'</option><option value="military"'; |
51 | - if ($airline_type == 'military') print 'selected="selected" '; |
|
59 | + if ($airline_type == 'military') { |
|
60 | + print 'selected="selected" '; |
|
61 | + } |
|
52 | 62 | print '>'._("Military").'</option></select>'; |
53 | 63 | print '<button type="submit"><i class="fa fa-angle-double-right"></i></button></form></div>'; |
54 | 64 | |
@@ -75,7 +85,9 @@ discard block |
||
75 | 85 | $firstLetter = strtoupper($Common->replace_mb_substr($value['airline_name'], 0, 1)); |
76 | 86 | if($previous !== $firstLetter) |
77 | 87 | { |
78 | - if ($previous !== null) print ' | '; |
|
88 | + if ($previous !== null) { |
|
89 | + print ' | '; |
|
90 | + } |
|
79 | 91 | print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>'; |
80 | 92 | } |
81 | 93 | $previous = $firstLetter; |
@@ -88,7 +100,9 @@ discard block |
||
88 | 100 | { |
89 | 101 | if($previous !== $firstLetter) |
90 | 102 | { |
91 | - if ($previous !== null) print '</div>'; |
|
103 | + if ($previous !== null) { |
|
104 | + print '</div>'; |
|
105 | + } |
|
92 | 106 | print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">'; |
93 | 107 | } |
94 | 108 | $previous = $firstLetter; |
@@ -102,10 +116,14 @@ discard block |
||
102 | 116 | } elseif (file_exists('images/airlines/'.$value['airline_icao'].'.png')) |
103 | 117 | { |
104 | 118 | print '<img src="'.$globalURL.'/images/airlines/'.$value['airline_icao'].'.png" alt="'._("Click to see airline activity").'" title="'._("Click to see airline activity").'" /> '; |
105 | - if (isset($value['ban_eu']) && $value['ban_eu'] == 1) print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
119 | + if (isset($value['ban_eu']) && $value['ban_eu'] == 1) { |
|
120 | + print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
121 | + } |
|
106 | 122 | } else { |
107 | 123 | print $value['airline_name']; |
108 | - if (isset($value['ban_eu']) && $value['ban_eu'] == 1) print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
124 | + if (isset($value['ban_eu']) && $value['ban_eu'] == 1) { |
|
125 | + print '<img src="'.$globalURL.'/images/baneu.png" alt="'._("Banned in Europe").'" title="'._("Banned in Europe").'" /> '; |
|
126 | + } |
|
109 | 127 | } |
110 | 128 | print '</a>'; |
111 | 129 | print '</div>'; |
@@ -10,7 +10,9 @@ discard block |
||
10 | 10 | public static function import_file($filename) { |
11 | 11 | $filename = filter_var($filename,FILTER_SANITIZE_STRING); |
12 | 12 | $Connection = new Connection(); |
13 | - if (!$Connection->connectionExists()) return 'error: DB connection failed'; |
|
13 | + if (!$Connection->connectionExists()) { |
|
14 | + return 'error: DB connection failed'; |
|
15 | + } |
|
14 | 16 | //Connection::$db->beginTransaction(); |
15 | 17 | $templine = ''; |
16 | 18 | $handle = @fopen($filename,"r"); |
@@ -19,7 +21,9 @@ discard block |
||
19 | 21 | //foreach ($lines as $line) |
20 | 22 | while (($line = fgets($handle,4096)) !== false) |
21 | 23 | { |
22 | - if (substr($line,0,2) == '--' || $line == '') continue; |
|
24 | + if (substr($line,0,2) == '--' || $line == '') { |
|
25 | + continue; |
|
26 | + } |
|
23 | 27 | $templine .= $line; |
24 | 28 | if (substr(trim($line), -1,1) == ';') |
25 | 29 | { |
@@ -45,7 +49,9 @@ discard block |
||
45 | 49 | //foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $filename) |
46 | 50 | while(false !== ($filename = readdir($dh))) |
47 | 51 | { |
48 | - if (preg_match('/\.sql$/',$filename)) $error .= create_db::import_file($directory.$filename); |
|
52 | + if (preg_match('/\.sql$/',$filename)) { |
|
53 | + $error .= create_db::import_file($directory.$filename); |
|
54 | + } |
|
49 | 55 | } |
50 | 56 | return $error; |
51 | 57 | } |
@@ -58,19 +64,29 @@ discard block |
||
58 | 64 | $db = filter_var($db,FILTER_SANITIZE_STRING); |
59 | 65 | $db_type = filter_var($db_type,FILTER_SANITIZE_STRING); |
60 | 66 | $host = filter_var($host,FILTER_SANITIZE_STRING); |
61 | - if ($db_type == 'mysql' && $port == '') $port = 3306; |
|
62 | - elseif ($port == '') $port = 5432; |
|
67 | + if ($db_type == 'mysql' && $port == '') { |
|
68 | + $port = 3306; |
|
69 | + } elseif ($port == '') { |
|
70 | + $port = 5432; |
|
71 | + } |
|
63 | 72 | // Dirty hack |
64 | 73 | if ($host != 'localhost' && $host != '127.0.0.1') { |
65 | 74 | $grantright = $_SERVER['SERVER_ADDR']; |
66 | - } else $grantright = 'localhost'; |
|
75 | + } else { |
|
76 | + $grantright = 'localhost'; |
|
77 | + } |
|
67 | 78 | try { |
68 | - if ($host == 'localhost') $dbh = new PDO($db_type.':host=127.0.0.1',$root,$root_pass); |
|
69 | - else $dbh = new PDO($db_type.':host='.$host.';port='.$port,$root,$root_pass); |
|
79 | + if ($host == 'localhost') { |
|
80 | + $dbh = new PDO($db_type.':host=127.0.0.1',$root,$root_pass); |
|
81 | + } else { |
|
82 | + $dbh = new PDO($db_type.':host='.$host.';port='.$port,$root,$root_pass); |
|
83 | + } |
|
70 | 84 | $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
71 | 85 | if ($db_type == 'mysql') { |
72 | 86 | $dbh->exec('CREATE DATABASE IF NOT EXISTS `'.$db.'`;GRANT ALL ON `'.$db."`.* TO '".$user."'@'".$grantright."' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
73 | - if ($grantright == 'localhost') $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
87 | + if ($grantright == 'localhost') { |
|
88 | + $dbh->exec('GRANT ALL ON `'.$db."`.* TO '".$user."'@'127.0.0.1' IDENTIFIED BY '".$password."';FLUSH PRIVILEGES;"); |
|
89 | + } |
|
74 | 90 | } else if ($db_type == 'pgsql') { |
75 | 91 | $dbh->exec("CREATE DATABASE ".$db.";"); |
76 | 92 | $dbh->exec("CREATE USER ".$user." WITH PASSWORD '".$password."'; |