@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ |
||
23 | 23 | print '<select name="aircraft_manufacturer" class="selectpicker" data-live-search="true">'; |
24 | 24 | $Stats = new Stats(); |
25 | 25 | $all_manufacturers = $Stats->getAllManufacturers(); |
26 | - if (empty($all_manufacturers)) $all_manufacturers = $Spotter->getAllManufacturers(); |
|
26 | + if (empty($all_manufacturers)) { |
|
27 | + $all_manufacturers = $Spotter->getAllManufacturers(); |
|
28 | + } |
|
27 | 29 | foreach($all_manufacturers as $all_manufacturer) |
28 | 30 | { |
29 | 31 | if($_GET['aircraft_manufacturer'] == strtolower(str_replace(" ", "-", $all_manufacturer['aircraft_manufacturer']))) |
@@ -23,7 +23,9 @@ discard block |
||
23 | 23 | $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
24 | 24 | } |
25 | 25 | } |
26 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
26 | + if (is_array($globalFilter)) { |
|
27 | + $filter = array_merge($filter,$globalFilter); |
|
28 | + } |
|
27 | 29 | $filter_query_join = ''; |
28 | 30 | $filter_query_where = ''; |
29 | 31 | foreach($filters as $flt) { |
@@ -69,8 +71,11 @@ discard block |
||
69 | 71 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
70 | 72 | } |
71 | 73 | } |
72 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
73 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
74 | + if ($filter_query_where == '' && $where) { |
|
75 | + $filter_query_where = ' WHERE'; |
|
76 | + } elseif ($filter_query_where != '' && $and) { |
|
77 | + $filter_query_where .= ' AND'; |
|
78 | + } |
|
74 | 79 | $filter_query = $filter_query_join.$filter_query_where; |
75 | 80 | return $filter_query; |
76 | 81 | } |
@@ -81,10 +86,17 @@ discard block |
||
81 | 86 | if ($over_country == '') { |
82 | 87 | $Spotter = new Spotter($this->db); |
83 | 88 | $data_country = $Spotter->getCountryFromLatitudeLongitude($latitude,$longitude); |
84 | - if (!empty($data_country)) $country = $data_country['iso2']; |
|
85 | - else $country = ''; |
|
86 | - } else $country = $over_country; |
|
87 | - if ($airline_type === NULL) $airline_type =''; |
|
89 | + if (!empty($data_country)) { |
|
90 | + $country = $data_country['iso2']; |
|
91 | + } else { |
|
92 | + $country = ''; |
|
93 | + } |
|
94 | + } else { |
|
95 | + $country = $over_country; |
|
96 | + } |
|
97 | + if ($airline_type === NULL) { |
|
98 | + $airline_type =''; |
|
99 | + } |
|
88 | 100 | |
89 | 101 | //if ($country == '') echo "\n".'************ UNKNOW COUNTRY ****************'."\n"; |
90 | 102 | //else echo "\n".'*/*/*/*/*/*/*/ Country : '.$country.' */*/*/*/*/*/*/*/*/'."\n"; |
@@ -587,7 +599,9 @@ discard block |
||
587 | 599 | $additional_query .= "(spotter_archive_output.pilot_name like '%".$q_item."%') OR "; |
588 | 600 | $additional_query .= "(spotter_archive_output.ident like '%".$q_item."%') OR "; |
589 | 601 | $translate = $Translation->ident2icao($q_item); |
590 | - if ($translate != $q_item) $additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR "; |
|
602 | + if ($translate != $q_item) { |
|
603 | + $additional_query .= "(spotter_archive_output.ident like '%".$translate."%') OR "; |
|
604 | + } |
|
591 | 605 | $additional_query .= "(spotter_archive_output.highlight like '%".$q_item."%')"; |
592 | 606 | $additional_query .= ")"; |
593 | 607 | } |
@@ -805,7 +819,9 @@ discard block |
||
805 | 819 | date_default_timezone_set($globalTimezone); |
806 | 820 | $datetime = new DateTime(); |
807 | 821 | $offset = $datetime->format('P'); |
808 | - } else $offset = '+00:00'; |
|
822 | + } else { |
|
823 | + $offset = '+00:00'; |
|
824 | + } |
|
809 | 825 | |
810 | 826 | |
811 | 827 | if ($date_array[1] != "") |
@@ -969,9 +985,13 @@ discard block |
||
969 | 985 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
970 | 986 | } |
971 | 987 | } |
972 | - if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
988 | + if ($sincedate != '') { |
|
989 | + $query .= "AND date > '".$sincedate."' "; |
|
990 | + } |
|
973 | 991 | $query .= "GROUP BY c.name, c.iso3, c.iso2 ORDER BY nb DESC"; |
974 | - if ($limit) $query .= " LIMIT 0,10"; |
|
992 | + if ($limit) { |
|
993 | + $query .= " LIMIT 0,10"; |
|
994 | + } |
|
975 | 995 | |
976 | 996 | |
977 | 997 | $sth = $this->db->prepare($query); |