@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $Tracker = new Tracker(); |
17 | 17 | } |
18 | 18 | if (!isset($filter_name)) $filter_name = ''; |
19 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
19 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
20 | 20 | if ($airline_icao == '' && isset($globalFilter)) { |
21 | 21 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
22 | 22 | } |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | </div> |
33 | 33 | <p>'._("Below is a chart that plots the busiest day during the <strong>last month</strong>.").'</p>'; |
34 | 34 | |
35 | -if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao,$filter_name); |
|
35 | +if ($type == 'aircraft') $date_array = $Stats->countAllDatesLastMonth($airline_icao, $filter_name); |
|
36 | 36 | elseif ($type == 'marine') $date_array = $Marine->countAllDatesLastMonth(); |
37 | 37 | elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLastMonth(); |
38 | 38 | |
39 | 39 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
40 | 40 | $month_data = ''; |
41 | 41 | $month_cnt = ''; |
42 | -foreach($date_array as $month_item) |
|
42 | +foreach ($date_array as $month_item) |
|
43 | 43 | { |
44 | 44 | $month_data .= '"'.$month_item['date_name'].'",'; |
45 | 45 | $month_cnt .= $month_item['date_count'].','; |
46 | 46 | } |
47 | 47 | $month_data = "['x',".substr($month_data, 0, -1)."]"; |
48 | -$month_cnt = "['flights',".substr($month_cnt,0,-1)."]"; |
|
48 | +$month_cnt = "['flights',".substr($month_cnt, 0, -1)."]"; |
|
49 | 49 | print 'c3.generate({ |
50 | 50 | bindto: "#chart", |
51 | 51 | data: { x: "x", |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | //$date_array = $Stats->countAllDates(); |
57 | 57 | if (!empty($date_array)) |
58 | 58 | { |
59 | - foreach($date_array as $key => $row) { |
|
59 | + foreach ($date_array as $key => $row) { |
|
60 | 60 | $years[$key] = $row['date_name']; |
61 | 61 | $counts[$key] = $row['date_count']; |
62 | 62 | } |
63 | - array_multisort($counts,SORT_DESC,$date_array); |
|
63 | + array_multisort($counts, SORT_DESC, $date_array); |
|
64 | 64 | print '<div class="table-responsive">'; |
65 | 65 | print '<table class="common-date table-striped">'; |
66 | 66 | print '<thead>'; |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | print '</thead>'; |
71 | 71 | print '<tbody>'; |
72 | 72 | $i = 1; |
73 | - foreach($date_array as $date_item) |
|
73 | + foreach ($date_array as $date_item) |
|
74 | 74 | { |
75 | 75 | print '<tr>'; |
76 | 76 | print '<td><strong>'.$i.'</strong></td>'; |
77 | 77 | print '<td>'; |
78 | - if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
79 | - else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d',strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
78 | + if ($type == 'aircraft') print '<a href="'.$globalURL.'/date/'.date('Y-m-d', strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
79 | + else print '<a href="'.$globalURL.'/'.$type.'/date/'.date('Y-m-d', strtotime($date_item['date_name'])).'">'.date("l F j, Y", strtotime($date_item['date_name'])).'</a>'; |
|
80 | 80 | print '</td>'; |
81 | 81 | print '<td>'; |
82 | 82 | print $date_item['date_count']; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } else { |
20 | 20 | $title = _("Statistics").' - '._("Most common Country a flight was over"); |
21 | 21 | } |
22 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
22 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | 24 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
25 | 25 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | if ($type == 'aircraft') { |
51 | - $flightover_array = $Stats->countAllFlightOverCountries(false,$airline_icao,$filter_name); |
|
51 | + $flightover_array = $Stats->countAllFlightOverCountries(false, $airline_icao, $filter_name); |
|
52 | 52 | } elseif ($type == 'marine') { |
53 | 53 | $flightover_array = $Marine->countAllMarineOverCountries(); |
54 | 54 | } elseif ($type == 'tracker') { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
63 | 63 | print 'var series = ['; |
64 | 64 | $flightover_data = ''; |
65 | -foreach($flightover_array as $flightover_item) |
|
65 | +foreach ($flightover_array as $flightover_item) |
|
66 | 66 | { |
67 | 67 | $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
68 | 68 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | print '</thead>'; |
112 | 112 | print '<tbody>'; |
113 | 113 | $i = 1; |
114 | - array_splice($flightover_array,10); |
|
115 | - foreach($flightover_array as $flightover_item) |
|
114 | + array_splice($flightover_array, 10); |
|
115 | + foreach ($flightover_array as $flightover_item) |
|
116 | 116 | { |
117 | 117 | print '<tr>'; |
118 | 118 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | |
20 | 20 | if (!isset($filter_name)) $filter_name = ''; |
21 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
21 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
22 | 22 | if ($airline_icao == '' && isset($globalFilter)) { |
23 | 23 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
24 | 24 | } |
@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | </div> |
34 | 34 | <p>'._("Below is a chart that plots the busiest month during the <strong>last year</strong>.").'</p>'; |
35 | 35 | |
36 | -if ($type == 'aircraft') $date_array = $Stats->countAllMonthsLastYear(true,$airline_icao,$filter_name); |
|
36 | +if ($type == 'aircraft') $date_array = $Stats->countAllMonthsLastYear(true, $airline_icao, $filter_name); |
|
37 | 37 | elseif ($type == 'marine') $date_array = $Marine->countAllMonthsLastYear(true); |
38 | 38 | elseif ($type == 'tracker') $date_array = $Tracker->countAllMonthsLastYear(true); |
39 | 39 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
40 | 40 | $year_data = ''; |
41 | 41 | $year_cnt = ''; |
42 | -foreach($date_array as $year_item) |
|
42 | +foreach ($date_array as $year_item) |
|
43 | 43 | { |
44 | 44 | $year_data .= '"'.$year_item['year_name'].'-'.$year_item['month_name'].'-01'.'",'; |
45 | 45 | $year_cnt .= $year_item['date_count'].','; |
46 | 46 | } |
47 | 47 | $year_data = "['x',".substr($year_data, 0, -1)."]"; |
48 | -$year_cnt = "['flights',".substr($year_cnt,0,-1)."]"; |
|
48 | +$year_cnt = "['flights',".substr($year_cnt, 0, -1)."]"; |
|
49 | 49 | print 'c3.generate({ |
50 | 50 | bindto: "#chart", |
51 | 51 | data: { x: "x", |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | print '</thead>'; |
69 | 69 | print '<tbody>'; |
70 | 70 | $i = 1; |
71 | - foreach($date_array as $date_item) |
|
71 | + foreach ($date_array as $date_item) |
|
72 | 72 | { |
73 | 73 | print '<tr>'; |
74 | 74 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | if (!isset($filter_name)) $filter_name = ''; |
20 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
20 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
21 | 21 | if ($airline_icao == '' && isset($globalFilter)) { |
22 | 22 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
23 | 23 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | </div> |
34 | 34 | <p>'._("Below is a chart that plots the busiest day during the <strong>last 7 days</strong>.").'</p>'; |
35 | 35 | |
36 | -if ($type == 'aircraft') $date_array = $Stats->countAllDatesLast7Days($airline_icao,$filter_name); |
|
36 | +if ($type == 'aircraft') $date_array = $Stats->countAllDatesLast7Days($airline_icao, $filter_name); |
|
37 | 37 | elseif ($type == 'marine') $date_array = $Marine->countAllDatesLast7Days(); |
38 | 38 | elseif ($type == 'tracker') $date_array = $Tracker->countAllDatesLast7Days(); |
39 | 39 | if (count($date_array) == 0) { |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
43 | 43 | $date_data = ''; |
44 | 44 | $date_cnt = ''; |
45 | -foreach($date_array as $date_item) |
|
45 | +foreach ($date_array as $date_item) |
|
46 | 46 | { |
47 | 47 | $date_data .= '"'.$date_item['date_name'].'",'; |
48 | 48 | $date_cnt .= $date_item['date_count'].','; |
49 | 49 | } |
50 | 50 | $date_data = "['x',".substr($date_data, 0, -1)."]"; |
51 | -$date_cnt = "['flights',".substr($date_cnt,0,-1)."]"; |
|
51 | +$date_cnt = "['flights',".substr($date_cnt, 0, -1)."]"; |
|
52 | 52 | print 'c3.generate({ |
53 | 53 | bindto: "#chart", |
54 | 54 | data: { x: "x", |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | print '</script>'; |
58 | 58 | } |
59 | 59 | if (isset($globalDBArchiveMonths) && $globalDBArchiveMonths > 0) { |
60 | - print '<p>'.sprintf(_("Below are the <strong>Top 10</strong> most busiest dates of last %d month(s)."),$globalDBArchiveMonths).'</p>'; |
|
60 | + print '<p>'.sprintf(_("Below are the <strong>Top 10</strong> most busiest dates of last %d month(s)."), $globalDBArchiveMonths).'</p>'; |
|
61 | 61 | } else { |
62 | 62 | print '<p>'._("Below are the <strong>Top 10</strong> most busiest dates.").'</p>'; |
63 | 63 | } |
64 | -if ($type == 'aircraft') $date_array = $Stats->countAllDates($airline_icao,$filter_name); |
|
64 | +if ($type == 'aircraft') $date_array = $Stats->countAllDates($airline_icao, $filter_name); |
|
65 | 65 | elseif ($type == 'marine') $date_array = $Marine->countAllDates(); |
66 | 66 | elseif ($type == 'tracker') $date_array = $Tracker->countAllDates(); |
67 | 67 | if (!empty($date_array)) |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | print '</thead>'; |
76 | 76 | print '<tbody>'; |
77 | 77 | $i = 1; |
78 | - foreach($date_array as $date_item) |
|
78 | + foreach ($date_array as $date_item) |
|
79 | 79 | { |
80 | 80 | print '<tr>'; |
81 | 81 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if (isset($this->all_tracked[$key]['id'])) { |
59 | 59 | //echo $this->all_tracked[$key]['id'].' - '.$this->all_tracked[$key]['latitude'].' '.$this->all_tracked[$key]['longitude']."\n"; |
60 | 60 | $Marine = new Marine($this->db); |
61 | - $Marine->updateLatestMarineData($this->all_tracked[$key]['id'],$this->all_tracked[$key]['ident'],$this->all_tracked[$key]['latitude'],$this->all_tracked[$key]['longitude'],$this->all_tracked[$key]['speed'],$this->all_tracked[$key]['datetime']); |
|
61 | + $Marine->updateLatestMarineData($this->all_tracked[$key]['id'], $this->all_tracked[$key]['ident'], $this->all_tracked[$key]['latitude'], $this->all_tracked[$key]['longitude'], $this->all_tracked[$key]['speed'], $this->all_tracked[$key]['datetime']); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if ($globalDebug) echo 'Delete old values and update latest data...'."\n"; |
70 | 70 | foreach ($this->all_tracked as $key => $flight) { |
71 | 71 | if (isset($flight['lastupdate'])) { |
72 | - if ($flight['lastupdate'] < (time()-3000)) { |
|
72 | + if ($flight['lastupdate'] < (time() - 3000)) { |
|
73 | 73 | if ((!isset($globalNoImport) || $globalNoImport !== TRUE) && (!isset($globalNoDB) || $globalNoDB !== TRUE)) { |
74 | 74 | if (isset($this->all_tracked[$key]['id'])) { |
75 | 75 | if ($globalDebug) echo "--- Delete old values with id ".$this->all_tracked[$key]['id']."\n"; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | //$real_arrival = $this->arrival($key); |
82 | 82 | $Marine = new Marine($this->db); |
83 | 83 | if ($this->all_tracked[$key]['latitude'] != '' && $this->all_tracked[$key]['longitude'] != '') { |
84 | - $result = $Marine->updateLatestMarineData($this->all_tracked[$key]['id'],$this->all_tracked[$key]['ident'],$this->all_tracked[$key]['latitude'],$this->all_tracked[$key]['longitude'],$this->all_tracked[$key]['speed'],$this->all_tracked[$key]['datetime']); |
|
84 | + $result = $Marine->updateLatestMarineData($this->all_tracked[$key]['id'], $this->all_tracked[$key]['ident'], $this->all_tracked[$key]['latitude'], $this->all_tracked[$key]['longitude'], $this->all_tracked[$key]['speed'], $this->all_tracked[$key]['datetime']); |
|
85 | 85 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
86 | 86 | } |
87 | 87 | // Put in archive |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | public function add($line) { |
98 | - global $globalFork, $globalDistanceIgnore, $globalDaemon, $globalDebug, $globalCoordMinChange, $globalDebugTimeElapsed, $globalCenterLatitude, $globalCenterLongitude, $globalBeta, $globalSourcesupdate, $globalAllTracked, $globalNoImport, $globalNoDB, $globalServerAPRS,$APRSMarine; |
|
98 | + global $globalFork, $globalDistanceIgnore, $globalDaemon, $globalDebug, $globalCoordMinChange, $globalDebugTimeElapsed, $globalCenterLatitude, $globalCenterLongitude, $globalBeta, $globalSourcesupdate, $globalAllTracked, $globalNoImport, $globalNoDB, $globalServerAPRS, $APRSMarine; |
|
99 | 99 | if (!isset($globalCoordMinChange) || $globalCoordMinChange == '') $globalCoordMinChange = '0.02'; |
100 | 100 | date_default_timezone_set('UTC'); |
101 | 101 | $dataFound = false; |
102 | 102 | $send = false; |
103 | 103 | |
104 | 104 | // SBS format is CSV format |
105 | - if(is_array($line) && isset($line['mmsi'])) { |
|
105 | + if (is_array($line) && isset($line['mmsi'])) { |
|
106 | 106 | //print_r($line); |
107 | 107 | if (isset($line['mmsi'])) { |
108 | 108 | |
@@ -126,18 +126,18 @@ discard block |
||
126 | 126 | |
127 | 127 | if (!isset($this->all_tracked[$id])) { |
128 | 128 | $this->all_tracked[$id] = array(); |
129 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('addedMarine' => 0)); |
|
130 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => '','latitude' => '', 'longitude' => '', 'speed' => '0', 'heading' => '', 'format_source' => '','source_name' => '','comment'=> '','type' => '','typeid' => '','noarchive' => false,'putinarchive' => true,'over_country' => '','mmsi' => '','status' => '','status_id' => '','imo' => '','callsign' => '','arrival_code' => '','arrival_date' => '','mmsi_type' => '')); |
|
131 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('lastupdate' => time())); |
|
129 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('addedMarine' => 0)); |
|
130 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('ident' => '', 'latitude' => '', 'longitude' => '', 'speed' => '0', 'heading' => '', 'format_source' => '', 'source_name' => '', 'comment'=> '', 'type' => '', 'typeid' => '', 'noarchive' => false, 'putinarchive' => true, 'over_country' => '', 'mmsi' => '', 'status' => '', 'status_id' => '', 'imo' => '', 'callsign' => '', 'arrival_code' => '', 'arrival_date' => '', 'mmsi_type' => '')); |
|
131 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('lastupdate' => time())); |
|
132 | 132 | if (!isset($line['id'])) { |
133 | 133 | if (!isset($globalDaemon)) $globalDaemon = TRUE; |
134 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $id.'-'.date('YmdHi'))); |
|
135 | - } else $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $line['id'])); |
|
134 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $id.'-'.date('YmdHi'))); |
|
135 | + } else $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $line['id'])); |
|
136 | 136 | if ($globalAllTracked !== FALSE) $dataFound = true; |
137 | 137 | } |
138 | 138 | |
139 | 139 | if (isset($line['mmsi']) && $line['mmsi'] != '' && $line['mmsi'] != $this->all_tracked[$id]['mmsi']) { |
140 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('mmsi' => $line['mmsi'])); |
|
140 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('mmsi' => $line['mmsi'])); |
|
141 | 141 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
142 | 142 | $Marine = new Marine($this->db); |
143 | 143 | $identity = $Marine->getIdentity($line['mmsi']); |
@@ -151,64 +151,64 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | if (isset($line['type_id'])) { |
154 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('type' => $AIS->getShipType($line['type_id']))); |
|
154 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('type' => $AIS->getShipType($line['type_id']))); |
|
155 | 155 | } |
156 | 156 | if (isset($line['type']) && $line['type'] != '') { |
157 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('type' => $line['type'])); |
|
157 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('type' => $line['type'])); |
|
158 | 158 | } |
159 | 159 | if (isset($line['mmsi_type']) && $line['mmsi_type'] != '') { |
160 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('mmsi_type' => $line['mmsi_type'])); |
|
160 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('mmsi_type' => $line['mmsi_type'])); |
|
161 | 161 | } |
162 | 162 | if (isset($line['imo']) && $line['imo'] != '') { |
163 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('imo' => $line['imo'])); |
|
163 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('imo' => $line['imo'])); |
|
164 | 164 | } |
165 | 165 | if (isset($line['callsign']) && $line['callsign'] != '') { |
166 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('callsign' => $line['callsign'])); |
|
166 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('callsign' => $line['callsign'])); |
|
167 | 167 | } |
168 | 168 | if (isset($line['arrival_code']) && $line['arrival_code'] != '') { |
169 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('arrival_code' => $line['arrival_code'])); |
|
169 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('arrival_code' => $line['arrival_code'])); |
|
170 | 170 | } |
171 | 171 | if (isset($line['arrival_date']) && $line['arrival_date'] != '') { |
172 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('arrival_date' => $line['arrival_date'])); |
|
172 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('arrival_date' => $line['arrival_date'])); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | 176 | //if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && ($this->all_tracked[$id]['ident'] != trim($line['ident'])) && preg_match('/^[a-zA-Z0-9-]+$/', $line['ident'])) { |
177 | 177 | if (isset($line['ident']) && $line['ident'] != '' && $line['ident'] != '????????' && $line['ident'] != '00000000' && ($this->all_tracked[$id]['ident'] != trim($line['ident']))) { |
178 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('ident' => trim($line['ident']))); |
|
178 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('ident' => trim($line['ident']))); |
|
179 | 179 | if ($this->all_tracked[$id]['addedMarine'] == 1) { |
180 | 180 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
181 | 181 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
182 | 182 | $timeelapsed = microtime(true); |
183 | 183 | $Marine = new Marine($this->db); |
184 | 184 | $fromsource = NULL; |
185 | - $result = $Marine->updateIdentMarineData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['ident'],$fromsource); |
|
185 | + $result = $Marine->updateIdentMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $fromsource); |
|
186 | 186 | if ($globalDebug && $result != 'success') echo '!!! ERROR : '.$result."\n"; |
187 | 187 | $Marine->db = null; |
188 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
188 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update identspotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
192 | - if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['ident'])); |
|
192 | + if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $this->all_tracked[$id]['ident'])); |
|
193 | 193 | } |
194 | 194 | |
195 | - if (isset($line['datetime']) && strtotime($line['datetime']) > time()-20*60 && strtotime($line['datetime']) < time()+20*60) { |
|
195 | + if (isset($line['datetime']) && strtotime($line['datetime']) > time() - 20*60 && strtotime($line['datetime']) < time() + 20*60) { |
|
196 | 196 | if (!isset($this->all_tracked[$id]['datetime']) || strtotime($line['datetime']) > strtotime($this->all_tracked[$id]['datetime'])) { |
197 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('datetime' => $line['datetime'])); |
|
197 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('datetime' => $line['datetime'])); |
|
198 | 198 | } else { |
199 | 199 | if (strtotime($line['datetime']) == strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) echo "!!! Date is the same as previous data for ".$this->all_tracked[$id]['mmsi']."\n"; |
200 | 200 | elseif (strtotime($line['datetime']) > strtotime($this->all_tracked[$id]['datetime']) && $globalDebug) echo "!!! Date previous latest data (".$line['datetime']." > ".$this->all_tracked[$id]['datetime'].") !!! for ".$this->all_tracked[$id]['hex']." - format : ".$line['format_source']."\n"; |
201 | 201 | return ''; |
202 | 202 | } |
203 | - } elseif (isset($line['datetime']) && strtotime($line['datetime']) < time()-20*60) { |
|
203 | + } elseif (isset($line['datetime']) && strtotime($line['datetime']) < time() - 20*60) { |
|
204 | 204 | if ($globalDebug) echo "!!! Date is too old ".$this->all_tracked[$id]['mmsi']." - format : ".$line['format_source']."!!!"; |
205 | 205 | return ''; |
206 | - } elseif (isset($line['datetime']) && strtotime($line['datetime']) > time()+20*60) { |
|
206 | + } elseif (isset($line['datetime']) && strtotime($line['datetime']) > time() + 20*60) { |
|
207 | 207 | if ($globalDebug) echo "!!! Date is in the future ".$this->all_tracked[$id]['mmsi']." - format : ".$line['format_source']."!!!"; |
208 | 208 | return ''; |
209 | 209 | } elseif (!isset($line['datetime'])) { |
210 | 210 | date_default_timezone_set('UTC'); |
211 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('datetime' => date('Y-m-d H:i:s'))); |
|
211 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('datetime' => date('Y-m-d H:i:s'))); |
|
212 | 212 | } else { |
213 | 213 | if ($globalDebug) echo "!!! Unknow date error ".$this->all_tracked[$id]['mmsi']." - format : ".$line['format_source']."!!!"; |
214 | 214 | return ''; |
@@ -216,24 +216,24 @@ discard block |
||
216 | 216 | |
217 | 217 | |
218 | 218 | if (isset($line['speed'])) { |
219 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($line['speed']))); |
|
220 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed_fromsrc' => true)); |
|
219 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('speed' => round($line['speed']))); |
|
220 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('speed_fromsrc' => true)); |
|
221 | 221 | } else if (!isset($this->all_tracked[$id]['speed_fromsrc']) && isset($this->all_tracked[$id]['time_last_coord']) && $this->all_tracked[$id]['time_last_coord'] != time() && isset($line['latitude']) && isset($line['longitude'])) { |
222 | - $distance = $Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m'); |
|
222 | + $distance = $Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm'); |
|
223 | 223 | if ($distance > 1000 && $distance < 10000) { |
224 | 224 | $speed = $distance/(time() - $this->all_tracked[$id]['time_last_coord']); |
225 | 225 | $speed = $speed*3.6; |
226 | - if ($speed < 1000) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('speed' => round($speed))); |
|
226 | + if ($speed < 1000) $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('speed' => round($speed))); |
|
227 | 227 | if ($globalDebug) echo "ø Calculated Speed for ".$this->all_tracked[$id]['hex']." : ".$speed." - distance : ".$distance."\n"; |
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | 231 | if (isset($line['latitude']) && isset($line['longitude']) && $line['latitude'] != '' && $line['longitude'] != '' && is_numeric($line['latitude']) && is_numeric($line['longitude'])) { |
232 | - if (isset($this->all_tracked[$id]['time_last_coord'])) $timediff = round(time()-$this->all_tracked[$id]['time_last_coord']); |
|
232 | + if (isset($this->all_tracked[$id]['time_last_coord'])) $timediff = round(time() - $this->all_tracked[$id]['time_last_coord']); |
|
233 | 233 | else unset($timediff); |
234 | - if ($this->tmd > 5 || !isset($timediff) || $timediff > 2000 || ($timediff > 30 && isset($this->all_tracked[$id]['latitude']) && isset($this->all_tracked[$id]['longitude']) && $Common->withinThreshold($timediff,$Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')))) { |
|
234 | + if ($this->tmd > 5 || !isset($timediff) || $timediff > 2000 || ($timediff > 30 && isset($this->all_tracked[$id]['latitude']) && isset($this->all_tracked[$id]['longitude']) && $Common->withinThreshold($timediff, $Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm')))) { |
|
235 | 235 | if (isset($this->all_tracked[$id]['archive_latitude']) && isset($this->all_tracked[$id]['archive_longitude']) && isset($this->all_tracked[$id]['livedb_latitude']) && isset($this->all_tracked[$id]['livedb_longitude'])) { |
236 | - if (!$Common->checkLine($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['livedb_latitude'],$this->all_tracked[$id]['livedb_longitude'],$line['latitude'],$line['longitude'])) { |
|
236 | + if (!$Common->checkLine($this->all_tracked[$id]['archive_latitude'], $this->all_tracked[$id]['archive_longitude'], $this->all_tracked[$id]['livedb_latitude'], $this->all_tracked[$id]['livedb_longitude'], $line['latitude'], $line['longitude'])) { |
|
237 | 237 | $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
238 | 238 | $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
239 | 239 | $this->all_tracked[$id]['putinarchive'] = true; |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | $timeelapsed = microtime(true); |
243 | 243 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
244 | 244 | $Marine = new Marine($this->db); |
245 | - $all_country = $Marine->getCountryFromLatitudeLongitude($line['latitude'],$line['longitude']); |
|
245 | + $all_country = $Marine->getCountryFromLatitudeLongitude($line['latitude'], $line['longitude']); |
|
246 | 246 | if (!empty($all_country)) $this->all_tracked[$id]['over_country'] = $all_country['iso2']; |
247 | 247 | $Marine->db = null; |
248 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
248 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update getCountryFromlatitudeLongitude : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
249 | 249 | } |
250 | 250 | $this->tmd = 0; |
251 | 251 | if ($globalDebug) echo 'FOUND : '.$this->all_tracked[$id]['over_country'].' ---------------'."\n"; |
@@ -254,52 +254,52 @@ discard block |
||
254 | 254 | |
255 | 255 | if (isset($line['latitude']) && $line['latitude'] != '' && $line['latitude'] != 0 && $line['latitude'] < 91 && $line['latitude'] > -90) { |
256 | 256 | if (!isset($this->all_tracked[$id]['archive_latitude'])) $this->all_tracked[$id]['archive_latitude'] = $line['latitude']; |
257 | - if (!isset($this->all_tracked[$id]['livedb_latitude']) || abs($this->all_tracked[$id]['livedb_latitude']-$line['latitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
257 | + if (!isset($this->all_tracked[$id]['livedb_latitude']) || abs($this->all_tracked[$id]['livedb_latitude'] - $line['latitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
258 | 258 | $this->all_tracked[$id]['livedb_latitude'] = $line['latitude']; |
259 | 259 | $dataFound = true; |
260 | 260 | $this->all_tracked[$id]['time_last_coord'] = time(); |
261 | 261 | } |
262 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('latitude' => $line['latitude'])); |
|
262 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('latitude' => $line['latitude'])); |
|
263 | 263 | } |
264 | 264 | if (isset($line['longitude']) && $line['longitude'] != '' && $line['longitude'] != 0 && $line['longitude'] < 360 && $line['longitude'] > -180) { |
265 | 265 | if ($line['longitude'] > 180) $line['longitude'] = $line['longitude'] - 360; |
266 | 266 | if (!isset($this->all_tracked[$id]['archive_longitude'])) $this->all_tracked[$id]['archive_longitude'] = $line['longitude']; |
267 | - if (!isset($this->all_tracked[$id]['livedb_longitude']) || abs($this->all_tracked[$id]['livedb_longitude']-$line['longitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
267 | + if (!isset($this->all_tracked[$id]['livedb_longitude']) || abs($this->all_tracked[$id]['livedb_longitude'] - $line['longitude']) > $globalCoordMinChange || $this->all_tracked[$id]['format_source'] == 'aprs') { |
|
268 | 268 | $this->all_tracked[$id]['livedb_longitude'] = $line['longitude']; |
269 | 269 | $dataFound = true; |
270 | 270 | $this->all_tracked[$id]['time_last_coord'] = time(); |
271 | 271 | } |
272 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('longitude' => $line['longitude'])); |
|
272 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('longitude' => $line['longitude'])); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | } else if ($globalDebug && $timediff > 20) { |
276 | 276 | $this->tmd = $this->tmd + 1; |
277 | 277 | echo '!!! Too much distance in short time... for '.$this->all_tracked[$id]['ident']."\n"; |
278 | - echo 'Time : '.$timediff.'s - Distance : '.$Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')."m -"; |
|
279 | - echo 'Speed : '.(($Common->distance($line['latitude'],$line['longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],'m')/$timediff)*3.6)." km/h - "; |
|
278 | + echo 'Time : '.$timediff.'s - Distance : '.$Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm')."m -"; |
|
279 | + echo 'Speed : '.(($Common->distance($line['latitude'], $line['longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], 'm')/$timediff)*3.6)." km/h - "; |
|
280 | 280 | echo 'Lat : '.$line['latitude'].' - long : '.$line['longitude'].' - prev lat : '.$this->all_tracked[$id]['latitude'].' - prev long : '.$this->all_tracked[$id]['longitude']." \n"; |
281 | 281 | } |
282 | 282 | } |
283 | 283 | if (isset($line['last_update']) && $line['last_update'] != '') { |
284 | 284 | if (isset($this->all_tracked[$id]['last_update']) && $this->all_tracked[$id]['last_update'] != $line['last_update']) $dataFound = true; |
285 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('last_update' => $line['last_update'])); |
|
285 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('last_update' => $line['last_update'])); |
|
286 | 286 | } |
287 | 287 | if (isset($line['format_source']) && $line['format_source'] != '') { |
288 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('format_source' => $line['format_source'])); |
|
288 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('format_source' => $line['format_source'])); |
|
289 | 289 | } |
290 | 290 | if (isset($line['source_name']) && $line['source_name'] != '') { |
291 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('source_name' => $line['source_name'])); |
|
291 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('source_name' => $line['source_name'])); |
|
292 | 292 | } |
293 | 293 | if (isset($line['status']) && $line['status'] != '') { |
294 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('status' => $line['status'])); |
|
294 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('status' => $line['status'])); |
|
295 | 295 | } |
296 | 296 | if (isset($line['status_id']) && (!isset($this->all_tracked[$id]['status_id']) || $this->all_tracked[$id]['status_id'] != $line['status_id'])) { |
297 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('status_id' => $line['status_id'])); |
|
297 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('status_id' => $line['status_id'])); |
|
298 | 298 | if ($this->all_tracked[$id]['addedMarine'] == 1) { |
299 | 299 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
300 | 300 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
301 | 301 | $Marine = new Marine($this->db); |
302 | - $Marine->updateStatusMarineData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['status']); |
|
302 | + $Marine->updateStatusMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['status']); |
|
303 | 303 | unset($Marine); |
304 | 304 | } |
305 | 305 | } |
@@ -307,18 +307,18 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | if (isset($line['noarchive']) && $line['noarchive'] === true) { |
310 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('noarchive' => true)); |
|
310 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('noarchive' => true)); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | if (isset($line['heading']) && $line['heading'] != '') { |
314 | - if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading']-round($line['heading'])) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
315 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($line['heading']))); |
|
316 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading_fromsrc' => true)); |
|
314 | + if (is_int($this->all_tracked[$id]['heading']) && abs($this->all_tracked[$id]['heading'] - round($line['heading'])) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
315 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('heading' => round($line['heading']))); |
|
316 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('heading_fromsrc' => true)); |
|
317 | 317 | //$dataFound = true; |
318 | 318 | } elseif (!isset($this->all_tracked[$id]['heading_fromsrc']) && isset($this->all_tracked[$id]['archive_latitude']) && $this->all_tracked[$id]['archive_latitude'] != $this->all_tracked[$id]['latitude'] && isset($this->all_tracked[$id]['archive_longitude']) && $this->all_tracked[$id]['archive_longitude'] != $this->all_tracked[$id]['longitude']) { |
319 | - $heading = $Common->getHeading($this->all_tracked[$id]['archive_latitude'],$this->all_tracked[$id]['archive_longitude'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
320 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('heading' => round($heading))); |
|
321 | - if (abs($this->all_tracked[$id]['heading']-round($heading)) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
319 | + $heading = $Common->getHeading($this->all_tracked[$id]['archive_latitude'], $this->all_tracked[$id]['archive_longitude'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude']); |
|
320 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('heading' => round($heading))); |
|
321 | + if (abs($this->all_tracked[$id]['heading'] - round($heading)) > 10) $this->all_tracked[$id]['putinarchive'] = true; |
|
322 | 322 | if ($globalDebug) echo "ø Calculated Heading for ".$this->all_tracked[$id]['ident']." : ".$heading."\n"; |
323 | 323 | } |
324 | 324 | //if (isset($globalSourcesupdate) && $globalSourcesupdate != '' && isset($this->all_tracked[$id]['lastupdate']) && time()-$this->all_tracked[$id]['lastupdate'] < $globalSourcesupdate) $dataFound = false; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | if ($dataFound === true && isset($this->all_tracked[$id]['mmsi'])) { |
329 | 329 | $this->all_tracked[$id]['lastupdate'] = time(); |
330 | 330 | if ($this->all_tracked[$id]['addedMarine'] == 0) { |
331 | - if (!isset($globalDistanceIgnore['latitude']) || $this->all_tracked[$id]['longitude'] == '' || $this->all_tracked[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
331 | + if (!isset($globalDistanceIgnore['latitude']) || $this->all_tracked[$id]['longitude'] == '' || $this->all_tracked[$id]['latitude'] == '' || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
332 | 332 | if (!isset($this->all_tracked[$id]['forcenew']) || $this->all_tracked[$id]['forcenew'] == 0) { |
333 | 333 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
334 | 334 | if ($globalDebug) echo "Check if aircraft is already in DB..."; |
@@ -336,37 +336,37 @@ discard block |
||
336 | 336 | $MarineLive = new MarineLive($this->db); |
337 | 337 | if (isset($line['id'])) { |
338 | 338 | $recent_ident = $MarineLive->checkIdRecent($line['id']); |
339 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
339 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
340 | 340 | } elseif (isset($this->all_tracked[$id]['mmsi']) && $this->all_tracked[$id]['mmsi'] != '') { |
341 | 341 | $recent_ident = $MarineLive->checkMMSIRecent($this->all_tracked[$id]['mmsi']); |
342 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
342 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
343 | 343 | } elseif (isset($this->all_tracked[$id]['ident']) && $this->all_tracked[$id]['ident'] != '') { |
344 | 344 | $recent_ident = $MarineLive->checkIdentRecent($this->all_tracked[$id]['ident']); |
345 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
345 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update checkIdentRecent : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
346 | 346 | } else $recent_ident = ''; |
347 | - $MarineLive->db=null; |
|
347 | + $MarineLive->db = null; |
|
348 | 348 | if ($globalDebug && $recent_ident == '') echo " Not in DB.\n"; |
349 | 349 | elseif ($globalDebug && $recent_ident != '') echo " Already in DB.\n"; |
350 | 350 | } else $recent_ident = ''; |
351 | 351 | } else { |
352 | 352 | $recent_ident = ''; |
353 | - $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('forcenew' => 0)); |
|
353 | + $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('forcenew' => 0)); |
|
354 | 354 | } |
355 | 355 | //if there was no aircraft with the same callsign within the last hour and go post it into the archive |
356 | - if($recent_ident == "" && $this->all_tracked[$id]['latitude'] != '' && $this->all_tracked[$id]['longitude'] != '') |
|
356 | + if ($recent_ident == "" && $this->all_tracked[$id]['latitude'] != '' && $this->all_tracked[$id]['longitude'] != '') |
|
357 | 357 | { |
358 | 358 | if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['mmsi']." in archive DB : "; |
359 | 359 | //adds the spotter data for the archive |
360 | 360 | $highlight = ''; |
361 | - if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id],array('id' => $this->all_tracked[$id]['mmsi'].'-'.date('YmdHi'))); |
|
361 | + if (!isset($this->all_tracked[$id]['id'])) $this->all_tracked[$id] = array_merge($this->all_tracked[$id], array('id' => $this->all_tracked[$id]['mmsi'].'-'.date('YmdHi'))); |
|
362 | 362 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
363 | 363 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
364 | 364 | $timeelapsed = microtime(true); |
365 | 365 | $Marine = new Marine($this->db); |
366 | - $result = $Marine->addMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'],$this->all_tracked[$id]['typeid'],$this->all_tracked[$id]['imo'],$this->all_tracked[$id]['callsign'],$this->all_tracked[$id]['arrival_code'],$this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name']); |
|
366 | + $result = $Marine->addMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'], $this->all_tracked[$id]['typeid'], $this->all_tracked[$id]['imo'], $this->all_tracked[$id]['callsign'], $this->all_tracked[$id]['arrival_code'], $this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['format_source'], $this->all_tracked[$id]['source_name']); |
|
367 | 367 | $Marine->db = null; |
368 | 368 | if ($globalDebug && isset($result)) echo $result."\n"; |
369 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
369 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update addspotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | if (isset($line['sourcestats']) && $line['sourcestats'] == TRUE && $this->all_tracked[$id]['latitude'] != '' && $this->all_tracked[$id]['longitude'] != '') { |
@@ -374,15 +374,15 @@ discard block |
||
374 | 374 | $Stats = new Stats($this->db); |
375 | 375 | if (!empty($this->stats)) { |
376 | 376 | if ($globalDebug) echo 'Add source stats : '; |
377 | - foreach($this->stats as $date => $data) { |
|
378 | - foreach($data as $source => $sourced) { |
|
377 | + foreach ($this->stats as $date => $data) { |
|
378 | + foreach ($data as $source => $sourced) { |
|
379 | 379 | //print_r($sourced); |
380 | - if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']),$source,'polar_marine',$date); |
|
381 | - if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']),$source,'hist_marine',$date); |
|
380 | + if (isset($sourced['polar'])) echo $Stats->addStatSource(json_encode($sourced['polar']), $source, 'polar_marine', $date); |
|
381 | + if (isset($sourced['hist'])) echo $Stats->addStatSource(json_encode($sourced['hist']), $source, 'hist_marine', $date); |
|
382 | 382 | if (isset($sourced['msg'])) { |
383 | 383 | if (time() - $sourced['msg']['date'] > 10) { |
384 | 384 | $nbmsg = round($sourced['msg']['nb']/(time() - $sourced['msg']['date'])); |
385 | - echo $Stats->addStatSource($nbmsg,$source,'msg_marine',$date); |
|
385 | + echo $Stats->addStatSource($nbmsg, $source, 'msg_marine', $date); |
|
386 | 386 | unset($this->stats[$date][$source]['msg']); |
387 | 387 | } |
388 | 388 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
407 | 407 | $MarineLive = new MarineLive($this->db); |
408 | 408 | $MarineLive->deleteLiveMarineData(); |
409 | - $MarineLive->db=null; |
|
409 | + $MarineLive->db = null; |
|
410 | 410 | if ($globalDebug) echo " Done\n"; |
411 | 411 | } |
412 | 412 | $this->last_delete = time(); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
418 | 418 | if (isset($globalDaemon) && !$globalDaemon) { |
419 | 419 | $Marine = new Marine($this->db); |
420 | - $Marine->updateLatestMarineData($this->all_tracked[$id]['id'],$this->all_tracked[$id]['ident'],$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$this->all_tracked[$id]['speed'],$this->all_tracked[$id]['datetime']); |
|
420 | + $Marine->updateLatestMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime']); |
|
421 | 421 | $Marine->db = null; |
422 | 422 | } |
423 | 423 | } |
@@ -432,20 +432,20 @@ discard block |
||
432 | 432 | $ignoreImport = false; |
433 | 433 | |
434 | 434 | if (!$ignoreImport) { |
435 | - if (!isset($globalDistanceIgnore['latitude']) || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
435 | + if (!isset($globalDistanceIgnore['latitude']) || (isset($globalDistanceIgnore['latitude']) && $Common->distance($this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude']) < $globalDistanceIgnore['distance'])) { |
|
436 | 436 | if ($globalDebug) echo "\o/ Add ".$this->all_tracked[$id]['ident']." from ".$this->all_tracked[$id]['format_source']." in Live DB : "; |
437 | 437 | if (!isset($globalNoImport) || $globalNoImport !== TRUE) { |
438 | 438 | if (!isset($globalNoDB) || $globalNoDB !== TRUE) { |
439 | 439 | $timeelapsed = microtime(true); |
440 | 440 | $MarineLive = new MarineLive($this->db); |
441 | - $result = $MarineLive->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'],$this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'],$this->all_tracked[$id]['mmsi'],$this->all_tracked[$id]['type'],$this->all_tracked[$id]['typeid'],$this->all_tracked[$id]['imo'],$this->all_tracked[$id]['callsign'],$this->all_tracked[$id]['arrival_code'],$this->all_tracked[$id]['arrival_date'],$this->all_tracked[$id]['status'],$this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['noarchive'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name'],$this->all_tracked[$id]['over_country']); |
|
441 | + $result = $MarineLive->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'], $this->all_tracked[$id]['typeid'], $this->all_tracked[$id]['imo'], $this->all_tracked[$id]['callsign'], $this->all_tracked[$id]['arrival_code'], $this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['noarchive'], $this->all_tracked[$id]['format_source'], $this->all_tracked[$id]['source_name'], $this->all_tracked[$id]['over_country']); |
|
442 | 442 | $MarineLive->db = null; |
443 | 443 | if ($globalDebug) echo $result."\n"; |
444 | - if ($globalDebugTimeElapsed) echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true)-$timeelapsed,2).'s'."\n"; |
|
444 | + if ($globalDebugTimeElapsed) echo 'Time elapsed for update addlivespotterdata : '.round(microtime(true) - $timeelapsed, 2).'s'."\n"; |
|
445 | 445 | } |
446 | 446 | } |
447 | 447 | if (isset($globalServerAPRS) && $globalServerAPRS && $this->all_tracked[$id]['putinarchive']) { |
448 | - $APRSMarine->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'],$this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'],$this->all_tracked[$id]['mmsi'],$this->all_tracked[$id]['type'],$this->all_tracked[$id]['typeid'],$this->all_tracked[$id]['imo'],$this->all_tracked[$id]['callsign'],$this->all_tracked[$id]['arrival_code'],$this->all_tracked[$id]['arrival_date'],$this->all_tracked[$id]['status'],$this->all_tracked[$id]['status_id'],$this->all_tracked[$id]['noarchive'],$this->all_tracked[$id]['format_source'],$this->all_tracked[$id]['source_name'],$this->all_tracked[$id]['over_country']); |
|
448 | + $APRSMarine->addLiveMarineData($this->all_tracked[$id]['id'], $this->all_tracked[$id]['ident'], $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $this->all_tracked[$id]['heading'], $this->all_tracked[$id]['speed'], $this->all_tracked[$id]['datetime'], $this->all_tracked[$id]['putinarchive'], $this->all_tracked[$id]['mmsi'], $this->all_tracked[$id]['type'], $this->all_tracked[$id]['typeid'], $this->all_tracked[$id]['imo'], $this->all_tracked[$id]['callsign'], $this->all_tracked[$id]['arrival_code'], $this->all_tracked[$id]['arrival_date'], $this->all_tracked[$id]['status'], $this->all_tracked[$id]['status_id'], $this->all_tracked[$id]['noarchive'], $this->all_tracked[$id]['format_source'], $this->all_tracked[$id]['source_name'], $this->all_tracked[$id]['over_country']); |
|
449 | 449 | } |
450 | 450 | $this->all_tracked[$id]['putinarchive'] = false; |
451 | 451 | |
@@ -464,19 +464,19 @@ discard block |
||
464 | 464 | $latitude = $globalCenterLatitude; |
465 | 465 | $longitude = $globalCenterLongitude; |
466 | 466 | } |
467 | - $this->source_location[$source] = array('latitude' => $latitude,'longitude' => $longitude); |
|
467 | + $this->source_location[$source] = array('latitude' => $latitude, 'longitude' => $longitude); |
|
468 | 468 | } else { |
469 | 469 | $latitude = $this->source_location[$source]['latitude']; |
470 | 470 | $longitude = $this->source_location[$source]['longitude']; |
471 | 471 | } |
472 | - $stats_heading = $Common->getHeading($latitude,$longitude,$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
472 | + $stats_heading = $Common->getHeading($latitude, $longitude, $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude']); |
|
473 | 473 | //$stats_heading = $stats_heading%22.5; |
474 | 474 | $stats_heading = round($stats_heading/22.5); |
475 | - $stats_distance = $Common->distance($latitude,$longitude,$this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude']); |
|
475 | + $stats_distance = $Common->distance($latitude, $longitude, $this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude']); |
|
476 | 476 | $current_date = date('Y-m-d'); |
477 | 477 | if ($stats_heading == 16) $stats_heading = 0; |
478 | 478 | if (!isset($this->stats[$current_date][$source]['polar'][1])) { |
479 | - for ($i=0;$i<=15;$i++) { |
|
479 | + for ($i = 0; $i <= 15; $i++) { |
|
480 | 480 | $this->stats[$current_date][$source]['polar'][$i] = 0; |
481 | 481 | } |
482 | 482 | $this->stats[$current_date][$source]['polar'][$stats_heading] = $stats_distance; |
@@ -491,9 +491,9 @@ discard block |
||
491 | 491 | if (!isset($this->stats[$current_date][$source]['hist'][$distance])) { |
492 | 492 | if (isset($this->stats[$current_date][$source]['hist'][0])) { |
493 | 493 | end($this->stats[$current_date][$source]['hist']); |
494 | - $mini = key($this->stats[$current_date][$source]['hist'])+10; |
|
494 | + $mini = key($this->stats[$current_date][$source]['hist']) + 10; |
|
495 | 495 | } else $mini = 0; |
496 | - for ($i=$mini;$i<=$distance;$i+=10) { |
|
496 | + for ($i = $mini; $i <= $distance; $i += 10) { |
|
497 | 497 | $this->stats[$current_date][$source]['hist'][$i] = 0; |
498 | 498 | } |
499 | 499 | $this->stats[$current_date][$source]['hist'][$distance] = 1; |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | |
506 | 506 | $this->all_tracked[$id]['lastupdate'] = time(); |
507 | 507 | if ($this->all_tracked[$id]['putinarchive']) $send = true; |
508 | - } elseif (isset($this->all_tracked[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) echo "!! Too far -> Distance : ".$Common->distance($this->all_tracked[$id]['latitude'],$this->all_tracked[$id]['longitude'],$globalDistanceIgnore['latitude'],$globalDistanceIgnore['longitude'])."\n"; |
|
508 | + } elseif (isset($this->all_tracked[$id]['latitude']) && isset($globalDistanceIgnore['latitude']) && $globalDebug) echo "!! Too far -> Distance : ".$Common->distance($this->all_tracked[$id]['latitude'], $this->all_tracked[$id]['longitude'], $globalDistanceIgnore['latitude'], $globalDistanceIgnore['longitude'])."\n"; |
|
509 | 509 | //$this->del(); |
510 | 510 | |
511 | 511 |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | $title = _("Statistics").' - '._("Most common Aircraft"); |
7 | 7 | |
8 | 8 | if (!isset($filter_name)) $filter_name = ''; |
9 | -$airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
|
9 | +$airline_icao = (string) filter_input(INPUT_GET, 'airline', FILTER_SANITIZE_STRING); |
|
10 | 10 | if ($airline_icao == '' && isset($globalFilter)) { |
11 | 11 | if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
12 | 12 | } |
13 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
14 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
14 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
15 | 15 | |
16 | 16 | require_once('header.php'); |
17 | 17 | |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | </div> |
24 | 24 | <p>'._("Below are the <strong>Top 10</strong> most common aircraft types.").'</p>'; |
25 | 25 | |
26 | -$aircraft_array = $Stats->countAllAircraftTypes(true,$airline_icao,$filter_name,$year,$month); |
|
26 | +$aircraft_array = $Stats->countAllAircraftTypes(true, $airline_icao, $filter_name, $year, $month); |
|
27 | 27 | print '<div id="chart" class="chart" width="100%"></div><script>'; |
28 | 28 | $aircraft_data = ''; |
29 | -foreach($aircraft_array as $aircraft_item) |
|
29 | +foreach ($aircraft_array as $aircraft_item) |
|
30 | 30 | { |
31 | 31 | if ($aircraft_item['aircraft_manufacturer'] == 'Not Available') $aircraft_data .= '[" ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
32 | 32 | else $aircraft_data .= '["'.$aircraft_item['aircraft_manufacturer'].' '.$aircraft_item['aircraft_name'].' ('.$aircraft_item['aircraft_icao'].')",'.$aircraft_item['aircraft_icao_count'].'],'; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | print '</thead>'; |
53 | 53 | print '<tbody>'; |
54 | 54 | $i = 1; |
55 | - foreach($aircraft_array as $aircraft_item) |
|
55 | + foreach ($aircraft_array as $aircraft_item) |
|
56 | 56 | { |
57 | 57 | print '<tr>'; |
58 | 58 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | $ATC = new ATC(); |
6 | 6 | |
7 | 7 | if (isset($_GET['atcid'])) { |
8 | - $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
|
9 | - $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
|
8 | + $atcid = filter_input(INPUT_GET, 'atcid', FILTER_SANITIZE_NUMBER_INT); |
|
9 | + $atcident = filter_input(INPUT_GET, 'atcident', FILTER_SANITIZE_STRING); |
|
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | 11 | if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
12 | 12 | ?> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | print '</div>'; |
39 | 39 | |
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | -print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>'; |
|
41 | +print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'], 3).', '.round($spotter_item['longitude'], 3).'</div>'; |
|
42 | 42 | if ($spotter_item['atc_range'] > 0) { |
43 | 43 | print '<div><span>'._("Range").'</span>'; |
44 | 44 | print $spotter_item['atc_range']; |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | require_once(dirname(__FILE__).'/require/class.Common.php'); |
6 | 6 | $Common = new Common(); |
7 | -$showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop'); |
|
8 | -$showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
|
7 | +$showRouteStop = $Common->multiKeyExists($spotter_array, 'route_stop'); |
|
8 | +$showDuration = $Common->multiKeyExists($spotter_array, 'duration'); |
|
9 | 9 | |
10 | 10 | if (!isset($type)) $type = 'aircraft'; |
11 | 11 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | print '<th class="more"></th>'; |
108 | 108 | print '</thead>'; |
109 | -} else if (strtolower($current_page) == "upcoming"){ |
|
109 | +} else if (strtolower($current_page) == "upcoming") { |
|
110 | 110 | print '<thead>'; |
111 | 111 | if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
112 | 112 | if ($_GET['sort'] == "airline_name_asc") |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | */ |
162 | 162 | print '</thead>'; |
163 | -} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){ |
|
163 | +} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
|
164 | 164 | print '<thead>'; |
165 | 165 | print '<th class="aircraft_thumbnail"></th>'; |
166 | 166 | print '<th class="logo">'._("Airline").'</th>'; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | print '</thead>'; |
198 | 198 | } else { |
199 | 199 | |
200 | - if ($hide_th_links === true){ |
|
200 | + if ($hide_th_links === true) { |
|
201 | 201 | print '<thead>'; |
202 | 202 | print '<th class="aircraft_thumbnail"></th>'; |
203 | 203 | if ($type == 'aircraft') { |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | } |
455 | 455 | |
456 | 456 | print '<tbody>'."\n"; |
457 | -foreach($spotter_array as $spotter_item) |
|
457 | +foreach ($spotter_array as $spotter_item) |
|
458 | 458 | { |
459 | 459 | if (isset($globalTimezone)) |
460 | 460 | { |
@@ -489,13 +489,13 @@ discard block |
||
489 | 489 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
490 | 490 | } |
491 | 491 | if (isset($spotter_item['airline_name'])) { |
492 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
492 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
493 | 493 | } else { |
494 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
494 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '._("Not available").'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
495 | 495 | } |
496 | 496 | } else { |
497 | 497 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
498 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
498 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
499 | 499 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
500 | 500 | if (isset($spotter_item['airline_name'])) { |
501 | 501 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Airline:").' '.$spotter_item['airline_name'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | { |
515 | 515 | print '<td class="aircraft_thumbnail">'."\n"; |
516 | 516 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
517 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
517 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
518 | 518 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
519 | 519 | if (isset($spotter_item['airline_name'])) { |
520 | 520 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | { |
533 | 533 | print '<td class="aircraft_thumbnail">'."\n"; |
534 | 534 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
535 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
535 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
536 | 536 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
537 | 537 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
538 | 538 | print '</td>'."\n"; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | print '</td>'."\n"; |
577 | 577 | } |
578 | 578 | } |
579 | - } elseif(strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed"){ |
|
579 | + } elseif (strtolower($current_page) != "currently" && strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive" && strtolower($current_page) != "accident-latest" && strtolower($current_page) != "incident-latest" && strtolower($current_page) != "accident-detailed" && strtolower($current_page) != "incident-detailed") { |
|
580 | 580 | if ($type == 'aircraft') { |
581 | 581 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
582 | 582 | $spotter_item['squawk'] = '-'; |
@@ -593,17 +593,17 @@ discard block |
||
593 | 593 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
594 | 594 | } |
595 | 595 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
596 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
596 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
597 | 597 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
598 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
598 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
599 | 599 | } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) { |
600 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
600 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
601 | 601 | } else { |
602 | - print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
602 | + print '<a href="'.$image_src.'"><img src="'.preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']).'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '.$spotter_item['airline_name'].'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '.$spotter_item['airline_name'].'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
|
603 | 603 | } |
604 | 604 | } else { |
605 | 605 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
606 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
606 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
607 | 607 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
608 | 608 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
609 | 609 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" alt="'.$spotter_item['registration'].' - '.$spotter_item['aircraft_type'].' - '._("Not available").'" data-content="'._("Registration:").' '.$spotter_item['registration'].'<br />'._("Aircraft:").' '.$spotter_item['aircraft_name'].' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | { |
637 | 637 | print '<td class="aircraft_thumbnail">'."\n"; |
638 | 638 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
639 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
639 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
640 | 640 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
641 | 641 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['mmsi'].'" alt="'.$spotter_item['mmsi'].'" data-content="'._("MMSI:").' '.$spotter_item['mmsi'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
642 | 642 | print '</td>'."\n"; |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | { |
651 | 651 | print '<td class="aircraft_thumbnail">'."\n"; |
652 | 652 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
653 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
653 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
654 | 654 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
655 | 655 | print '<img src="'.$image_thumbnail.'" class="img-rounded" data-toggle="popover" title="'.$spotter_item['ident'].'" alt="'.$spotter_item['type'].'" data-content="'._("Type:").' '.$spotter_item['type'].'" data-html="true" width="100px" />'."\n".'<div class="thumbnail-copyright">© '.$spotter_item['image_copyright'].'</div>'; |
656 | 656 | print '</td>'."\n"; |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | print '</td>'."\n"; |
760 | 760 | } |
761 | 761 | // Aircraft type |
762 | - if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
762 | + if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
763 | 763 | print '<td class="type">'."\n"; |
764 | 764 | if ($type == 'aircraft') { |
765 | 765 | if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) { |
@@ -810,22 +810,22 @@ discard block |
||
810 | 810 | } |
811 | 811 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
812 | 812 | if ($spotter_item['departure_airport_time'] > 2460) { |
813 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
814 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
813 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
814 | + } else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
815 | 815 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
816 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
816 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
817 | 817 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
818 | 818 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
819 | 819 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
820 | 820 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
821 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
821 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
822 | 822 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
823 | 823 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
824 | 824 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
825 | 825 | if ($spotter_item['departure_airport_time'] > 2460) { |
826 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
826 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
827 | 827 | } else { |
828 | - $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
828 | + $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
829 | 829 | } |
830 | 830 | print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n"; |
831 | 831 | } |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | $latitude = $spotter_item['latitude']; |
841 | 841 | $longitude = $spotter_item['longitude']; |
842 | 842 | } |
843 | - $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
|
843 | + $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude); |
|
844 | 844 | } else $distance = ''; |
845 | 845 | if ($distance != '') { |
846 | 846 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -883,20 +883,20 @@ discard block |
||
883 | 883 | } |
884 | 884 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
885 | 885 | if ($spotter_item['arrival_airport_time'] > 2460) { |
886 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
886 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
887 | 887 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
888 | 888 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
889 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
889 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
890 | 890 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
891 | 891 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
892 | 892 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
893 | 893 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
894 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
894 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
895 | 895 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
896 | 896 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
897 | 897 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
898 | 898 | if ($spotter_item['arrival_airport_time'] > 2460) { |
899 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
899 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
900 | 900 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
901 | 901 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
902 | 902 | } |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | $latitude = $spotter_item['latitude']; |
910 | 910 | $longitude = $spotter_item['longitude']; |
911 | 911 | } |
912 | - $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
|
912 | + $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude); |
|
913 | 913 | } else $distance = ''; |
914 | 914 | if ($distance != '') { |
915 | 915 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -952,19 +952,19 @@ discard block |
||
952 | 952 | print '<span class="mobile">-</span>'."\n"; |
953 | 953 | } else { |
954 | 954 | if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
955 | - print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n"; |
|
956 | - print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n"; |
|
955 | + print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n"; |
|
956 | + print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n"; |
|
957 | 957 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
958 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n"; |
|
959 | - print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n"; |
|
958 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n"; |
|
959 | + print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n"; |
|
960 | 960 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
961 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n"; |
|
962 | - print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n"; |
|
961 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n"; |
|
962 | + print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n"; |
|
963 | 963 | } |
964 | 964 | } |
965 | 965 | print '</td>'."\n"; |
966 | 966 | } |
967 | - if(strtolower($current_page) != "upcoming"){ |
|
967 | + if (strtolower($current_page) != "upcoming") { |
|
968 | 968 | if ($type == 'aircraft') { |
969 | 969 | //if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
970 | 970 | if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
@@ -1007,7 +1007,7 @@ discard block |
||
1007 | 1007 | |
1008 | 1008 | if ($showRouteStop) { |
1009 | 1009 | // Route stop |
1010 | - if(strtolower($current_page) != "upcoming"){ |
|
1010 | + if (strtolower($current_page) != "upcoming") { |
|
1011 | 1011 | print '<td class="route_stop">'."\n"; |
1012 | 1012 | if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') { |
1013 | 1013 | print '<span class="nomobile">-</span>'."\n"; |
@@ -1026,11 +1026,11 @@ discard block |
||
1026 | 1026 | } |
1027 | 1027 | if ($showDuration) { |
1028 | 1028 | // Duration |
1029 | - if(strtolower($current_page) != "upcoming"){ |
|
1029 | + if (strtolower($current_page) != "upcoming") { |
|
1030 | 1030 | print '<td class="duration">'."\n"; |
1031 | 1031 | if (isset($spotter_item['duration'])) { |
1032 | - print '<span class="nomobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
1033 | - print '<span class="mobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
1032 | + print '<span class="nomobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
1033 | + print '<span class="mobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
1034 | 1034 | } else { |
1035 | 1035 | print '<span class="nomobile">-</span>'."\n"; |
1036 | 1036 | print '<span class="mobile">-</span>'."\n"; |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
1044 | 1044 | if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') { |
1045 | 1045 | print '<td class="message"><p>'."\n"; |
1046 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1046 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1047 | 1047 | print '</p><p class="decode">'; |
1048 | 1048 | $decode_array = json_decode($spotter_item['decode']); |
1049 | 1049 | foreach ($decode_array as $key => $value) { |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | print '</td>'."\n"; |
1054 | 1054 | } else { |
1055 | 1055 | print '<td class="message">'."\n"; |
1056 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1056 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1057 | 1057 | print '</td>'."\n"; |
1058 | 1058 | } |
1059 | 1059 | } |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | } |
1079 | 1079 | print '</td>'."\n"; |
1080 | 1080 | print '<td class="message">'."\n"; |
1081 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1081 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1082 | 1082 | print '</td>'."\n"; |
1083 | 1083 | } |
1084 | 1084 | if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") { |
@@ -1104,7 +1104,7 @@ discard block |
||
1104 | 1104 | print '</td>'."\n"; |
1105 | 1105 | */ |
1106 | 1106 | print '<td class="message">'."\n"; |
1107 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1107 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1108 | 1108 | print '</td>'."\n"; |
1109 | 1109 | } |
1110 | 1110 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | require_once('../require/settings.php'); |
3 | 3 | require_once('../require/class.Language.php'); |
4 | 4 | |
5 | -setcookie("MapFormat",'2d'); |
|
5 | +setcookie("MapFormat", '2d'); |
|
6 | 6 | |
7 | 7 | if (!isset($globalOpenWeatherMapKey)) $globalOpenWeatherMapKey = ''; |
8 | 8 | // Compressed GeoJson is used if true |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
21 | 21 | if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
22 | 22 | else $enddate = time(); |
23 | - setcookie("archive_begin",$begindate); |
|
24 | - setcookie("archive_end",$enddate); |
|
25 | - setcookie("archive_update",$lastupd); |
|
26 | - setcookie("archive_speed",$archivespeed); |
|
23 | + setcookie("archive_begin", $begindate); |
|
24 | + setcookie("archive_end", $enddate); |
|
25 | + setcookie("archive_update", $lastupd); |
|
26 | + setcookie("archive_speed", $archivespeed); |
|
27 | 27 | ?> |
28 | 28 | document.cookie = 'archive_begin=<?php print $begindate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
29 | 29 | document.cookie = 'archive_end=<?php print $enddate; ?>; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/'; |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | <?php |
75 | 75 | } |
76 | 76 | if (isset($_GET['ident'])) { |
77 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
77 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
78 | 78 | } |
79 | 79 | if (isset($_GET['flightaware_id'])) { |
80 | - $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING); |
|
80 | + $flightaware_id = filter_input(INPUT_GET, 'flightaware_id', FILTER_SANITIZE_STRING); |
|
81 | 81 | } |
82 | 82 | if (isset($_GET['latitude'])) { |
83 | - $latitude = filter_input(INPUT_GET,'latitude',FILTER_SANITIZE_STRING); |
|
83 | + $latitude = filter_input(INPUT_GET, 'latitude', FILTER_SANITIZE_STRING); |
|
84 | 84 | } |
85 | 85 | if (isset($_GET['longitude'])) { |
86 | - $longitude = filter_input(INPUT_GET,'longitude',FILTER_SANITIZE_STRING); |
|
86 | + $longitude = filter_input(INPUT_GET, 'longitude', FILTER_SANITIZE_STRING); |
|
87 | 87 | } |
88 | 88 | ?> |
89 | 89 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | || navigator.userAgent.match(/BlackBerry/i) |
120 | 120 | || navigator.userAgent.match(/Windows Phone/i)) |
121 | 121 | { |
122 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
122 | + var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom - 1; else print '8'; ?>; |
|
123 | 123 | } else { |
124 | 124 | var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
125 | 125 | } |
@@ -213,19 +213,19 @@ discard block |
||
213 | 213 | map.addLayer(yandexLayer); |
214 | 214 | <?php |
215 | 215 | } elseif ($MapType == 'Bing-Aerial') { |
216 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
216 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
217 | 217 | ?> |
218 | 218 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
219 | 219 | map.addLayer(bingLayer); |
220 | 220 | <?php |
221 | 221 | } elseif ($MapType == 'Bing-Hybrid') { |
222 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
222 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
223 | 223 | ?> |
224 | 224 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
225 | 225 | map.addLayer(bingLayer); |
226 | 226 | <?php |
227 | 227 | } elseif ($MapType == 'Bing-Road') { |
228 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
228 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType', 'OpenStreetMap'); |
|
229 | 229 | ?> |
230 | 230 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
231 | 231 | map.addLayer(bingLayer); |