@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING); |
|
12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING); |
|
12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
14 | 14 | $filter = array(); |
15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | -$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort,$filter); |
|
15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
17 | +$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", $sort, $filter); |
|
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Arrival Airports of %s"),$spotter_array[0]['pilot_name']); |
|
21 | + $title = sprintf(_("Most Common Arrival Airports of %s"), $spotter_array[0]['pilot_name']); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="info column">'; |
24 | 24 | print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>'; |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | include('pilot-sub-menu.php'); |
30 | 30 | print '<div class="column">'; |
31 | 31 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
32 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights piloted by <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>'; |
|
33 | - $airport_airport_array = $Spotter->countAllArrivalAirportsByPilot($pilot,$filter); |
|
32 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights piloted by <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>'; |
|
33 | + $airport_airport_array = $Spotter->countAllArrivalAirportsByPilot($pilot, $filter); |
|
34 | 34 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
35 | 35 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
36 | 36 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>'; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | print '<script>'; |
39 | 39 | print 'var series = ['; |
40 | 40 | $airport_data = ''; |
41 | - foreach($airport_airport_array as $airport_item) |
|
41 | + foreach ($airport_airport_array as $airport_item) |
|
42 | 42 | { |
43 | 43 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
44 | 44 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | print '</thead>'; |
94 | 94 | print '<tbody>'; |
95 | 95 | $i = 1; |
96 | - foreach($airport_airport_array as $airport_item) |
|
96 | + foreach ($airport_airport_array as $airport_item) |
|
97 | 97 | { |
98 | 98 | print '<tr>'; |
99 | 99 | 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,16 +33,16 @@ discard block |
||
33 | 33 | </div> |
34 | 34 | <p>'._("Below is a list of the most common <strong>time of day</strong>.").'</p>'; |
35 | 35 | |
36 | -if ($type == 'aircraft') $hour_array = $Stats->countAllHours('hour',true,$airline_icao,$filter_name); |
|
37 | -elseif ($type == 'marine') $hour_array = $Marine->countAllHours('hour',true); |
|
38 | -elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('hour',true); |
|
36 | +if ($type == 'aircraft') $hour_array = $Stats->countAllHours('hour', true, $airline_icao, $filter_name); |
|
37 | +elseif ($type == 'marine') $hour_array = $Marine->countAllHours('hour', true); |
|
38 | +elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('hour', true); |
|
39 | 39 | print '<div id="chartHour" class="chart" width="100%"></div><script>'; |
40 | 40 | $hour_data = ''; |
41 | 41 | $hour_cnt = ''; |
42 | 42 | $last = 0; |
43 | -foreach($hour_array as $hour_item) |
|
43 | +foreach ($hour_array as $hour_item) |
|
44 | 44 | { |
45 | - while($last != $hour_item['hour_name']) { |
|
45 | + while ($last != $hour_item['hour_name']) { |
|
46 | 46 | $hour_data .= '"'.$last.':00",'; |
47 | 47 | $hour_cnt .= '0,'; |
48 | 48 | $last++; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $hour_cnt .= $hour_item['hour_count'].','; |
53 | 53 | } |
54 | 54 | $hour_data = "[".substr($hour_data, 0, -1)."]"; |
55 | -$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]"; |
|
55 | +$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]"; |
|
56 | 56 | print 'c3.generate({ |
57 | 57 | bindto: "#chartHour", |
58 | 58 | data: { |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | axis: { x: { type: "category", categories: '.$hour_data.'},y: { label: "# of Flights"}},legend: { show: false }});'; |
61 | 61 | print '</script>'; |
62 | 62 | |
63 | -if ($type == 'aircraft') $hour_array = $Stats->countAllHours('count',true,$airline_icao,$filter_name); |
|
64 | -elseif ($type == 'marine') $hour_array = $Marine->countAllHours('count',true); |
|
65 | -elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('count',true); |
|
63 | +if ($type == 'aircraft') $hour_array = $Stats->countAllHours('count', true, $airline_icao, $filter_name); |
|
64 | +elseif ($type == 'marine') $hour_array = $Marine->countAllHours('count', true); |
|
65 | +elseif ($type == 'tracker') $hour_array = $Tracker->countAllHours('count', true); |
|
66 | 66 | if (!empty($hour_array)) |
67 | 67 | { |
68 | 68 | print '<div class="table-responsive">'; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | print '</thead>'; |
75 | 75 | print '<tbody>'; |
76 | 76 | $i = 1; |
77 | - foreach($hour_array as $hour_item) |
|
77 | + foreach ($hour_array as $hour_item) |
|
78 | 78 | { |
79 | 79 | print '<tr>'; |
80 | 80 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -7,18 +7,18 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$pilot = filter_input(INPUT_GET,'pilot',FILTER_SANITIZE_STRING); |
|
12 | -$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT); |
|
13 | -$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$pilot = filter_input(INPUT_GET, 'pilot', FILTER_SANITIZE_STRING); |
|
12 | +$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT); |
|
13 | +$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT); |
|
14 | 14 | $filter = array(); |
15 | -if ($year != '') $filter = array_merge($filter,array('year' => $year)); |
|
16 | -if ($month != '') $filter = array_merge($filter,array('month' => $month)); |
|
17 | -$spotter_array = $Spotter->getSpotterDataByPilot($pilot,"0,1", $sort,$filter); |
|
15 | +if ($year != '') $filter = array_merge($filter, array('year' => $year)); |
|
16 | +if ($month != '') $filter = array_merge($filter, array('month' => $month)); |
|
17 | +$spotter_array = $Spotter->getSpotterDataByPilot($pilot, "0,1", $sort, $filter); |
|
18 | 18 | |
19 | 19 | if (!empty($spotter_array)) |
20 | 20 | { |
21 | - $title = sprintf(_("Most Common Arrival Airports by Country of %s"),$spotter_array[0]['pilot_name']); |
|
21 | + $title = sprintf(_("Most Common Arrival Airports by Country of %s"), $spotter_array[0]['pilot_name']); |
|
22 | 22 | require_once('header.php'); |
23 | 23 | print '<div class="info column">'; |
24 | 24 | print '<h1>'.$spotter_array[0]['pilot_name'].'</h1>'; |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | include('pilot-sub-menu.php'); |
30 | 30 | print '<div class="column">'; |
31 | 31 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
32 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights piloted by <strong>%s</strong>."),$spotter_array[0]['pilot_name']).'</p>'; |
|
33 | - $airport_country_array = $Spotter->countAllArrivalAirportCountriesByPilot($pilot,$filter); |
|
32 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights piloted by <strong>%s</strong>."), $spotter_array[0]['pilot_name']).'</p>'; |
|
33 | + $airport_country_array = $Spotter->countAllArrivalAirportCountriesByPilot($pilot, $filter); |
|
34 | 34 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
35 | 35 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
36 | 36 | print '<script type="text/javascript" src="'.$globalURL.'/js/datamaps.world.min.js"></script>'; |
37 | 37 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
38 | 38 | print 'var series = ['; |
39 | 39 | $country_data = ''; |
40 | - foreach($airport_country_array as $airport_item) |
|
40 | + foreach ($airport_country_array as $airport_item) |
|
41 | 41 | { |
42 | 42 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
43 | 43 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | print '</thead>'; |
85 | 85 | print '<tbody>'; |
86 | 86 | $i = 1; |
87 | - foreach($airport_country_array as $airport_item) |
|
87 | + foreach ($airport_country_array as $airport_item) |
|
88 | 88 | { |
89 | 89 | print '<tr>'; |
90 | 90 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | require_once('require/class.Spotter.php'); |
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Spotter = new Spotter(); |
6 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
7 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
8 | -$spotter_array = $Spotter->getSpotterDataByDate($date,"0,1", $sort); |
|
6 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
7 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
8 | +$spotter_array = $Spotter->getSpotterDataByDate($date, "0,1", $sort); |
|
9 | 9 | |
10 | 10 | if (!empty($spotter_array)) |
11 | 11 | { |
12 | - $title = sprintf(_("Most Common Arrival Airports on %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
12 | + $title = sprintf(_("Most Common Arrival Airports on %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
13 | 13 | |
14 | 14 | require_once('header.php'); |
15 | 15 | print '<div class="select-item">'; |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
28 | 28 | print '<br />'; |
29 | 29 | print '<div class="info column">'; |
30 | - print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
30 | + print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
31 | 31 | print '</div>'; |
32 | 32 | |
33 | 33 | include('date-sub-menu.php'); |
34 | 34 | print '<div class="column">'; |
35 | 35 | print '<h2>'._("Most Common Arrival Airports").'</h2>'; |
36 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
36 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports of flights on <strong>%s</strong>."), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
37 | 37 | $airport_airport_array = $Spotter->countAllArrivalAirportsByDate($date); |
38 | 38 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
39 | 39 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | print '<script>'; |
43 | 43 | print 'var series = ['; |
44 | 44 | $airport_data = ''; |
45 | - foreach($airport_airport_array as $airport_item) |
|
45 | + foreach ($airport_airport_array as $airport_item) |
|
46 | 46 | { |
47 | 47 | $airport_data .= '[ "'.$airport_item['airport_arrival_icao_count'].'", "'.$airport_item['airport_arrival_icao'].'",'.$airport_item['airport_arrival_latitude'].','.$airport_item['airport_arrival_longitude'].'],'; |
48 | 48 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | print '</thead>'; |
98 | 98 | print '<tbody>'; |
99 | 99 | $i = 1; |
100 | - foreach($airport_airport_array as $airport_item) |
|
100 | + foreach ($airport_airport_array as $airport_item) |
|
101 | 101 | { |
102 | 102 | print '<tr>'; |
103 | 103 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $title = _("Unknown Date"); |
123 | 123 | require_once('header.php'); |
124 | 124 | print '<h1>'._("Error").'</h1>'; |
125 | - print '<p>'._("Sorry, this date does not exist in this database. :(");'</p>'; |
|
125 | + print '<p>'._("Sorry, this date does not exist in this database. :("); '</p>'; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | require_once('footer.php'); |
@@ -7,13 +7,13 @@ discard block |
||
7 | 7 | die(); |
8 | 8 | } |
9 | 9 | $Spotter = new Spotter(); |
10 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
11 | -$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
12 | -$spotter_array = $Spotter->getSpotterDataByIdent($ident,"0,1", $sort); |
|
10 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
11 | +$ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
12 | +$spotter_array = $Spotter->getSpotterDataByIdent($ident, "0,1", $sort); |
|
13 | 13 | |
14 | 14 | if (!empty($spotter_array)) |
15 | 15 | { |
16 | - $title = sprintf(_("Most Common Arrival Airports by Country of %s"),$spotter_array[0]['ident']); |
|
16 | + $title = sprintf(_("Most Common Arrival Airports by Country of %s"), $spotter_array[0]['ident']); |
|
17 | 17 | require_once('header.php'); |
18 | 18 | print '<div class="info column">'; |
19 | 19 | print '<h1>'.$spotter_array[0]['ident'].'</h1>'; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | include('ident-sub-menu.php'); |
25 | 25 | print '<div class="column">'; |
26 | 26 | print '<h2>'._("Most Common Arrival Airports by Country").'</h2>'; |
27 | - print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."),$spotter_array[0]['ident']).'</p>'; |
|
27 | + print '<p>'.sprintf(_("The statistic below shows all arrival airports by Country of origin of flights with the ident/callsign <strong>%s</strong>."), $spotter_array[0]['ident']).'</p>'; |
|
28 | 28 | $airport_country_array = $Spotter->countAllArrivalAirportCountriesByIdent($ident); |
29 | 29 | print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>'; |
30 | 30 | print '<script type="text/javascript" src="'.$globalURL.'/js/topojson.v2.min.js"></script>'; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | print '<div id="chartCountry" class="chart" width="100%"></div><script>'; |
33 | 33 | print 'var series = ['; |
34 | 34 | $country_data = ''; |
35 | - foreach($airport_country_array as $airport_item) |
|
35 | + foreach ($airport_country_array as $airport_item) |
|
36 | 36 | { |
37 | 37 | $country_data .= '[ "'.$airport_item['arrival_airport_country_iso3'].'",'.$airport_item['airport_arrival_country_count'].'],'; |
38 | 38 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | print '</thead>'; |
81 | 81 | print '<tbody>'; |
82 | 82 | $i = 1; |
83 | - foreach($airport_country_array as $airport_item) |
|
83 | + foreach ($airport_country_array as $airport_item) |
|
84 | 84 | { |
85 | 85 | print '<tr>'; |
86 | 86 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -177,7 +177,7 @@ |
||
177 | 177 | } else { |
178 | 178 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
179 | 179 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
180 | - $(".archivebox").html('<h4><?php echo str_replace("'","\'",_("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>'); |
|
180 | + $(".archivebox").html('<h4><?php echo str_replace("'", "\'", _("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>'); |
|
181 | 181 | } |
182 | 182 | function TrackericonColor(color) { |
183 | 183 | document.cookie = 'TrackerIconColor='+color.substring(1)+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
@@ -131,7 +131,7 @@ |
||
131 | 131 | } else { |
132 | 132 | var clockViewModel = new Cesium.ClockViewModel(viewer.clock); |
133 | 133 | var animationViewModel = new Cesium.AnimationViewModel(clockViewModel); |
134 | - $(".archivebox").html('<h4><?php echo str_replace("'","\'",_("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>'); |
|
134 | + $(".archivebox").html('<h4><?php echo str_replace("'", "\'", _("Archive")); ?></h4>' + '<br/><form id="noarchive" method="post"><input type="hidden" name="noarchive" /></form><a href="#" onClick="animationViewModel.playReverseViewModel.command();"><i class="fa fa-play fa-flip-horizontal" aria-hidden="true"></i></a> <a href="#" onClick="'+"document.getElementById('noarchive').submit();"+'"><i class="fa fa-eject" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.pauseViewModel.command();"><i class="fa fa-pause" aria-hidden="true"></i></a> <a href="#" onClick="animationViewModel.playForwardViewModel.command();"><i class="fa fa-play" aria-hidden="true"></i></a>'); |
|
135 | 135 | } |
136 | 136 | function MarineiconColor(color) { |
137 | 137 | document.cookie = 'MarineIconColor='+color.substring(1)+'; expires=Thu, 2 Aug 2100 20:47:11 UTC; path=/' |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | } else return $ident; |
32 | 32 | } else return $ident; |
33 | 33 | if ($airline_icao == 'AF') { |
34 | - if (filter_var(substr($ident,2),FILTER_VALIDATE_INT,array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $ident; |
|
35 | - else $icao = 'AFR'.ltrim(substr($ident,2),'0'); |
|
34 | + if (filter_var(substr($ident, 2), FILTER_VALIDATE_INT, array("flags"=>FILTER_FLAG_ALLOW_OCTAL))) $icao = $ident; |
|
35 | + else $icao = 'AFR'.ltrim(substr($ident, 2), '0'); |
|
36 | 36 | } else { |
37 | 37 | $identicao = $Spotter->getAllAirlineInfo($airline_icao); |
38 | 38 | if (isset($identicao[0])) { |
39 | - $icao = $identicao[0]['icao'].ltrim(substr($ident,2),'0'); |
|
39 | + $icao = $identicao[0]['icao'].ltrim(substr($ident, 2), '0'); |
|
40 | 40 | } else $icao = $ident; |
41 | 41 | } |
42 | 42 | return $icao; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | try { |
49 | 49 | $sth = $this->db->prepare($query); |
50 | 50 | $sth->execute($query_values); |
51 | - } catch(PDOException $e) { |
|
51 | + } catch (PDOException $e) { |
|
52 | 52 | return "error : ".$e->getMessage(); |
53 | 53 | } |
54 | 54 | $row = $sth->fetch(PDO::FETCH_ASSOC); |
@@ -58,29 +58,29 @@ discard block |
||
58 | 58 | } else return $ident; |
59 | 59 | } |
60 | 60 | |
61 | - public function addOperator($ident,$correct_ident,$source) { |
|
61 | + public function addOperator($ident, $correct_ident, $source) { |
|
62 | 62 | $query = "INSERT INTO translation (Operator,Operator_correct,Source) VALUES (:ident,:correct_ident,:source)"; |
63 | - $query_values = array(':ident' => $ident,':correct_ident' => $correct_ident, ':source' => $source); |
|
63 | + $query_values = array(':ident' => $ident, ':correct_ident' => $correct_ident, ':source' => $source); |
|
64 | 64 | try { |
65 | 65 | $sth = $this->db->prepare($query); |
66 | 66 | $sth->execute($query_values); |
67 | - } catch(PDOException $e) { |
|
67 | + } catch (PDOException $e) { |
|
68 | 68 | return "error : ".$e->getMessage(); |
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - public function updateOperator($ident,$correct_ident,$source) { |
|
72 | + public function updateOperator($ident, $correct_ident, $source) { |
|
73 | 73 | $query = "UPDATE translation SET Operator_correct = :correct_ident,Source = :source WHERE Operator = :ident"; |
74 | - $query_values = array(':ident' => $ident,':correct_ident' => $correct_ident, ':source' => $source); |
|
74 | + $query_values = array(':ident' => $ident, ':correct_ident' => $correct_ident, ':source' => $source); |
|
75 | 75 | try { |
76 | 76 | $sth = $this->db->prepare($query); |
77 | 77 | $sth->execute($query_values); |
78 | - } catch(PDOException $e) { |
|
78 | + } catch (PDOException $e) { |
|
79 | 79 | return "error : ".$e->getMessage(); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | - public function checkTranslation($ident,$web = false) { |
|
83 | + public function checkTranslation($ident, $web = false) { |
|
84 | 84 | global $globalTranslationSources, $globalTranslationFetch; |
85 | 85 | //if (!isset($globalTranslationSources)) $globalTranslationSources = array('planefinder'); |
86 | 86 | $globalTranslationSources = array(); |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | function __construct($dbs = null) { |
13 | 13 | if ($dbs === null) { |
14 | - $Connection = new Connection(null,'server'); |
|
14 | + $Connection = new Connection(null, 'server'); |
|
15 | 15 | $this->dbs = $Connection->dbs; |
16 | 16 | $query = "CREATE TABLE IF NOT EXISTS `spotter_temp` ( `id_data` INT NOT NULL AUTO_INCREMENT , `id_user` INT NOT NULL , `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , `hex` VARCHAR(20) NOT NULL , `ident` VARCHAR(20) NULL , `latitude` FLOAT NULL , `longitude` FLOAT NULL , `verticalrate` INT NULL , `speed` INT NULL , `squawk` INT NULL , `altitude` INT NULL , `heading` INT NULL , `registration` VARCHAR(10) NULL , `aircraft_icao` VARCHAR(10) NULL , `waypoints` VARCHAR(255) NULL , `noarchive` BOOLEAN NOT NULL DEFAULT FALSE, `id_source` INT NOT NULL DEFAULT '1', `format_source` VARCHAR(25) NULL, `source_name` VARCHAR(25) NULL, `over_country` VARCHAR(255) NULL, PRIMARY KEY (`id_data`) ) ENGINE = MEMORY;"; |
17 | 17 | try { |
18 | 18 | $sth = $this->dbs['server']->exec($query); |
19 | - } catch(PDOException $e) { |
|
19 | + } catch (PDOException $e) { |
|
20 | 20 | return "error : ".$e->getMessage(); |
21 | 21 | } |
22 | 22 | } |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | date_default_timezone_set('UTC'); |
32 | 32 | //if (isset($line['format_source']) && ($line['format_source'] === 'sbs' || $line['format_source'] === 'tsv' || $line['format_source'] === 'raw' || $line['format_source'] === 'deltadbtxt' || $line['format_source'] === 'aprs')) { |
33 | 33 | if (isset($line['format_source'])) { |
34 | - if(is_array($line) && isset($line['hex'])) { |
|
34 | + if (is_array($line) && isset($line['hex'])) { |
|
35 | 35 | if ($line['hex'] != '' && $line['hex'] != '00000' && $line['hex'] != '000000' && $line['hex'] != '111111' && ctype_xdigit($line['hex']) && strlen($line['hex']) === 6) { |
36 | 36 | $data['hex'] = trim($line['hex']); |
37 | - if (preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/',$line['datetime'])) { |
|
37 | + if (preg_match('/^(\d{4}(?:\-\d{2}){2} \d{2}(?:\:\d{2}){2})$/', $line['datetime'])) { |
|
38 | 38 | $data['datetime'] = $line['datetime']; |
39 | 39 | } else $data['datetime'] = date('Y-m-d H:i:s'); |
40 | 40 | if (!isset($line['aircraft_icao'])) { |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | if ($id_user == NULL) $id_user = 1; |
111 | 111 | if (!isset($id_source)) $id_source = 1; |
112 | 112 | $query = 'INSERT INTO spotter_temp (id_user,datetime,hex,ident,latitude,longitude,verticalrate,speed,squawk,altitude,heading,registration,aircraft_icao,waypoints,id_source,noarchive,format_source,source_name,over_country) VALUES (:id_user,:datetime,:hex,:ident,:latitude,:longitude,:verticalrate,:speed,:squawk,:altitude,:heading,:registration,:aircraft_icao,:waypoints,:id_source,:noarchive, :format_source, :source_name, :over_country)'; |
113 | - $query_values = array(':id_user' => $id_user,':datetime' => $data['datetime'],':hex' => $data['hex'],':ident' => $data['ident'],':latitude' => $data['latitude'],':longitude' => $data['longitude'],':verticalrate' => $data['verticalrate'],':speed' => $data['speed'],':squawk' => $data['squawk'],':altitude' => $data['altitude'],':heading' => $data['heading'],':registration' => $data['registration'],':aircraft_icao' => $data['aircraft_icao'],':waypoints' => $data['waypoints'],':id_source' => $id_source,':noarchive' => $data['noarchive'], ':format_source' => $data['format_source'], ':source_name' => $data['source_name'],':over_country' => $data['over_country']); |
|
113 | + $query_values = array(':id_user' => $id_user, ':datetime' => $data['datetime'], ':hex' => $data['hex'], ':ident' => $data['ident'], ':latitude' => $data['latitude'], ':longitude' => $data['longitude'], ':verticalrate' => $data['verticalrate'], ':speed' => $data['speed'], ':squawk' => $data['squawk'], ':altitude' => $data['altitude'], ':heading' => $data['heading'], ':registration' => $data['registration'], ':aircraft_icao' => $data['aircraft_icao'], ':waypoints' => $data['waypoints'], ':id_source' => $id_source, ':noarchive' => $data['noarchive'], ':format_source' => $data['format_source'], ':source_name' => $data['source_name'], ':over_country' => $data['over_country']); |
|
114 | 114 | try { |
115 | 115 | $sth = $this->dbs['server']->prepare($query); |
116 | 116 | $sth->execute($query_values); |
117 | - } catch(PDOException $e) { |
|
117 | + } catch (PDOException $e) { |
|
118 | 118 | return "error : ".$e->getMessage(); |
119 | 119 | } |
120 | 120 | } |