@@ -96,8 +96,11 @@ |
||
| 96 | 96 | } elseif (isset($_GET['marine'])) { |
| 97 | 97 | readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/vehicules/'.$filename); |
| 98 | 98 | } else { |
| 99 | - if ($color == 'FF0000') readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 100 | - else readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 99 | + if ($color == 'FF0000') { |
|
| 100 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/selected/'.$filename); |
|
| 101 | + } else { |
|
| 102 | + readfile(dirname(__FILE__).DIRECTORY_SEPARATOR.'images/aircrafts/'.$filename); |
|
| 103 | + } |
|
| 101 | 104 | } |
| 102 | 105 | } |
| 103 | 106 | ?> |
| 104 | 107 | \ No newline at end of file |
@@ -63,7 +63,9 @@ |
||
| 63 | 63 | { |
| 64 | 64 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 65 | 65 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 66 | - } else $image = $spotter_item['image_thumbnail']; |
|
| 66 | + } else { |
|
| 67 | + $image = $spotter_item['image_thumbnail']; |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | } |
| 69 | 71 | /* else { |
@@ -63,7 +63,9 @@ |
||
| 63 | 63 | { |
| 64 | 64 | if ($spotter_item['image_source'] == 'flickr' || $spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart') { |
| 65 | 65 | $image = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
| 66 | - } else $image = $spotter_item['image_thumbnail']; |
|
| 66 | + } else { |
|
| 67 | + $image = $spotter_item['image_thumbnail']; |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | } |
| 69 | 71 | /* else { |
@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once(dirname(__FILE__).'/require/settings.php'); |
| 3 | 3 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 4 | -if ($date == '') $date = date('Y-m-d'); |
|
| 4 | +if ($date == '') { |
|
| 5 | + $date = date('Y-m-d'); |
|
| 6 | +} |
|
| 5 | 7 | header('Location: '.$globalURL.'/accident/'.$date); |
| 6 | 8 | ?> |
| 7 | 9 | \ No newline at end of file |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Route by Waypoint"); |
| 7 | 7 | require_once('header.php'); |
| 8 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 8 | +if (!isset($filter_name)) { |
|
| 9 | + $filter_name = ''; |
|
| 10 | +} |
|
| 9 | 11 | include('statistics-sub-menu.php'); |
| 10 | 12 | |
| 11 | 13 | print '<div class="info"> |
@@ -5,7 +5,9 @@ |
||
| 5 | 5 | $Spotter = new Spotter(); |
| 6 | 6 | $title = _("Statistics").' - '._("Most common Route by Airport"); |
| 7 | 7 | require_once('header.php'); |
| 8 | -if (!isset($filter_name)) $filter_name = ''; |
|
| 8 | +if (!isset($filter_name)) { |
|
| 9 | + $filter_name = ''; |
|
| 10 | +} |
|
| 9 | 11 | include('statistics-sub-menu.php'); |
| 10 | 12 | |
| 11 | 13 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | require_once(dirname(__FILE__).'/require/settings.php'); |
| 3 | 3 | $date = filter_input(INPUT_POST,'date',FILTER_SANITIZE_STRING); |
| 4 | -if ($date == '') $date = date('Y-m-d'); |
|
| 4 | +if ($date == '') { |
|
| 5 | + $date = date('Y-m-d'); |
|
| 6 | +} |
|
| 5 | 7 | header('Location: '.$globalURL.'/incident/'.$date); |
| 6 | 8 | ?> |
| 7 | 9 | \ No newline at end of file |
@@ -5,8 +5,11 @@ discard block |
||
| 5 | 5 | setcookie("MapFormat",'2d'); |
| 6 | 6 | |
| 7 | 7 | // Compressed GeoJson is used if true |
| 8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
| 9 | -else $compress = $globalJsonCompress; |
|
| 8 | +if (!isset($globalJsonCompress)) { |
|
| 9 | + $compress = true; |
|
| 10 | +} else { |
|
| 11 | + $compress = $globalJsonCompress; |
|
| 12 | +} |
|
| 10 | 13 | ?> |
| 11 | 14 | |
| 12 | 15 | |
@@ -142,9 +145,13 @@ discard block |
||
| 142 | 145 | if (callsign != ""){ markerMarineLabel += callsign; } |
| 143 | 146 | if (type != ""){ markerMarineLabel += ' - '+type; } |
| 144 | 147 | <?php |
| 145 | - if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
| 146 | - elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor; |
|
| 147 | - else $MarineIconColor = '1a3151'; |
|
| 148 | + if (isset($_COOKIE['MarineIconColor'])) { |
|
| 149 | + $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
| 150 | + } elseif (isset($globalMarineIconColor)) { |
|
| 151 | + $MarineIconColor = $globalMarineIconColor; |
|
| 152 | + } else { |
|
| 153 | + $MarineIconColor = '1a3151'; |
|
| 154 | + } |
|
| 148 | 155 | if (!isset($ident) && !isset($fammarine_id)) { |
| 149 | 156 | ?> |
| 150 | 157 | info_marine_update(feature.properties.fc); |
@@ -179,7 +186,12 @@ discard block |
||
| 179 | 186 | <?php |
| 180 | 187 | } else { |
| 181 | 188 | ?> |
| 182 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 189 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 190 | + print $archiveupdatetime*1000; |
|
| 191 | +} else { |
|
| 192 | + print $globalMapRefresh*1000+20000; |
|
| 193 | +} |
|
| 194 | +?>+feature.properties.sqt*1000); |
|
| 183 | 195 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 184 | 196 | <?php |
| 185 | 197 | } |
@@ -228,7 +240,12 @@ discard block |
||
| 228 | 240 | <?php |
| 229 | 241 | } else { |
| 230 | 242 | ?> |
| 231 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 243 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 244 | + print $archiveupdatetime*1000; |
|
| 245 | +} else { |
|
| 246 | + print $globalMapRefresh*1000+20000; |
|
| 247 | +} |
|
| 248 | +?>+feature.properties.sqt*1000); |
|
| 232 | 249 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 233 | 250 | <?php |
| 234 | 251 | } |
@@ -276,7 +293,12 @@ discard block |
||
| 276 | 293 | <?php |
| 277 | 294 | } else { |
| 278 | 295 | ?> |
| 279 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
| 296 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
| 297 | + print $archiveupdatetime*1000; |
|
| 298 | +} else { |
|
| 299 | + print $globalMapRefresh*1000+20000; |
|
| 300 | +} |
|
| 301 | +?>+feature.properties.sqt*1000); |
|
| 280 | 302 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
| 281 | 303 | <?php |
| 282 | 304 | } |
@@ -559,14 +581,24 @@ discard block |
||
| 559 | 581 | if (isset($archive) && $archive) { |
| 560 | 582 | ?> |
| 561 | 583 | //then load it again every 30 seconds |
| 562 | -// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
| 584 | +// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
| 585 | + print ($globalMapRefresh*1000)/2; |
|
| 586 | +} else { |
|
| 587 | + print '15000'; |
|
| 588 | +} |
|
| 589 | +?>); |
|
| 563 | 590 | reloadMarinePage = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php print $archiveupdatetime*1000; ?>); |
| 564 | 591 | <?php |
| 565 | 592 | } else { |
| 566 | 593 | ?> |
| 567 | 594 | //then load it again every 30 seconds |
| 568 | 595 | reloadMarinePage = setInterval( |
| 569 | - function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
| 596 | + function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
| 597 | + print $globalMapRefresh*1000; |
|
| 598 | +} else { |
|
| 599 | + print '30000'; |
|
| 600 | +} |
|
| 601 | +?>); |
|
| 570 | 602 | <?php |
| 571 | 603 | } |
| 572 | 604 | ?> |
@@ -29,7 +29,9 @@ discard block |
||
| 29 | 29 | if (isset($filter[0]['source'])) { |
| 30 | 30 | $filters = array_merge($filters,$filter); |
| 31 | 31 | } |
| 32 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
| 32 | + if (is_array($globalFilter)) { |
|
| 33 | + $filter = array_merge($filter,$globalFilter); |
|
| 34 | + } |
|
| 33 | 35 | $filter_query_join = ''; |
| 34 | 36 | $filter_query_where = ''; |
| 35 | 37 | foreach($filters as $flt) { |
@@ -76,8 +78,11 @@ discard block |
||
| 76 | 78 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
| 77 | 79 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
| 78 | 80 | } |
| 79 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
| 80 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
| 81 | + if ($filter_query_where == '' && $where) { |
|
| 82 | + $filter_query_where = ' WHERE'; |
|
| 83 | + } elseif ($filter_query_where != '' && $and) { |
|
| 84 | + $filter_query_where .= ' AND'; |
|
| 85 | + } |
|
| 81 | 86 | if ($filter_query_where != '') { |
| 82 | 87 | $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
| 83 | 88 | } |
@@ -118,9 +123,13 @@ discard block |
||
| 118 | 123 | $orderby_query = ' '.$search_orderby_array[$sort]['sql']; |
| 119 | 124 | } |
| 120 | 125 | } |
| 121 | - if ($orderby_query == '') $orderby_query= ' ORDER BY date DESC'; |
|
| 126 | + if ($orderby_query == '') { |
|
| 127 | + $orderby_query= ' ORDER BY date DESC'; |
|
| 128 | + } |
|
| 122 | 129 | |
| 123 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 130 | + if (!isset($globalLiveInterval)) { |
|
| 131 | + $globalLiveInterval = '200'; |
|
| 132 | + } |
|
| 124 | 133 | if ($globalDBdriver == 'mysql') { |
| 125 | 134 | //$query = "SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL 30 SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate"; |
| 126 | 135 | $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query.$orderby_query; |
@@ -145,7 +154,9 @@ discard block |
||
| 145 | 154 | |
| 146 | 155 | $filter_query = $this->getFilter($filter,true,true); |
| 147 | 156 | |
| 148 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 157 | + if (!isset($globalLiveInterval)) { |
|
| 158 | + $globalLiveInterval = '200'; |
|
| 159 | + } |
|
| 149 | 160 | if ($globalDBdriver == 'mysql') { |
| 150 | 161 | $query = 'SELECT marine_live.mmsi, marine_live.ident, marine_live.type,marine_live.fammarine_id, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 151 | 162 | FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate'.$filter_query." marine_live.latitude <> 0 AND marine_live.longitude <> 0"; |
@@ -179,7 +190,9 @@ discard block |
||
| 179 | 190 | |
| 180 | 191 | $filter_query = $this->getFilter($filter,true,true); |
| 181 | 192 | |
| 182 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 193 | + if (!isset($globalLiveInterval)) { |
|
| 194 | + $globalLiveInterval = '200'; |
|
| 195 | + } |
|
| 183 | 196 | if ($globalDBdriver == 'mysql') { |
| 184 | 197 | $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 185 | 198 | FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' |
@@ -212,7 +225,9 @@ discard block |
||
| 212 | 225 | global $globalDBdriver, $globalLiveInterval; |
| 213 | 226 | $filter_query = $this->getFilter($filter,true,true); |
| 214 | 227 | |
| 215 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 228 | + if (!isset($globalLiveInterval)) { |
|
| 229 | + $globalLiveInterval = '200'; |
|
| 230 | + } |
|
| 216 | 231 | if ($globalDBdriver == 'mysql') { |
| 217 | 232 | $query = 'SELECT COUNT(DISTINCT marine_live.fammarine_id) as nb FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
| 218 | 233 | } else { |
@@ -240,7 +255,9 @@ discard block |
||
| 240 | 255 | { |
| 241 | 256 | global $globalDBdriver, $globalLiveInterval; |
| 242 | 257 | $Spotter = new Spotter($this->db); |
| 243 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 258 | + if (!isset($globalLiveInterval)) { |
|
| 259 | + $globalLiveInterval = '200'; |
|
| 260 | + } |
|
| 244 | 261 | $filter_query = $this->getFilter($filter); |
| 245 | 262 | |
| 246 | 263 | if (is_array($coord)) { |
@@ -248,7 +265,9 @@ discard block |
||
| 248 | 265 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 249 | 266 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 250 | 267 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 251 | - } else return array(); |
|
| 268 | + } else { |
|
| 269 | + return array(); |
|
| 270 | + } |
|
| 252 | 271 | if ($globalDBdriver == 'mysql') { |
| 253 | 272 | $query = 'SELECT marine_live.* FROM marine_live INNER JOIN (SELECT l.fammarine_id, max(l.date) as maxdate FROM marine_live l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.fammarine_id) s on marine_live.fammarine_id = s.fammarine_id AND marine_live.date = s.maxdate AND marine_live.latitude BETWEEN '.$minlat.' AND '.$maxlat.' AND marine_live.longitude BETWEEN '.$minlong.' AND '.$maxlong.' GROUP BY marine_live.fammarine_id'.$filter_query; |
| 254 | 273 | } else { |
@@ -268,7 +287,9 @@ discard block |
||
| 268 | 287 | { |
| 269 | 288 | global $globalDBdriver, $globalLiveInterval; |
| 270 | 289 | $Spotter = new Spotter($this->db); |
| 271 | - if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
| 290 | + if (!isset($globalLiveInterval)) { |
|
| 291 | + $globalLiveInterval = '200'; |
|
| 292 | + } |
|
| 272 | 293 | $filter_query = $this->getFilter($filter); |
| 273 | 294 | |
| 274 | 295 | if (is_array($coord)) { |
@@ -276,7 +297,9 @@ discard block |
||
| 276 | 297 | $minlat = filter_var($coord[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 277 | 298 | $maxlong = filter_var($coord[2],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 278 | 299 | $maxlat = filter_var($coord[3],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
| 279 | - } else return array(); |
|
| 300 | + } else { |
|
| 301 | + return array(); |
|
| 302 | + } |
|
| 280 | 303 | if ($globalDBdriver == 'mysql') { |
| 281 | 304 | $query = 'SELECT marine_live.ident, marine_live.fammarine_id,marine_live.type, marine_live.latitude, marine_live.longitude, marine_live.heading, marine_live.ground_speed, marine_live.date, marine_live.format_source |
| 282 | 305 | FROM marine_live'.$filter_query.' DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval." SECOND) <= marine_live.date AND marine_live.latitude <> '0' AND marine_live.longitude <> '0' AND marine_live.latitude BETWEEN ".$minlat.' AND '.$maxlat.' AND marine_live.longitude BETWEEN '.$minlong.' AND '.$maxlong." |
@@ -444,11 +467,15 @@ discard block |
||
| 444 | 467 | //$query = self::$global_query.' WHERE marine_live.fammarine_id = :id ORDER BY date'; |
| 445 | 468 | if ($globalDBdriver == 'mysql') { |
| 446 | 469 | $query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id'; |
| 447 | - if ($liveinterval) $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
| 470 | + if ($liveinterval) { |
|
| 471 | + $query .= ' AND DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= date'; |
|
| 472 | + } |
|
| 448 | 473 | $query .= ' ORDER BY date'; |
| 449 | 474 | } else { |
| 450 | 475 | $query = 'SELECT marine_live.* FROM marine_live WHERE marine_live.fammarine_id = :id'; |
| 451 | - if ($liveinterval) $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
| 476 | + if ($liveinterval) { |
|
| 477 | + $query .= " AND CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalLiveInterval." SECONDS' <= date"; |
|
| 478 | + } |
|
| 452 | 479 | $query .= ' ORDER BY date'; |
| 453 | 480 | } |
| 454 | 481 | |
@@ -543,7 +570,9 @@ discard block |
||
| 543 | 570 | $i++; |
| 544 | 571 | $j++; |
| 545 | 572 | if ($j == 30) { |
| 546 | - if ($globalDebug) echo "."; |
|
| 573 | + if ($globalDebug) { |
|
| 574 | + echo "."; |
|
| 575 | + } |
|
| 547 | 576 | try { |
| 548 | 577 | |
| 549 | 578 | $sth = $this->db->prepare(substr($query_delete,0,-1).")"); |
@@ -823,7 +852,9 @@ discard block |
||
| 823 | 852 | { |
| 824 | 853 | return false; |
| 825 | 854 | } |
| 826 | - } else return ''; |
|
| 855 | + } else { |
|
| 856 | + return ''; |
|
| 857 | + } |
|
| 827 | 858 | |
| 828 | 859 | if ($longitude != '') |
| 829 | 860 | { |
@@ -831,7 +862,9 @@ discard block |
||
| 831 | 862 | { |
| 832 | 863 | return false; |
| 833 | 864 | } |
| 834 | - } else return ''; |
|
| 865 | + } else { |
|
| 866 | + return ''; |
|
| 867 | + } |
|
| 835 | 868 | |
| 836 | 869 | |
| 837 | 870 | if ($heading != '') |
@@ -840,7 +873,9 @@ discard block |
||
| 840 | 873 | { |
| 841 | 874 | return false; |
| 842 | 875 | } |
| 843 | - } else $heading = 0; |
|
| 876 | + } else { |
|
| 877 | + $heading = 0; |
|
| 878 | + } |
|
| 844 | 879 | |
| 845 | 880 | if ($groundspeed != '') |
| 846 | 881 | { |
@@ -848,9 +883,13 @@ discard block |
||
| 848 | 883 | { |
| 849 | 884 | return false; |
| 850 | 885 | } |
| 851 | - } else $groundspeed = 0; |
|
| 886 | + } else { |
|
| 887 | + $groundspeed = 0; |
|
| 888 | + } |
|
| 852 | 889 | date_default_timezone_set('UTC'); |
| 853 | - if ($date == '') $date = date("Y-m-d H:i:s", time()); |
|
| 890 | + if ($date == '') { |
|
| 891 | + $date = date("Y-m-d H:i:s", time()); |
|
| 892 | + } |
|
| 854 | 893 | |
| 855 | 894 | |
| 856 | 895 | $fammarine_id = filter_var($fammarine_id,FILTER_SANITIZE_STRING); |
@@ -871,12 +910,20 @@ discard block |
||
| 871 | 910 | $arrival_date = filter_var($arrival_date,FILTER_SANITIZE_STRING); |
| 872 | 911 | |
| 873 | 912 | |
| 874 | - if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) $groundspeed = 0; |
|
| 875 | - if ($heading == '' || $Common->isInteger($heading) === false ) $heading = 0; |
|
| 876 | - if ($arrival_date == '') $arrival_date = NULL; |
|
| 913 | + if ($groundspeed == '' || $Common->isInteger($groundspeed) === false ) { |
|
| 914 | + $groundspeed = 0; |
|
| 915 | + } |
|
| 916 | + if ($heading == '' || $Common->isInteger($heading) === false ) { |
|
| 917 | + $heading = 0; |
|
| 918 | + } |
|
| 919 | + if ($arrival_date == '') { |
|
| 920 | + $arrival_date = NULL; |
|
| 921 | + } |
|
| 877 | 922 | $query = ''; |
| 878 | 923 | if ($globalArchive) { |
| 879 | - if ($globalDebug) echo '-- Delete previous data -- '; |
|
| 924 | + if ($globalDebug) { |
|
| 925 | + echo '-- Delete previous data -- '; |
|
| 926 | + } |
|
| 880 | 927 | $query .= 'DELETE FROM marine_live WHERE fammarine_id = :fammarine_id;'; |
| 881 | 928 | } |
| 882 | 929 | $query .= 'INSERT INTO marine_live (fammarine_id, ident, latitude, longitude, heading, ground_speed, date, format_source, source_name, over_country, mmsi, type,status,imo,arrival_port_name,arrival_port_date) |
@@ -891,10 +938,14 @@ discard block |
||
| 891 | 938 | } |
| 892 | 939 | |
| 893 | 940 | if (isset($globalArchive) && $globalArchive && $putinarchive && $noarchive !== true) { |
| 894 | - if ($globalDebug) echo '(Add to Marine archive : '; |
|
| 941 | + if ($globalDebug) { |
|
| 942 | + echo '(Add to Marine archive : '; |
|
| 943 | + } |
|
| 895 | 944 | $MarineArchive = new MarineArchive($this->db); |
| 896 | 945 | $result = $MarineArchive->addMarineArchiveData($fammarine_id, $ident, $latitude, $longitude, $heading, $groundspeed, $date, $putinarchive, $mmsi,$type,$typeid,$imo, $callsign,$arrival_code,$arrival_date,$status,$noarchive,$format_source, $source_name, $over_country); |
| 897 | - if ($globalDebug) echo $result.')'; |
|
| 946 | + if ($globalDebug) { |
|
| 947 | + echo $result.')'; |
|
| 948 | + } |
|
| 898 | 949 | } |
| 899 | 950 | return "success"; |
| 900 | 951 | } |