@@ -26,7 +26,9 @@ discard block |
||
| 26 | 26 | if (isset($filter[0]['source'])) { |
| 27 | 27 | $filters = array_merge($filters,$filter); |
| 28 | 28 | } |
| 29 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 29 | + if (is_array($globalFilter)) { |
|
| 30 | + $filter = array_merge($filter,$globalFilter); |
|
| 31 | + } |
|
| 30 | 32 | $filter_query_join = ''; |
| 31 | 33 | $filter_query_where = ''; |
| 32 | 34 | foreach($filters as $flt) { |
@@ -72,8 +74,11 @@ discard block |
||
| 72 | 74 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 73 | 75 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
| 74 | 76 | } |
| 75 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 76 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 77 | + if ($filter_query_where == '' && $where) { |
|
| 78 | + $filter_query_where = ' WHERE'; |
|
| 79 | + } elseif ($filter_query_where != '' && $and) { |
|
| 80 | + $filter_query_where .= ' AND'; |
|
| 81 | + } |
|
| 77 | 82 | if ($filter_query_where != '') { |
| 78 | 83 | $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
| 79 | 84 | } |
@@ -593,7 +598,9 @@ discard block |
||
| 593 | 598 | $additional_query .= "(marine_archive_output.pilot_name like '%".$q_item."%') OR "; |
| 594 | 599 | $additional_query .= "(marine_archive_output.ident like '%".$q_item."%') OR "; |
| 595 | 600 | $translate = $Translation->ident2icao($q_item); |
| 596 | - if ($translate != $q_item) $additional_query .= "(marine_archive_output.ident like '%".$translate."%') OR "; |
|
| 601 | + if ($translate != $q_item) { |
|
| 602 | + $additional_query .= "(marine_archive_output.ident like '%".$translate."%') OR "; |
|
| 603 | + } |
|
| 597 | 604 | $additional_query .= "(marine_archive_output.highlight like '%".$q_item."%')"; |
| 598 | 605 | $additional_query .= ")"; |
| 599 | 606 | } |
@@ -811,7 +818,9 @@ discard block |
||
| 811 | 818 | date_default_timezone_set($globalTimezone); |
| 812 | 819 | $datetime = new DateTime(); |
| 813 | 820 | $offset = $datetime->format('P'); |
| 814 | - } else $offset = '+00:00'; |
|
| 821 | + } else { |
|
| 822 | + $offset = '+00:00'; |
|
| 823 | + } |
|
| 815 | 824 | |
| 816 | 825 | |
| 817 | 826 | if ($date_array[1] != "") |
@@ -1087,9 +1096,13 @@ discard block |
||
| 1087 | 1096 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 1088 | 1097 | } |
| 1089 | 1098 | } |
| 1090 | - if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
| 1099 | + if ($sincedate != '') { |
|
| 1100 | + $query .= "AND date > '".$sincedate."' "; |
|
| 1101 | + } |
|
| 1091 | 1102 | $query .= "GROUP BY c.name, c.iso3, c.iso2 ORDER BY nb DESC"; |
| 1092 | - if ($limit) $query .= " LIMIT 0,10"; |
|
| 1103 | + if ($limit) { |
|
| 1104 | + $query .= " LIMIT 0,10"; |
|
| 1105 | + } |
|
| 1093 | 1106 | |
| 1094 | 1107 | |
| 1095 | 1108 | $sth = $this->db->prepare($query); |
@@ -1133,9 +1146,13 @@ discard block |
||
| 1133 | 1146 | $query .= "AND s.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
| 1134 | 1147 | } |
| 1135 | 1148 | } |
| 1136 | - if ($sincedate != '') $query .= "AND s.date > '".$sincedate."' "; |
|
| 1149 | + if ($sincedate != '') { |
|
| 1150 | + $query .= "AND s.date > '".$sincedate."' "; |
|
| 1151 | + } |
|
| 1137 | 1152 | $query .= "GROUP BY o.airline_icao,c.name, c.iso3, c.iso2 ORDER BY nb DESC"; |
| 1138 | - if ($limit) $query .= " LIMIT 0,10"; |
|
| 1153 | + if ($limit) { |
|
| 1154 | + $query .= " LIMIT 0,10"; |
|
| 1155 | + } |
|
| 1139 | 1156 | |
| 1140 | 1157 | |
| 1141 | 1158 | $sth = $this->db->prepare($query); |