@@ -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); |
@@ -26,7 +26,9 @@ discard block |
||
26 | 26 | $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
27 | 27 | } |
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) { |
@@ -71,8 +73,11 @@ discard block |
||
71 | 73 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
72 | 74 | } |
73 | 75 | } |
74 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
75 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
76 | + if ($filter_query_where == '' && $where) { |
|
77 | + $filter_query_where = ' WHERE'; |
|
78 | + } elseif ($filter_query_where != '' && $and) { |
|
79 | + $filter_query_where .= ' AND'; |
|
80 | + } |
|
76 | 81 | $filter_query = $filter_query_join.$filter_query_where; |
77 | 82 | return $filter_query; |
78 | 83 | } |
@@ -108,7 +113,9 @@ discard block |
||
108 | 113 | $orderby_query = ' '.$search_orderby_array[$sort]['sql']; |
109 | 114 | } |
110 | 115 | |
111 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
116 | + if (!isset($globalLiveInterval)) { |
|
117 | + $globalLiveInterval = '200'; |
|
118 | + } |
|
112 | 119 | if ($globalDBdriver == 'mysql') { |
113 | 120 | //$query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate"; |
114 | 121 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query.$orderby_query; |
@@ -133,7 +140,9 @@ discard block |
||
133 | 140 | |
134 | 141 | $filter_query = $this->getFilter($filter,true,true); |
135 | 142 | |
136 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
143 | + if (!isset($globalLiveInterval)) { |
|
144 | + $globalLiveInterval = '200'; |
|
145 | + } |
|
137 | 146 | if ($globalDBdriver == 'mysql') { |
138 | 147 | // $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL ".$globalLiveInterval." SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate$orderby_query"; |
139 | 148 | // $query = 'SELECT spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, a.aircraft_shadow FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate INNER JOIN (SELECT * FROM aircraft) a on spotter_live.aircraft_icao = a.icao'; |
@@ -180,7 +189,9 @@ discard block |
||
180 | 189 | |
181 | 190 | $filter_query = $this->getFilter($filter,true,true); |
182 | 191 | |
183 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
192 | + if (!isset($globalLiveInterval)) { |
|
193 | + $globalLiveInterval = '200'; |
|
194 | + } |
|
184 | 195 | if ($globalDBdriver == 'mysql') { |
185 | 196 | |
186 | 197 | $query = 'SELECT a.aircraft_shadow, a.engine_type, a.engine_count, a.wake_category, spotter_live.ident, spotter_live.flightaware_id, spotter_live.aircraft_icao, spotter_live.departure_airport_icao as departure_airport, spotter_live.arrival_airport_icao as arrival_airport, spotter_live.latitude, spotter_live.longitude, spotter_live.altitude, spotter_live.heading, spotter_live.ground_speed, spotter_live.squawk, spotter_live.date, spotter_live.format_source |
@@ -220,7 +231,9 @@ discard block |
||
220 | 231 | global $globalDBdriver, $globalLiveInterval; |
221 | 232 | $filter_query = $this->getFilter($filter,true,true); |
222 | 233 | |
223 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
234 | + if (!isset($globalLiveInterval)) { |
|
235 | + $globalLiveInterval = '200'; |
|
236 | + } |
|
224 | 237 | if ($globalDBdriver == 'mysql') { |
225 | 238 | //$query = 'SELECT COUNT(*) as nb FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate'.$filter_query; |
226 | 239 | $query = 'SELECT COUNT(DISTINCT spotter_live.flightaware_id) as nb FROM spotter_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
@@ -250,7 +263,9 @@ discard block |
||
250 | 263 | { |
251 | 264 | global $globalDBdriver, $globalLiveInterval; |
252 | 265 | $Spotter = new Spotter($this->db); |
253 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
266 | + if (!isset($globalLiveInterval)) { |
|
267 | + $globalLiveInterval = '200'; |
|
268 | + } |
|
254 | 269 | $filter_query = $this->getFilter($filter); |
255 | 270 | |
256 | 271 | if (is_array($coord)) { |
@@ -258,7 +273,9 @@ discard block |
||
258 | 273 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
259 | 274 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
260 | 275 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
261 | - } else return array(); |
|
276 | + } else { |
|
277 | + return array(); |
|
278 | + } |
|
262 | 279 | if ($globalDBdriver == 'mysql') { |
263 | 280 | //$query = "SELECT spotter_output.* FROM spotter_output WHERE spotter_output.flightaware_id IN (SELECT spotter_live.flightaware_id FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL ".$globalLiveInterval." SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN ".$minlat." AND ".$maxlat." AND spotter_live.longitude BETWEEN ".$minlong." AND ".$maxlong.")"; |
264 | 281 | $query = 'SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.flightaware_id, max(l.date) as maxdate FROM spotter_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.flightaware_id) s on spotter_live.flightaware_id = s.flightaware_id AND spotter_live.date = s.maxdate AND spotter_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND spotter_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY spotter_live.flightaware_id'.$filter_query; |
@@ -449,11 +466,15 @@ discard block |
||
449 | 466 | //$query = self::$global_query.' WHERE spotter_live.flightaware_id = :id ORDER BY date'; |
450 | 467 | if ($globalDBdriver == 'mysql') { |
451 | 468 | $query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id'; |
452 | - if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
469 | + if ($liveinterval) { |
|
470 | + $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
471 | + } |
|
453 | 472 | $query .= ' ORDER BY date'; |
454 | 473 | } else { |
455 | 474 | $query = 'SELECT spotter_live.* FROM spotter_live WHERE spotter_live.flightaware_id = :id'; |
456 | - if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
475 | + if ($liveinterval) { |
|
476 | + $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
477 | + } |
|
457 | 478 | $query .= ' ORDER BY date'; |
458 | 479 | } |
459 | 480 | |
@@ -548,7 +569,9 @@ discard block |
||
548 | 569 | $i++; |
549 | 570 | $j++; |
550 | 571 | if ($j == 30) { |
551 | - if ($globalDebug) echo "."; |
|
572 | + if ($globalDebug) { |
|
573 | + echo "."; |
|
574 | + } |
|
552 | 575 | try { |
553 | 576 | |
554 | 577 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
@@ -856,7 +879,9 @@ discard block |
||
856 | 879 | { |
857 | 880 | return false; |
858 | 881 | } |
859 | - } else return ''; |
|
882 | + } else { |
|
883 | + return ''; |
|
884 | + } |
|
860 | 885 | |
861 | 886 | if ($longitude != '') |
862 | 887 | { |
@@ -864,7 +889,9 @@ discard block |
||
864 | 889 | { |
865 | 890 | return false; |
866 | 891 | } |
867 | - } else return ''; |
|
892 | + } else { |
|
893 | + return ''; |
|
894 | + } |
|
868 | 895 | |
869 | 896 | if ($waypoints != '') |
870 | 897 | { |
@@ -880,7 +907,9 @@ discard block |
||
880 | 907 | { |
881 | 908 | return false; |
882 | 909 | } |
883 | - } else $altitude = 0; |
|
910 | + } else { |
|
911 | + $altitude = 0; |
|
912 | + } |
|
884 | 913 | |
885 | 914 | if ($heading != '') |
886 | 915 | { |
@@ -888,7 +917,9 @@ discard block |
||
888 | 917 | { |
889 | 918 | return false; |
890 | 919 | } |
891 | - } else $heading = 0; |
|
920 | + } else { |
|
921 | + $heading = 0; |
|
922 | + } |
|
892 | 923 | |
893 | 924 | if ($groundspeed != '') |
894 | 925 | { |
@@ -896,9 +927,13 @@ discard block |
||
896 | 927 | { |
897 | 928 | return false; |
898 | 929 | } |
899 | - } else $groundspeed = 0; |
|
930 | + } else { |
|
931 | + $groundspeed = 0; |
|
932 | + } |
|
900 | 933 | date_default_timezone_set('UTC'); |
901 | - if ($date == '') $date = date("Y-m-d H:i:s", time()); |
|
934 | + if ($date == '') { |
|
935 | + $date = date("Y-m-d H:i:s", time()); |
|
936 | + } |
|
902 | 937 | |
903 | 938 | |
904 | 939 | $flightaware_id = filter_var($flightaware_id,FILTER_SANITIZE_STRING); |
@@ -942,10 +977,18 @@ discard block |
||
942 | 977 | $arrival_airport_country = ''; |
943 | 978 | |
944 | 979 | |
945 | - if ($squawk == '' || $Common->isInteger($squawk) === false ) $squawk = NULL; |
|
946 | - if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) $verticalrate = NULL; |
|
947 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
948 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
980 | + if ($squawk == '' || $Common->isInteger($squawk) === false ) { |
|
981 | + $squawk = NULL; |
|
982 | + } |
|
983 | + if ($verticalrate == '' || $Common->isInteger($verticalrate) === false ) { |
|
984 | + $verticalrate = NULL; |
|
985 | + } |
|
986 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) { |
|
987 | + $groundspeed = 0; |
|
988 | + } |
|
989 | + if ($heading == '' || $Common->isInteger($heading) === false ) { |
|
990 | + $heading = 0; |
|
991 | + } |
|
949 | 992 | |
950 | 993 | $query = 'INSERT INTO spotter_live (flightaware_id, ident, registration, airline_name, airline_icao, airline_country, airline_type, aircraft_icao, aircraft_shadow, aircraft_name, aircraft_manufacturer, departure_airport_icao, departure_airport_name, departure_airport_city, departure_airport_country, arrival_airport_icao, arrival_airport_name, arrival_airport_city, arrival_airport_country, latitude, longitude, waypoints, altitude, heading, ground_speed, date, departure_airport_time, arrival_airport_time, squawk, route_stop, ModeS, pilot_id, pilot_name, verticalrate, ground, format_source, source_name, over_country) |
951 | 994 | VALUES (:flightaware_id,:ident,:registration,:airline_name,:airline_icao,:airline_country,:airline_type,:aircraft_icao,:aircraft_shadow,:aircraft_type,:aircraft_manufacturer,:departure_airport_icao,:departure_airport_name, :departure_airport_city, :departure_airport_country, :arrival_airport_icao, :arrival_airport_name, :arrival_airport_city, :arrival_airport_country, :latitude,:longitude,:waypoints,:altitude,:heading,:groundspeed,:date,:departure_airport_time,:arrival_airport_time,:squawk,:route_stop,:ModeS, :pilot_id, :pilot_name, :verticalrate, :ground, :format_source, :source_name, :over_country)'; |
@@ -960,9 +1003,13 @@ discard block |
||
960 | 1003 | return "error : ".$e->getMessage(); |
961 | 1004 | } |
962 | 1005 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
963 | - if ($globalDebug) echo '(Add to SBS archive : '; |
|
1006 | + if ($globalDebug) { |
|
1007 | + echo '(Add to SBS archive : '; |
|
1008 | + } |
|
964 | 1009 | $result = $SpotterArchive->addSpotterArchiveData($flightaware_id, $ident, $registration, $airline_name, $airline_icao, $airline_country, $airline_type, $aircraft_icao, $aircraft_shadow, $aircraft_name, $aircraft_manufacturer, $departure_airport_icao, $departure_airport_name, $departure_airport_city, $departure_airport_country, $departure_airport_time,$arrival_airport_icao, $arrival_airport_name, $arrival_airport_city, $arrival_airport_country, $arrival_airport_time, $route_stop, $date,$latitude, $longitude, $waypoints, $altitude, $heading, $groundspeed, $squawk, $ModeS, $pilot_id, $pilot_name,$verticalrate,$format_source,$source_name, $over_country); |
965 | - if ($globalDebug) echo $result.')'; |
|
1010 | + if ($globalDebug) { |
|
1011 | + echo $result.')'; |
|
1012 | + } |
|
966 | 1013 | } |
967 | 1014 | return "success"; |
968 | 1015 |
@@ -20,20 +20,27 @@ discard block |
||
20 | 20 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
21 | 21 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
22 | 22 | foreach($globalStatsFilters[$globalFilterName] as $source) { |
23 | - if (isset($source['source'])) $filter['source'][] = $source['source']; |
|
23 | + if (isset($source['source'])) { |
|
24 | + $filter['source'][] = $source['source']; |
|
25 | + } |
|
24 | 26 | } |
25 | 27 | } else { |
26 | 28 | $filter = $globalStatsFilters[$globalFilterName]; |
27 | 29 | } |
28 | 30 | } |
29 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
31 | + if (is_array($globalFilter)) { |
|
32 | + $filter = array_merge($filter,$globalFilter); |
|
33 | + } |
|
30 | 34 | $filter_query_join = ''; |
31 | 35 | $filter_query_where = ''; |
32 | 36 | if (isset($filter['source']) && !empty($filter['source'])) { |
33 | 37 | $filter_query_where = " WHERE format_source IN ('".implode("','",$filter['source'])."')"; |
34 | 38 | } |
35 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
36 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
39 | + if ($filter_query_where == '' && $where) { |
|
40 | + $filter_query_where = ' WHERE'; |
|
41 | + } elseif ($filter_query_where != '' && $and) { |
|
42 | + $filter_query_where .= ' AND'; |
|
43 | + } |
|
37 | 44 | $filter_query = $filter_query_join.$filter_query_where; |
38 | 45 | return $filter_query; |
39 | 46 | } |
@@ -57,7 +64,9 @@ discard block |
||
57 | 64 | $info = str_replace('^','<br />',$info); |
58 | 65 | $info = str_replace('&sect;','',$info); |
59 | 66 | $info = str_replace('"','',$info); |
60 | - if ($type == '') $type = NULL; |
|
67 | + if ($type == '') { |
|
68 | + $type = NULL; |
|
69 | + } |
|
61 | 70 | $query = "INSERT INTO atc (ident,frequency,latitude,longitude,atc_range,info,atc_lastseen,type,ivao_id,ivao_name,format_source,source_name) VALUES (:ident,:frequency,:latitude,:longitude,:range,:info,:date,:type,:ivao_id,:ivao_name,:format_source,:source_name)"; |
62 | 71 | $query_values = array(':ident' => $ident,':frequency' => $frequency,':latitude' => $latitude,':longitude' => $longitude,':range' => $range,':info' => $info,':date' => $date,':ivao_id' => $ivao_id,':ivao_name' => $ivao_name, ':type' => $type,':format_source' => $format_source,':source_name' => $source_name); |
63 | 72 | try { |
@@ -258,7 +258,9 @@ discard block |
||
258 | 258 | // Update table countries |
259 | 259 | if ($Connection->tableExists('airspace')) { |
260 | 260 | $error .= update_db::update_countries(); |
261 | - if ($error != '') return $error; |
|
261 | + if ($error != '') { |
|
262 | + return $error; |
|
263 | + } |
|
262 | 264 | } |
263 | 265 | // Update schema_version to 7 |
264 | 266 | $query = "UPDATE `config` SET `value` = '7' WHERE `name` = 'schema_version'"; |
@@ -314,7 +316,9 @@ discard block |
||
314 | 316 | $error = ''; |
315 | 317 | // Update table aircraft |
316 | 318 | $error .= create_db::import_file('../db/source_location.sql'); |
317 | - if ($error != '') return $error; |
|
319 | + if ($error != '') { |
|
320 | + return $error; |
|
321 | + } |
|
318 | 322 | // Update schema_version to 6 |
319 | 323 | $query = "UPDATE `config` SET `value` = '8' WHERE `name` = 'schema_version'"; |
320 | 324 | try { |
@@ -331,7 +335,9 @@ discard block |
||
331 | 335 | $error = ''; |
332 | 336 | // Update table aircraft |
333 | 337 | $error .= create_db::import_file('../db/notam.sql'); |
334 | - if ($error != '') return $error; |
|
338 | + if ($error != '') { |
|
339 | + return $error; |
|
340 | + } |
|
335 | 341 | $query = "DELETE FROM config WHERE name = 'last_update_db'; |
336 | 342 | INSERT INTO config (name,value) VALUES ('last_update_db',NOW()); |
337 | 343 | DELETE FROM config WHERE name = 'last_update_notam_db'; |
@@ -365,7 +371,9 @@ discard block |
||
365 | 371 | $error = ''; |
366 | 372 | // Update table atc |
367 | 373 | $error .= create_db::import_file('../db/atc.sql'); |
368 | - if ($error != '') return $error; |
|
374 | + if ($error != '') { |
|
375 | + return $error; |
|
376 | + } |
|
369 | 377 | |
370 | 378 | $query = "UPDATE `config` SET `value` = '10' WHERE `name` = 'schema_version'"; |
371 | 379 | try { |
@@ -389,13 +397,21 @@ discard block |
||
389 | 397 | $error = ''; |
390 | 398 | // Add tables |
391 | 399 | $error .= create_db::import_file('../db/aircraft_owner.sql'); |
392 | - if ($error != '') return $error; |
|
400 | + if ($error != '') { |
|
401 | + return $error; |
|
402 | + } |
|
393 | 403 | $error .= create_db::import_file('../db/metar.sql'); |
394 | - if ($error != '') return $error; |
|
404 | + if ($error != '') { |
|
405 | + return $error; |
|
406 | + } |
|
395 | 407 | $error .= create_db::import_file('../db/taf.sql'); |
396 | - if ($error != '') return $error; |
|
408 | + if ($error != '') { |
|
409 | + return $error; |
|
410 | + } |
|
397 | 411 | $error .= create_db::import_file('../db/airport.sql'); |
398 | - if ($error != '') return $error; |
|
412 | + if ($error != '') { |
|
413 | + return $error; |
|
414 | + } |
|
399 | 415 | |
400 | 416 | $query = "UPDATE `config` SET `value` = '11' WHERE `name` = 'schema_version'"; |
401 | 417 | try { |
@@ -469,19 +485,33 @@ discard block |
||
469 | 485 | $error = ''; |
470 | 486 | // Add tables |
471 | 487 | $error .= create_db::import_file('../db/stats.sql'); |
472 | - if ($error != '') return $error; |
|
488 | + if ($error != '') { |
|
489 | + return $error; |
|
490 | + } |
|
473 | 491 | $error .= create_db::import_file('../db/stats_aircraft.sql'); |
474 | - if ($error != '') return $error; |
|
492 | + if ($error != '') { |
|
493 | + return $error; |
|
494 | + } |
|
475 | 495 | $error .= create_db::import_file('../db/stats_airline.sql'); |
476 | - if ($error != '') return $error; |
|
496 | + if ($error != '') { |
|
497 | + return $error; |
|
498 | + } |
|
477 | 499 | $error .= create_db::import_file('../db/stats_airport.sql'); |
478 | - if ($error != '') return $error; |
|
500 | + if ($error != '') { |
|
501 | + return $error; |
|
502 | + } |
|
479 | 503 | $error .= create_db::import_file('../db/stats_owner.sql'); |
480 | - if ($error != '') return $error; |
|
504 | + if ($error != '') { |
|
505 | + return $error; |
|
506 | + } |
|
481 | 507 | $error .= create_db::import_file('../db/stats_pilot.sql'); |
482 | - if ($error != '') return $error; |
|
508 | + if ($error != '') { |
|
509 | + return $error; |
|
510 | + } |
|
483 | 511 | $error .= create_db::import_file('../db/spotter_archive_output.sql'); |
484 | - if ($error != '') return $error; |
|
512 | + if ($error != '') { |
|
513 | + return $error; |
|
514 | + } |
|
485 | 515 | |
486 | 516 | $query = "UPDATE `config` SET `value` = '13' WHERE `name` = 'schema_version'"; |
487 | 517 | try { |
@@ -521,7 +551,9 @@ discard block |
||
521 | 551 | // Add tables |
522 | 552 | if (!$Connection->tableExists('stats_flight')) { |
523 | 553 | $error .= create_db::import_file('../db/stats_flight.sql'); |
524 | - if ($error != '') return $error; |
|
554 | + if ($error != '') { |
|
555 | + return $error; |
|
556 | + } |
|
525 | 557 | } |
526 | 558 | $query = "UPDATE `config` SET `value` = '15' WHERE `name` = 'schema_version'"; |
527 | 559 | try { |
@@ -545,7 +577,9 @@ discard block |
||
545 | 577 | } catch(PDOException $e) { |
546 | 578 | return "error (update stats) : ".$e->getMessage()."\n"; |
547 | 579 | } |
548 | - if ($error != '') return $error; |
|
580 | + if ($error != '') { |
|
581 | + return $error; |
|
582 | + } |
|
549 | 583 | $query = "UPDATE `config` SET `value` = '16' WHERE `name` = 'schema_version'"; |
550 | 584 | try { |
551 | 585 | $sth = $Connection->db->prepare($query); |
@@ -566,7 +600,9 @@ discard block |
||
566 | 600 | if (!$Connection->tableExists('stats_callsign')) { |
567 | 601 | $error .= create_db::import_file('../db/stats_callsign.sql'); |
568 | 602 | } |
569 | - if ($error != '') return $error; |
|
603 | + if ($error != '') { |
|
604 | + return $error; |
|
605 | + } |
|
570 | 606 | $query = "UPDATE `config` SET `value` = '17' WHERE `name` = 'schema_version'"; |
571 | 607 | try { |
572 | 608 | $sth = $Connection->db->prepare($query); |
@@ -584,7 +620,9 @@ discard block |
||
584 | 620 | if (!$Connection->tableExists('stats_country')) { |
585 | 621 | $error .= create_db::import_file('../db/stats_country.sql'); |
586 | 622 | } |
587 | - if ($error != '') return $error; |
|
623 | + if ($error != '') { |
|
624 | + return $error; |
|
625 | + } |
|
588 | 626 | $query = "UPDATE `config` SET `value` = '18' WHERE `name` = 'schema_version'"; |
589 | 627 | try { |
590 | 628 | $sth = $Connection->db->prepare($query); |
@@ -607,7 +645,9 @@ discard block |
||
607 | 645 | return "error (update stats) : ".$e->getMessage()."\n"; |
608 | 646 | } |
609 | 647 | } |
610 | - if ($error != '') return $error; |
|
648 | + if ($error != '') { |
|
649 | + return $error; |
|
650 | + } |
|
611 | 651 | $query = "UPDATE `config` SET `value` = '19' WHERE `name` = 'schema_version'"; |
612 | 652 | try { |
613 | 653 | $sth = $Connection->db->prepare($query); |
@@ -623,7 +663,9 @@ discard block |
||
623 | 663 | $error = ''; |
624 | 664 | // Update airport table |
625 | 665 | $error .= create_db::import_file('../db/airport.sql'); |
626 | - if ($error != '') return 'Import airport.sql : '.$error; |
|
666 | + if ($error != '') { |
|
667 | + return 'Import airport.sql : '.$error; |
|
668 | + } |
|
627 | 669 | // Remove primary key on Spotter_Archive |
628 | 670 | $query = "alter table spotter_archive drop spotter_archive_id"; |
629 | 671 | try { |
@@ -699,7 +741,9 @@ discard block |
||
699 | 741 | return "error (add source_name column) : ".$e->getMessage()."\n"; |
700 | 742 | } |
701 | 743 | } |
702 | - if ($error != '') return $error; |
|
744 | + if ($error != '') { |
|
745 | + return $error; |
|
746 | + } |
|
703 | 747 | $query = "UPDATE `config` SET `value` = '20' WHERE `name` = 'schema_version'"; |
704 | 748 | try { |
705 | 749 | $sth = $Connection->db->prepare($query); |
@@ -717,7 +761,9 @@ discard block |
||
717 | 761 | // Update airline table |
718 | 762 | if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
719 | 763 | $error .= create_db::import_file('../db/airlines.sql'); |
720 | - if ($error != '') return 'Import airlines.sql : '.$error; |
|
764 | + if ($error != '') { |
|
765 | + return 'Import airlines.sql : '.$error; |
|
766 | + } |
|
721 | 767 | } |
722 | 768 | if (!$Connection->checkColumnName('aircraft_modes','type_flight')) { |
723 | 769 | // Add column over_country |
@@ -729,7 +775,9 @@ discard block |
||
729 | 775 | return "error (add over_country) : ".$e->getMessage()."\n"; |
730 | 776 | } |
731 | 777 | } |
732 | - if ($error != '') return $error; |
|
778 | + if ($error != '') { |
|
779 | + return $error; |
|
780 | + } |
|
733 | 781 | /* |
734 | 782 | if (!$globalIVAO && !$globalVATSIM && !$globalphpVMS) { |
735 | 783 | // Force update ModeS (this will put type_flight data |
@@ -759,7 +807,9 @@ discard block |
||
759 | 807 | } catch(PDOException $e) { |
760 | 808 | return "error (rename type to stats_type on stats*) : ".$e->getMessage()."\n"; |
761 | 809 | } |
762 | - if ($error != '') return $error; |
|
810 | + if ($error != '') { |
|
811 | + return $error; |
|
812 | + } |
|
763 | 813 | } |
764 | 814 | $query = "UPDATE `config` SET `value` = '22' WHERE `name` = 'schema_version'"; |
765 | 815 | try { |
@@ -782,7 +832,9 @@ discard block |
||
782 | 832 | } else { |
783 | 833 | $error .= create_db::import_file('../db/pgsql/stats_source.sql'); |
784 | 834 | } |
785 | - if ($error != '') return $error; |
|
835 | + if ($error != '') { |
|
836 | + return $error; |
|
837 | + } |
|
786 | 838 | } |
787 | 839 | $query = "UPDATE config SET value = '23' WHERE name = 'schema_version'"; |
788 | 840 | try { |
@@ -804,12 +856,16 @@ discard block |
||
804 | 856 | if ($globalDBdriver == 'mysql') { |
805 | 857 | if (!$Connection->tableExists('tle')) { |
806 | 858 | $error .= create_db::import_file('../db/tle.sql'); |
807 | - if ($error != '') return $error; |
|
859 | + if ($error != '') { |
|
860 | + return $error; |
|
861 | + } |
|
808 | 862 | } |
809 | 863 | } else { |
810 | 864 | if (!$Connection->tableExists('tle')) { |
811 | 865 | $error .= create_db::import_file('../db/pgsql/tle.sql'); |
812 | - if ($error != '') return $error; |
|
866 | + if ($error != '') { |
|
867 | + return $error; |
|
868 | + } |
|
813 | 869 | } |
814 | 870 | $query = "create index flightaware_id_idx ON spotter_archive USING btree(flightaware_id)"; |
815 | 871 | try { |
@@ -849,7 +905,9 @@ discard block |
||
849 | 905 | } else { |
850 | 906 | $error .= create_db::import_file('../db/pgsql/airlines.sql'); |
851 | 907 | } |
852 | - if ($error != '') return 'Import airlines.sql : '.$error; |
|
908 | + if ($error != '') { |
|
909 | + return 'Import airlines.sql : '.$error; |
|
910 | + } |
|
853 | 911 | if (!$Connection->checkColumnName('airlines','forsource')) { |
854 | 912 | // Add forsource to airlines |
855 | 913 | $query = "ALTER TABLE airlines ADD forsource VARCHAR(255) NULL DEFAULT NULL"; |
@@ -1171,8 +1229,11 @@ discard block |
||
1171 | 1229 | if ($Connection->tableExists('aircraft')) { |
1172 | 1230 | if (!$Connection->tableExists('config')) { |
1173 | 1231 | $version = '1'; |
1174 | - if ($update) return self::update_from_1(); |
|
1175 | - else return $version; |
|
1232 | + if ($update) { |
|
1233 | + return self::update_from_1(); |
|
1234 | + } else { |
|
1235 | + return $version; |
|
1236 | + } |
|
1176 | 1237 | } else { |
1177 | 1238 | $Connection = new Connection(); |
1178 | 1239 | $query = "SELECT value FROM config WHERE name = 'schema_version' LIMIT 1"; |
@@ -1186,114 +1247,197 @@ discard block |
||
1186 | 1247 | if ($update) { |
1187 | 1248 | if ($result['value'] == '2') { |
1188 | 1249 | $error = self::update_from_2(); |
1189 | - if ($error != '') return $error; |
|
1190 | - else return self::check_version(true); |
|
1250 | + if ($error != '') { |
|
1251 | + return $error; |
|
1252 | + } else { |
|
1253 | + return self::check_version(true); |
|
1254 | + } |
|
1191 | 1255 | } elseif ($result['value'] == '3') { |
1192 | 1256 | $error = self::update_from_3(); |
1193 | - if ($error != '') return $error; |
|
1194 | - else return self::check_version(true); |
|
1257 | + if ($error != '') { |
|
1258 | + return $error; |
|
1259 | + } else { |
|
1260 | + return self::check_version(true); |
|
1261 | + } |
|
1195 | 1262 | } elseif ($result['value'] == '4') { |
1196 | 1263 | $error = self::update_from_4(); |
1197 | - if ($error != '') return $error; |
|
1198 | - else return self::check_version(true); |
|
1264 | + if ($error != '') { |
|
1265 | + return $error; |
|
1266 | + } else { |
|
1267 | + return self::check_version(true); |
|
1268 | + } |
|
1199 | 1269 | } elseif ($result['value'] == '5') { |
1200 | 1270 | $error = self::update_from_5(); |
1201 | - if ($error != '') return $error; |
|
1202 | - else return self::check_version(true); |
|
1271 | + if ($error != '') { |
|
1272 | + return $error; |
|
1273 | + } else { |
|
1274 | + return self::check_version(true); |
|
1275 | + } |
|
1203 | 1276 | } elseif ($result['value'] == '6') { |
1204 | 1277 | $error = self::update_from_6(); |
1205 | - if ($error != '') return $error; |
|
1206 | - else return self::check_version(true); |
|
1278 | + if ($error != '') { |
|
1279 | + return $error; |
|
1280 | + } else { |
|
1281 | + return self::check_version(true); |
|
1282 | + } |
|
1207 | 1283 | } elseif ($result['value'] == '7') { |
1208 | 1284 | $error = self::update_from_7(); |
1209 | - if ($error != '') return $error; |
|
1210 | - else return self::check_version(true); |
|
1285 | + if ($error != '') { |
|
1286 | + return $error; |
|
1287 | + } else { |
|
1288 | + return self::check_version(true); |
|
1289 | + } |
|
1211 | 1290 | } elseif ($result['value'] == '8') { |
1212 | 1291 | $error = self::update_from_8(); |
1213 | - if ($error != '') return $error; |
|
1214 | - else return self::check_version(true); |
|
1292 | + if ($error != '') { |
|
1293 | + return $error; |
|
1294 | + } else { |
|
1295 | + return self::check_version(true); |
|
1296 | + } |
|
1215 | 1297 | } elseif ($result['value'] == '9') { |
1216 | 1298 | $error = self::update_from_9(); |
1217 | - if ($error != '') return $error; |
|
1218 | - else return self::check_version(true); |
|
1299 | + if ($error != '') { |
|
1300 | + return $error; |
|
1301 | + } else { |
|
1302 | + return self::check_version(true); |
|
1303 | + } |
|
1219 | 1304 | } elseif ($result['value'] == '10') { |
1220 | 1305 | $error = self::update_from_10(); |
1221 | - if ($error != '') return $error; |
|
1222 | - else return self::check_version(true); |
|
1306 | + if ($error != '') { |
|
1307 | + return $error; |
|
1308 | + } else { |
|
1309 | + return self::check_version(true); |
|
1310 | + } |
|
1223 | 1311 | } elseif ($result['value'] == '11') { |
1224 | 1312 | $error = self::update_from_11(); |
1225 | - if ($error != '') return $error; |
|
1226 | - else return self::check_version(true); |
|
1313 | + if ($error != '') { |
|
1314 | + return $error; |
|
1315 | + } else { |
|
1316 | + return self::check_version(true); |
|
1317 | + } |
|
1227 | 1318 | } elseif ($result['value'] == '12') { |
1228 | 1319 | $error = self::update_from_12(); |
1229 | - if ($error != '') return $error; |
|
1230 | - else return self::check_version(true); |
|
1320 | + if ($error != '') { |
|
1321 | + return $error; |
|
1322 | + } else { |
|
1323 | + return self::check_version(true); |
|
1324 | + } |
|
1231 | 1325 | } elseif ($result['value'] == '13') { |
1232 | 1326 | $error = self::update_from_13(); |
1233 | - if ($error != '') return $error; |
|
1234 | - else return self::check_version(true); |
|
1327 | + if ($error != '') { |
|
1328 | + return $error; |
|
1329 | + } else { |
|
1330 | + return self::check_version(true); |
|
1331 | + } |
|
1235 | 1332 | } elseif ($result['value'] == '14') { |
1236 | 1333 | $error = self::update_from_14(); |
1237 | - if ($error != '') return $error; |
|
1238 | - else return self::check_version(true); |
|
1334 | + if ($error != '') { |
|
1335 | + return $error; |
|
1336 | + } else { |
|
1337 | + return self::check_version(true); |
|
1338 | + } |
|
1239 | 1339 | } elseif ($result['value'] == '15') { |
1240 | 1340 | $error = self::update_from_15(); |
1241 | - if ($error != '') return $error; |
|
1242 | - else return self::check_version(true); |
|
1341 | + if ($error != '') { |
|
1342 | + return $error; |
|
1343 | + } else { |
|
1344 | + return self::check_version(true); |
|
1345 | + } |
|
1243 | 1346 | } elseif ($result['value'] == '16') { |
1244 | 1347 | $error = self::update_from_16(); |
1245 | - if ($error != '') return $error; |
|
1246 | - else return self::check_version(true); |
|
1348 | + if ($error != '') { |
|
1349 | + return $error; |
|
1350 | + } else { |
|
1351 | + return self::check_version(true); |
|
1352 | + } |
|
1247 | 1353 | } elseif ($result['value'] == '17') { |
1248 | 1354 | $error = self::update_from_17(); |
1249 | - if ($error != '') return $error; |
|
1250 | - else return self::check_version(true); |
|
1355 | + if ($error != '') { |
|
1356 | + return $error; |
|
1357 | + } else { |
|
1358 | + return self::check_version(true); |
|
1359 | + } |
|
1251 | 1360 | } elseif ($result['value'] == '18') { |
1252 | 1361 | $error = self::update_from_18(); |
1253 | - if ($error != '') return $error; |
|
1254 | - else return self::check_version(true); |
|
1362 | + if ($error != '') { |
|
1363 | + return $error; |
|
1364 | + } else { |
|
1365 | + return self::check_version(true); |
|
1366 | + } |
|
1255 | 1367 | } elseif ($result['value'] == '19') { |
1256 | 1368 | $error = self::update_from_19(); |
1257 | - if ($error != '') return $error; |
|
1258 | - else return self::check_version(true); |
|
1369 | + if ($error != '') { |
|
1370 | + return $error; |
|
1371 | + } else { |
|
1372 | + return self::check_version(true); |
|
1373 | + } |
|
1259 | 1374 | } elseif ($result['value'] == '20') { |
1260 | 1375 | $error = self::update_from_20(); |
1261 | - if ($error != '') return $error; |
|
1262 | - else return self::check_version(true); |
|
1376 | + if ($error != '') { |
|
1377 | + return $error; |
|
1378 | + } else { |
|
1379 | + return self::check_version(true); |
|
1380 | + } |
|
1263 | 1381 | } elseif ($result['value'] == '21') { |
1264 | 1382 | $error = self::update_from_21(); |
1265 | - if ($error != '') return $error; |
|
1266 | - else return self::check_version(true); |
|
1383 | + if ($error != '') { |
|
1384 | + return $error; |
|
1385 | + } else { |
|
1386 | + return self::check_version(true); |
|
1387 | + } |
|
1267 | 1388 | } elseif ($result['value'] == '22') { |
1268 | 1389 | $error = self::update_from_22(); |
1269 | - if ($error != '') return $error; |
|
1270 | - else return self::check_version(true); |
|
1390 | + if ($error != '') { |
|
1391 | + return $error; |
|
1392 | + } else { |
|
1393 | + return self::check_version(true); |
|
1394 | + } |
|
1271 | 1395 | } elseif ($result['value'] == '23') { |
1272 | 1396 | $error = self::update_from_23(); |
1273 | - if ($error != '') return $error; |
|
1274 | - else return self::check_version(true); |
|
1397 | + if ($error != '') { |
|
1398 | + return $error; |
|
1399 | + } else { |
|
1400 | + return self::check_version(true); |
|
1401 | + } |
|
1275 | 1402 | } elseif ($result['value'] == '24') { |
1276 | 1403 | $error = self::update_from_24(); |
1277 | - if ($error != '') return $error; |
|
1278 | - else return self::check_version(true); |
|
1404 | + if ($error != '') { |
|
1405 | + return $error; |
|
1406 | + } else { |
|
1407 | + return self::check_version(true); |
|
1408 | + } |
|
1279 | 1409 | } elseif ($result['value'] == '25') { |
1280 | 1410 | $error = self::update_from_25(); |
1281 | - if ($error != '') return $error; |
|
1282 | - else return self::check_version(true); |
|
1411 | + if ($error != '') { |
|
1412 | + return $error; |
|
1413 | + } else { |
|
1414 | + return self::check_version(true); |
|
1415 | + } |
|
1283 | 1416 | } elseif ($result['value'] == '26') { |
1284 | 1417 | $error = self::update_from_26(); |
1285 | - if ($error != '') return $error; |
|
1286 | - else return self::check_version(true); |
|
1418 | + if ($error != '') { |
|
1419 | + return $error; |
|
1420 | + } else { |
|
1421 | + return self::check_version(true); |
|
1422 | + } |
|
1287 | 1423 | } elseif ($result['value'] == '27') { |
1288 | 1424 | $error = self::update_from_27(); |
1289 | - if ($error != '') return $error; |
|
1290 | - else return self::check_version(true); |
|
1291 | - } else return ''; |
|
1425 | + if ($error != '') { |
|
1426 | + return $error; |
|
1427 | + } else { |
|
1428 | + return self::check_version(true); |
|
1429 | + } |
|
1430 | + } else { |
|
1431 | + return ''; |
|
1432 | + } |
|
1433 | + } else { |
|
1434 | + return $result['value']; |
|
1292 | 1435 | } |
1293 | - else return $result['value']; |
|
1294 | 1436 | } |
1295 | 1437 | |
1296 | - } else return $version; |
|
1438 | + } else { |
|
1439 | + return $version; |
|
1440 | + } |
|
1297 | 1441 | } |
1298 | 1442 | |
1299 | 1443 | } |