@@ -2,34 +2,34 @@ discard block |
||
2 | 2 | require_once('require/class.Connection.php'); |
3 | 3 | require_once('require/class.Language.php'); |
4 | 4 | $type = ''; |
5 | -$date = filter_input(INPUT_GET,'date',FILTER_SANITIZE_STRING); |
|
5 | +$date = filter_input(INPUT_GET, 'date', FILTER_SANITIZE_STRING); |
|
6 | 6 | if (isset($_GET['marine'])) { |
7 | - require_once('require/class.Marine.php');; |
|
7 | + require_once('require/class.Marine.php'); ; |
|
8 | 8 | $Marine = new Marine(); |
9 | 9 | $type = 'marine'; |
10 | 10 | $page_url = $globalURL.'/marine/date/'.$date; |
11 | 11 | } elseif (isset($_GET['tracker'])) { |
12 | - require_once('require/class.Tracker.php');; |
|
12 | + require_once('require/class.Tracker.php'); ; |
|
13 | 13 | $Tracker = new Tracker(); |
14 | 14 | $type = 'tracker'; |
15 | 15 | $page_url = $globalURL.'/tracker/date/'.$date; |
16 | 16 | } else { |
17 | - require_once('require/class.Spotter.php');; |
|
17 | + require_once('require/class.Spotter.php'); ; |
|
18 | 18 | $Spotter = new Spotter(); |
19 | 19 | $type = 'aircraft'; |
20 | 20 | $page_url = $globalURL.'/date/'.$date; |
21 | 21 | } |
22 | 22 | |
23 | -if (!isset($_GET['date'])){ |
|
23 | +if (!isset($_GET['date'])) { |
|
24 | 24 | header('Location: '.$globalURL.''); |
25 | 25 | } else { |
26 | 26 | //calculuation for the pagination |
27 | - if(!isset($_GET['limit'])) |
|
27 | + if (!isset($_GET['limit'])) |
|
28 | 28 | { |
29 | 29 | $limit_start = 0; |
30 | 30 | $limit_end = 25; |
31 | 31 | $absolute_difference = 25; |
32 | - } else { |
|
32 | + } else { |
|
33 | 33 | $limit_explode = explode(",", $_GET['limit']); |
34 | 34 | $limit_start = $limit_explode[0]; |
35 | 35 | $limit_end = $limit_explode[1]; |
@@ -43,24 +43,24 @@ discard block |
||
43 | 43 | $limit_previous_1 = $limit_start - $absolute_difference; |
44 | 44 | $limit_previous_2 = $limit_end - $absolute_difference; |
45 | 45 | |
46 | - $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
46 | + $sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
47 | 47 | if ($sort != '') |
48 | 48 | { |
49 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
50 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
51 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
49 | + if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date, $limit_start.",".$absolute_difference, $sort); |
|
50 | + elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date, $limit_start.",".$absolute_difference, $sort); |
|
51 | + else $spotter_array = $Spotter->getSpotterDataByDate($date, $limit_start.",".$absolute_difference, $sort); |
|
52 | 52 | } else { |
53 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference); |
|
54 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference); |
|
55 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
53 | + if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date, $limit_start.",".$absolute_difference); |
|
54 | + elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date, $limit_start.",".$absolute_difference); |
|
55 | + else $spotter_array = $Spotter->getSpotterDataByDate($date, $limit_start.",".$absolute_difference); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if (!empty($spotter_array)) |
59 | 59 | { |
60 | 60 | date_default_timezone_set($globalTimezone); |
61 | - if ($type == 'marine') $title = sprintf(_("Detailed View for vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
62 | - elseif ($type == 'tracker') $title = sprintf(_("Detailed View for trackers from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
63 | - else $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
61 | + if ($type == 'marine') $title = sprintf(_("Detailed View for vessels from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
62 | + elseif ($type == 'tracker') $title = sprintf(_("Detailed View for trackers from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
63 | + else $title = sprintf(_("Detailed View for flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
64 | 64 | |
65 | 65 | require_once('header.php'); |
66 | 66 | print '<div class="select-item">'; |
@@ -78,15 +78,15 @@ discard block |
||
78 | 78 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
79 | 79 | print '<br />'; |
80 | 80 | print '<div class="info column">'; |
81 | - if ($type == 'marine') print '<h1>'.sprintf(_("Vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
82 | - else print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
81 | + if ($type == 'marine') print '<h1>'.sprintf(_("Vessels from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
82 | + else print '<h1>'.sprintf(_("Flights from %s"), date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
83 | 83 | print '</div>'; |
84 | 84 | |
85 | 85 | if ($type == 'aircraft') include('date-sub-menu.php'); |
86 | 86 | print '<div class="table column">'; |
87 | - if ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
88 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
89 | - else print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
87 | + if ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."), date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
88 | + elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."), date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
89 | + else print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."), date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
90 | 90 | |
91 | 91 | include('table-output.php'); |
92 | 92 | print '<div class="pagination">'; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $limit_start = 0; |
30 | 30 | $limit_end = 25; |
31 | 31 | $absolute_difference = 25; |
32 | - } else { |
|
32 | + } else { |
|
33 | 33 | $limit_explode = explode(",", $_GET['limit']); |
34 | 34 | $limit_start = $limit_explode[0]; |
35 | 35 | $limit_end = $limit_explode[1]; |
@@ -46,21 +46,33 @@ discard block |
||
46 | 46 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
47 | 47 | if ($sort != '') |
48 | 48 | { |
49 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
50 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
51 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
49 | + if ($type == 'marine') { |
|
50 | + $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
51 | + } elseif ($type == 'tracker') { |
|
52 | + $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
53 | + } else { |
|
54 | + $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference, $sort); |
|
55 | + } |
|
52 | 56 | } else { |
53 | - if ($type == 'marine') $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference); |
|
54 | - elseif ($type == 'tracker') $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference); |
|
55 | - else $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
57 | + if ($type == 'marine') { |
|
58 | + $spotter_array = $Marine->getMarineDataByDate($date,$limit_start.",".$absolute_difference); |
|
59 | + } elseif ($type == 'tracker') { |
|
60 | + $spotter_array = $Tracker->getTrackerDataByDate($date,$limit_start.",".$absolute_difference); |
|
61 | + } else { |
|
62 | + $spotter_array = $Spotter->getSpotterDataByDate($date,$limit_start.",".$absolute_difference); |
|
63 | + } |
|
56 | 64 | } |
57 | 65 | |
58 | 66 | if (!empty($spotter_array)) |
59 | 67 | { |
60 | 68 | date_default_timezone_set($globalTimezone); |
61 | - if ($type == 'marine') $title = sprintf(_("Detailed View for vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
62 | - elseif ($type == 'tracker') $title = sprintf(_("Detailed View for trackers from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
63 | - else $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
69 | + if ($type == 'marine') { |
|
70 | + $title = sprintf(_("Detailed View for vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
71 | + } elseif ($type == 'tracker') { |
|
72 | + $title = sprintf(_("Detailed View for trackers from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
73 | + } else { |
|
74 | + $title = sprintf(_("Detailed View for flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))); |
|
75 | + } |
|
64 | 76 | |
65 | 77 | require_once('header.php'); |
66 | 78 | print '<div class="select-item">'; |
@@ -78,15 +90,24 @@ discard block |
||
78 | 90 | print '<script type="text/javascript">$(function () { $("#datepicker").datetimepicker({ format: "YYYY-MM-DD", defaultDate: "'.$date.'" }); }); </script>'; |
79 | 91 | print '<br />'; |
80 | 92 | print '<div class="info column">'; |
81 | - if ($type == 'marine') print '<h1>'.sprintf(_("Vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
82 | - else print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
93 | + if ($type == 'marine') { |
|
94 | + print '<h1>'.sprintf(_("Vessels from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
95 | + } else { |
|
96 | + print '<h1>'.sprintf(_("Flights from %s"),date("l F j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</h1>'; |
|
97 | + } |
|
83 | 98 | print '</div>'; |
84 | 99 | |
85 | - if ($type == 'aircraft') include('date-sub-menu.php'); |
|
100 | + if ($type == 'aircraft') { |
|
101 | + include('date-sub-menu.php'); |
|
102 | + } |
|
86 | 103 | print '<div class="table column">'; |
87 | - if ($type == 'marine') print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
88 | - elseif ($type == 'tracker') print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
89 | - else print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
104 | + if ($type == 'marine') { |
|
105 | + print '<p>'.sprintf(_("The table below shows the detailed information of all vessels on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
106 | + } elseif ($type == 'tracker') { |
|
107 | + print '<p>'.sprintf(_("The table below shows the detailed information of all trackers on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
108 | + } else { |
|
109 | + print '<p>'.sprintf(_("The table below shows the detailed information of all flights on <strong>%s</strong>."),date("l M j, Y", strtotime($spotter_array[0]['date_iso_8601']))).'</p>'; |
|
110 | + } |
|
90 | 111 | |
91 | 112 | include('table-output.php'); |
92 | 113 | print '<div class="pagination">'; |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | require_once('header.php'); |
24 | 24 | |
25 | 25 | //calculuation for the pagination |
26 | -if(!isset($_GET['limit'])) |
|
26 | +if (!isset($_GET['limit'])) |
|
27 | 27 | { |
28 | 28 | $limit_start = 0; |
29 | 29 | $limit_end = 25; |
30 | 30 | $absolute_difference = 25; |
31 | -} else { |
|
31 | +} else { |
|
32 | 32 | $limit_explode = explode(",", $_GET['limit']); |
33 | 33 | $limit_start = $limit_explode[0]; |
34 | 34 | $limit_end = $limit_explode[1]; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | elseif ($type == 'tracker') print '<p>'._("The table below shows the detailed information of all recent trackers.").'</p>'; |
52 | 52 | else print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
53 | 53 | |
54 | -$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
|
54 | +$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING); |
|
55 | 55 | $sql_begin = microtime(true); |
56 | 56 | if ($type == 'marine') { |
57 | 57 | $spotter_array = $Marine->getLatestMarineData($limit_start.",".$absolute_difference, $sort); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } else { |
61 | 61 | $spotter_array = $Spotter->getLatestSpotterData($limit_start.",".$absolute_difference, $sort); |
62 | 62 | } |
63 | -$sql_time = microtime(true)-$sql_begin; |
|
63 | +$sql_time = microtime(true) - $sql_begin; |
|
64 | 64 | $page_begin = microtime(true); |
65 | 65 | if (!empty($spotter_array)) |
66 | 66 | { |
@@ -77,6 +77,6 @@ discard block |
||
77 | 77 | print '</div>'; |
78 | 78 | print '</div>'; |
79 | 79 | } |
80 | -$page_time = microtime(true)-$page_begin; |
|
80 | +$page_time = microtime(true) - $page_begin; |
|
81 | 81 | require_once('footer.php'); |
82 | 82 | ?> |
83 | 83 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $limit_start = 0; |
29 | 29 | $limit_end = 25; |
30 | 30 | $absolute_difference = 25; |
31 | -} else { |
|
31 | +} else { |
|
32 | 32 | $limit_explode = explode(",", $_GET['limit']); |
33 | 33 | $limit_start = $limit_explode[0]; |
34 | 34 | $limit_end = $limit_explode[1]; |
@@ -47,9 +47,13 @@ discard block |
||
47 | 47 | print '<h1>'._("Latest Activity").'</h1>'; |
48 | 48 | print '</div>'; |
49 | 49 | print '<div class="table column">'; |
50 | -if ($type == 'marine') print '<p>'._("The table below shows the detailed information of all recent vessels.").'</p>'; |
|
51 | -elseif ($type == 'tracker') print '<p>'._("The table below shows the detailed information of all recent trackers.").'</p>'; |
|
52 | -else print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
|
50 | +if ($type == 'marine') { |
|
51 | + print '<p>'._("The table below shows the detailed information of all recent vessels.").'</p>'; |
|
52 | +} elseif ($type == 'tracker') { |
|
53 | + print '<p>'._("The table below shows the detailed information of all recent trackers.").'</p>'; |
|
54 | +} else { |
|
55 | + print '<p>'._("The table below shows the detailed information of all recent flights.").'</p>'; |
|
56 | +} |
|
53 | 57 | |
54 | 58 | $sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING); |
55 | 59 | $sql_begin = microtime(true); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * Get SQL query part for filter used |
16 | 16 | * @param Array $filter the filter |
17 | - * @return Array the SQL part |
|
17 | + * @return string the SQL part |
|
18 | 18 | */ |
19 | 19 | public function getFilter($filter = array(),$where = false,$and = false) { |
20 | 20 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | } |
11 | 11 | |
12 | 12 | /** |
13 | - * Get SQL query part for filter used |
|
14 | - * @param Array $filter the filter |
|
15 | - * @return Array the SQL part |
|
16 | - */ |
|
13 | + * Get SQL query part for filter used |
|
14 | + * @param Array $filter the filter |
|
15 | + * @return Array the SQL part |
|
16 | + */ |
|
17 | 17 | public function getFilter($filter = array(),$where = false,$and = false) { |
18 | 18 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
19 | 19 | $filters = array(); |
@@ -106,44 +106,44 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | - /** |
|
110 | - * Gets all the spotter information based on a particular callsign |
|
111 | - * |
|
112 | - * @return Array the spotter information |
|
113 | - * |
|
114 | - */ |
|
115 | - public function getLastArchiveTrackerDataByIdent($ident) |
|
116 | - { |
|
109 | + /** |
|
110 | + * Gets all the spotter information based on a particular callsign |
|
111 | + * |
|
112 | + * @return Array the spotter information |
|
113 | + * |
|
114 | + */ |
|
115 | + public function getLastArchiveTrackerDataByIdent($ident) |
|
116 | + { |
|
117 | 117 | $Tracker = new Tracker($this->db); |
118 | - date_default_timezone_set('UTC'); |
|
118 | + date_default_timezone_set('UTC'); |
|
119 | 119 | |
120 | - $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
121 | - //$query = "SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
122 | - $query = "SELECT tracker_archive.* FROM tracker_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1"; |
|
120 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
121 | + //$query = "SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
122 | + $query = "SELECT tracker_archive.* FROM tracker_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1"; |
|
123 | 123 | |
124 | - $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident)); |
|
124 | + $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident)); |
|
125 | 125 | |
126 | - return $spotter_array; |
|
127 | - } |
|
126 | + return $spotter_array; |
|
127 | + } |
|
128 | 128 | |
129 | 129 | |
130 | - /** |
|
131 | - * Gets last the spotter information based on a particular id |
|
132 | - * |
|
133 | - * @return Array the spotter information |
|
134 | - * |
|
135 | - */ |
|
136 | - public function getLastArchiveTrackerDataById($id) |
|
137 | - { |
|
138 | - $Tracker = new Tracker($this->db); |
|
139 | - date_default_timezone_set('UTC'); |
|
140 | - $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
141 | - //$query = TrackerArchive->$global_query." WHERE tracker_archive.famtrackid = :id"; |
|
142 | - //$query = "SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.famtrackid = :id GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
143 | - $query = "SELECT * FROM tracker_archive WHERE famtrackid = :id ORDER BY date DESC LIMIT 1"; |
|
130 | + /** |
|
131 | + * Gets last the spotter information based on a particular id |
|
132 | + * |
|
133 | + * @return Array the spotter information |
|
134 | + * |
|
135 | + */ |
|
136 | + public function getLastArchiveTrackerDataById($id) |
|
137 | + { |
|
138 | + $Tracker = new Tracker($this->db); |
|
139 | + date_default_timezone_set('UTC'); |
|
140 | + $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
141 | + //$query = TrackerArchive->$global_query." WHERE tracker_archive.famtrackid = :id"; |
|
142 | + //$query = "SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.famtrackid = :id GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
143 | + $query = "SELECT * FROM tracker_archive WHERE famtrackid = :id ORDER BY date DESC LIMIT 1"; |
|
144 | 144 | |
145 | 145 | // $spotter_array = Tracker->getDataFromDB($query,array(':id' => $id)); |
146 | - /* |
|
146 | + /* |
|
147 | 147 | try { |
148 | 148 | $Connection = new Connection(); |
149 | 149 | $sth = Connection->$db->prepare($query); |
@@ -153,189 +153,189 @@ discard block |
||
153 | 153 | } |
154 | 154 | $spotter_array = $sth->fetchAll(PDO->FETCH_ASSOC); |
155 | 155 | */ |
156 | - $spotter_array = $Tracker->getDataFromDB($query,array(':id' => $id)); |
|
157 | - |
|
158 | - return $spotter_array; |
|
159 | - } |
|
160 | - |
|
161 | - /** |
|
162 | - * Gets all the spotter information based on a particular id |
|
163 | - * |
|
164 | - * @return Array the spotter information |
|
165 | - * |
|
166 | - */ |
|
167 | - public function getAllArchiveTrackerDataById($id,$date = '') |
|
156 | + $spotter_array = $Tracker->getDataFromDB($query,array(':id' => $id)); |
|
157 | + |
|
158 | + return $spotter_array; |
|
159 | + } |
|
160 | + |
|
161 | + /** |
|
162 | + * Gets all the spotter information based on a particular id |
|
163 | + * |
|
164 | + * @return Array the spotter information |
|
165 | + * |
|
166 | + */ |
|
167 | + public function getAllArchiveTrackerDataById($id,$date = '') |
|
168 | 168 | { |
169 | - date_default_timezone_set('UTC'); |
|
170 | - $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
171 | - if ($date == '') $query = $this->global_query." WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
172 | - else $query = $this->global_query." WHERE tracker_archive.famtrackid = :id AND date < '".date('c',$date)."' ORDER BY date"; |
|
169 | + date_default_timezone_set('UTC'); |
|
170 | + $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
171 | + if ($date == '') $query = $this->global_query." WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
172 | + else $query = $this->global_query." WHERE tracker_archive.famtrackid = :id AND date < '".date('c',$date)."' ORDER BY date"; |
|
173 | 173 | |
174 | 174 | // $spotter_array = Tracker->getDataFromDB($query,array(':id' => $id)); |
175 | 175 | |
176 | - try { |
|
177 | - $sth = $this->db->prepare($query); |
|
178 | - $sth->execute(array(':id' => $id)); |
|
179 | - } catch(PDOException $e) { |
|
180 | - echo $e->getMessage(); |
|
181 | - die; |
|
182 | - } |
|
183 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
184 | - |
|
185 | - return $spotter_array; |
|
186 | - } |
|
187 | - |
|
188 | - /** |
|
189 | - * Gets coordinate & time spotter information based on a particular id |
|
190 | - * |
|
191 | - * @return Array the spotter information |
|
192 | - * |
|
193 | - */ |
|
194 | - public function getCoordArchiveTrackerDataById($id) |
|
195 | - { |
|
196 | - date_default_timezone_set('UTC'); |
|
197 | - $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
198 | - $query = "SELECT tracker_archive.latitude, tracker_archive.longitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id"; |
|
176 | + try { |
|
177 | + $sth = $this->db->prepare($query); |
|
178 | + $sth->execute(array(':id' => $id)); |
|
179 | + } catch(PDOException $e) { |
|
180 | + echo $e->getMessage(); |
|
181 | + die; |
|
182 | + } |
|
183 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
184 | + |
|
185 | + return $spotter_array; |
|
186 | + } |
|
187 | + |
|
188 | + /** |
|
189 | + * Gets coordinate & time spotter information based on a particular id |
|
190 | + * |
|
191 | + * @return Array the spotter information |
|
192 | + * |
|
193 | + */ |
|
194 | + public function getCoordArchiveTrackerDataById($id) |
|
195 | + { |
|
196 | + date_default_timezone_set('UTC'); |
|
197 | + $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
198 | + $query = "SELECT tracker_archive.latitude, tracker_archive.longitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id"; |
|
199 | 199 | |
200 | 200 | // $spotter_array = Tracker->getDataFromDB($query,array(':id' => $id)); |
201 | 201 | |
202 | - try { |
|
203 | - $sth = $this->db->prepare($query); |
|
204 | - $sth->execute(array(':id' => $id)); |
|
205 | - } catch(PDOException $e) { |
|
206 | - echo $e->getMessage(); |
|
207 | - die; |
|
208 | - } |
|
209 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
202 | + try { |
|
203 | + $sth = $this->db->prepare($query); |
|
204 | + $sth->execute(array(':id' => $id)); |
|
205 | + } catch(PDOException $e) { |
|
206 | + echo $e->getMessage(); |
|
207 | + die; |
|
208 | + } |
|
209 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
210 | 210 | |
211 | - return $spotter_array; |
|
212 | - } |
|
211 | + return $spotter_array; |
|
212 | + } |
|
213 | 213 | |
214 | 214 | |
215 | - /** |
|
216 | - * Gets altitude information based on a particular callsign |
|
217 | - * |
|
218 | - * @return Array the spotter information |
|
219 | - * |
|
220 | - */ |
|
221 | - public function getAltitudeArchiveTrackerDataByIdent($ident) |
|
222 | - { |
|
215 | + /** |
|
216 | + * Gets altitude information based on a particular callsign |
|
217 | + * |
|
218 | + * @return Array the spotter information |
|
219 | + * |
|
220 | + */ |
|
221 | + public function getAltitudeArchiveTrackerDataByIdent($ident) |
|
222 | + { |
|
223 | 223 | |
224 | - date_default_timezone_set('UTC'); |
|
224 | + date_default_timezone_set('UTC'); |
|
225 | 225 | |
226 | - $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
227 | - $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.ident = :ident AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
226 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
227 | + $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.ident = :ident AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
228 | 228 | |
229 | - try { |
|
230 | - $sth = $this->db->prepare($query); |
|
231 | - $sth->execute(array(':ident' => $ident)); |
|
232 | - } catch(PDOException $e) { |
|
233 | - echo $e->getMessage(); |
|
234 | - die; |
|
235 | - } |
|
236 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
229 | + try { |
|
230 | + $sth = $this->db->prepare($query); |
|
231 | + $sth->execute(array(':ident' => $ident)); |
|
232 | + } catch(PDOException $e) { |
|
233 | + echo $e->getMessage(); |
|
234 | + die; |
|
235 | + } |
|
236 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
237 | 237 | |
238 | - return $spotter_array; |
|
239 | - } |
|
238 | + return $spotter_array; |
|
239 | + } |
|
240 | 240 | |
241 | - /** |
|
242 | - * Gets altitude information based on a particular id |
|
243 | - * |
|
244 | - * @return Array the spotter information |
|
245 | - * |
|
246 | - */ |
|
247 | - public function getAltitudeArchiveTrackerDataById($id) |
|
248 | - { |
|
241 | + /** |
|
242 | + * Gets altitude information based on a particular id |
|
243 | + * |
|
244 | + * @return Array the spotter information |
|
245 | + * |
|
246 | + */ |
|
247 | + public function getAltitudeArchiveTrackerDataById($id) |
|
248 | + { |
|
249 | 249 | |
250 | - date_default_timezone_set('UTC'); |
|
250 | + date_default_timezone_set('UTC'); |
|
251 | 251 | |
252 | - $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
253 | - $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
252 | + $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
253 | + $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
254 | 254 | |
255 | - try { |
|
256 | - $sth = $this->db->prepare($query); |
|
257 | - $sth->execute(array(':id' => $id)); |
|
258 | - } catch(PDOException $e) { |
|
259 | - echo $e->getMessage(); |
|
260 | - die; |
|
261 | - } |
|
262 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
255 | + try { |
|
256 | + $sth = $this->db->prepare($query); |
|
257 | + $sth->execute(array(':id' => $id)); |
|
258 | + } catch(PDOException $e) { |
|
259 | + echo $e->getMessage(); |
|
260 | + die; |
|
261 | + } |
|
262 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
263 | 263 | |
264 | - return $spotter_array; |
|
265 | - } |
|
264 | + return $spotter_array; |
|
265 | + } |
|
266 | 266 | |
267 | - /** |
|
268 | - * Gets altitude & speed information based on a particular id |
|
269 | - * |
|
270 | - * @return Array the spotter information |
|
271 | - * |
|
272 | - */ |
|
273 | - public function getAltitudeSpeedArchiveTrackerDataById($id) |
|
274 | - { |
|
267 | + /** |
|
268 | + * Gets altitude & speed information based on a particular id |
|
269 | + * |
|
270 | + * @return Array the spotter information |
|
271 | + * |
|
272 | + */ |
|
273 | + public function getAltitudeSpeedArchiveTrackerDataById($id) |
|
274 | + { |
|
275 | 275 | |
276 | - date_default_timezone_set('UTC'); |
|
276 | + date_default_timezone_set('UTC'); |
|
277 | 277 | |
278 | - $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
279 | - $query = "SELECT tracker_archive.altitude, tracker_archive.ground_speed, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
278 | + $id = filter_var($id, FILTER_SANITIZE_STRING); |
|
279 | + $query = "SELECT tracker_archive.altitude, tracker_archive.ground_speed, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
280 | 280 | |
281 | - try { |
|
282 | - $sth = $this->db->prepare($query); |
|
283 | - $sth->execute(array(':id' => $id)); |
|
284 | - } catch(PDOException $e) { |
|
285 | - echo $e->getMessage(); |
|
286 | - die; |
|
287 | - } |
|
288 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
281 | + try { |
|
282 | + $sth = $this->db->prepare($query); |
|
283 | + $sth->execute(array(':id' => $id)); |
|
284 | + } catch(PDOException $e) { |
|
285 | + echo $e->getMessage(); |
|
286 | + die; |
|
287 | + } |
|
288 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
289 | 289 | |
290 | - return $spotter_array; |
|
291 | - } |
|
290 | + return $spotter_array; |
|
291 | + } |
|
292 | 292 | |
293 | 293 | |
294 | - /** |
|
295 | - * Gets altitude information based on a particular callsign |
|
296 | - * |
|
297 | - * @return Array the spotter information |
|
298 | - * |
|
299 | - */ |
|
300 | - public function getLastAltitudeArchiveTrackerDataByIdent($ident) |
|
301 | - { |
|
294 | + /** |
|
295 | + * Gets altitude information based on a particular callsign |
|
296 | + * |
|
297 | + * @return Array the spotter information |
|
298 | + * |
|
299 | + */ |
|
300 | + public function getLastAltitudeArchiveTrackerDataByIdent($ident) |
|
301 | + { |
|
302 | 302 | |
303 | - date_default_timezone_set('UTC'); |
|
303 | + date_default_timezone_set('UTC'); |
|
304 | 304 | |
305 | - $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
306 | - $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
305 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
306 | + $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
307 | 307 | // $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.ident = :ident"; |
308 | 308 | |
309 | - try { |
|
310 | - $sth = $this->db->prepare($query); |
|
311 | - $sth->execute(array(':ident' => $ident)); |
|
312 | - } catch(PDOException $e) { |
|
313 | - echo $e->getMessage(); |
|
314 | - die; |
|
315 | - } |
|
316 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
309 | + try { |
|
310 | + $sth = $this->db->prepare($query); |
|
311 | + $sth->execute(array(':ident' => $ident)); |
|
312 | + } catch(PDOException $e) { |
|
313 | + echo $e->getMessage(); |
|
314 | + die; |
|
315 | + } |
|
316 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
317 | 317 | |
318 | - return $spotter_array; |
|
319 | - } |
|
318 | + return $spotter_array; |
|
319 | + } |
|
320 | 320 | |
321 | 321 | |
322 | 322 | |
323 | - /** |
|
324 | - * Gets all the archive spotter information |
|
325 | - * |
|
326 | - * @return Array the spotter information |
|
327 | - * |
|
328 | - */ |
|
329 | - public function getTrackerArchiveData($ident,$famtrackid,$date) |
|
330 | - { |
|
331 | - $Tracker = new Tracker($this->db); |
|
332 | - $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
333 | - $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.famtrackid = :famtrackid AND l.date LIKE :date GROUP BY l.famtrackid) s on spotter_live.famtrackid = s.famtrackid AND spotter_live.date = s.maxdate"; |
|
323 | + /** |
|
324 | + * Gets all the archive spotter information |
|
325 | + * |
|
326 | + * @return Array the spotter information |
|
327 | + * |
|
328 | + */ |
|
329 | + public function getTrackerArchiveData($ident,$famtrackid,$date) |
|
330 | + { |
|
331 | + $Tracker = new Tracker($this->db); |
|
332 | + $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
|
333 | + $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.famtrackid = :famtrackid AND l.date LIKE :date GROUP BY l.famtrackid) s on spotter_live.famtrackid = s.famtrackid AND spotter_live.date = s.maxdate"; |
|
334 | 334 | |
335 | - $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident,':famtrackid' => $famtrackid,':date' => $date.'%')); |
|
335 | + $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident,':famtrackid' => $famtrackid,':date' => $date.'%')); |
|
336 | 336 | |
337 | - return $spotter_array; |
|
338 | - } |
|
337 | + return $spotter_array; |
|
338 | + } |
|
339 | 339 | |
340 | 340 | public function deleteTrackerArchiveTrackData() |
341 | 341 | { |
@@ -355,34 +355,34 @@ discard block |
||
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
358 | - * Gets Minimal Live Tracker data |
|
359 | - * |
|
360 | - * @return Array the spotter information |
|
361 | - * |
|
362 | - */ |
|
363 | - public function getMinLiveTrackerData($begindate,$enddate,$filter = array()) |
|
364 | - { |
|
365 | - global $globalDBdriver, $globalLiveInterval; |
|
366 | - date_default_timezone_set('UTC'); |
|
367 | - |
|
368 | - $filter_query = ''; |
|
369 | - if (isset($filter['source']) && !empty($filter['source'])) { |
|
370 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
371 | - } |
|
372 | - // Use spotter_output also ? |
|
373 | - if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
|
374 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
375 | - } |
|
376 | - if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
|
377 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
|
378 | - } |
|
379 | - if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
|
380 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
381 | - } |
|
358 | + * Gets Minimal Live Tracker data |
|
359 | + * |
|
360 | + * @return Array the spotter information |
|
361 | + * |
|
362 | + */ |
|
363 | + public function getMinLiveTrackerData($begindate,$enddate,$filter = array()) |
|
364 | + { |
|
365 | + global $globalDBdriver, $globalLiveInterval; |
|
366 | + date_default_timezone_set('UTC'); |
|
382 | 367 | |
383 | - //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
384 | - if ($globalDBdriver == 'mysql') { |
|
385 | - /* |
|
368 | + $filter_query = ''; |
|
369 | + if (isset($filter['source']) && !empty($filter['source'])) { |
|
370 | + $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
371 | + } |
|
372 | + // Use spotter_output also ? |
|
373 | + if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
|
374 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
375 | + } |
|
376 | + if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
|
377 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
|
378 | + } |
|
379 | + if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
|
380 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
381 | + } |
|
382 | + |
|
383 | + //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
384 | + if ($globalDBdriver == 'mysql') { |
|
385 | + /* |
|
386 | 386 | $query = 'SELECT a.aircraft_shadow, tracker_archive.ident, tracker_archive.famtrackid, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk |
387 | 387 | FROM tracker_archive |
388 | 388 | INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON tracker_archive.aircraft_icao = a.icao'; |
@@ -401,56 +401,56 @@ discard block |
||
401 | 401 | INNER JOIN (SELECT * FROM aircraft) a on tracker_archive.aircraft_icao = a.icao |
402 | 402 | WHERE tracker_archive.date BETWEEN '."'".$begindate."'".' AND '."'".$begindate."'".' |
403 | 403 | '.$filter_query.' ORDER BY famtrackid'; |
404 | - } else { |
|
405 | - //$query = 'SELECT tracker_archive.ident, tracker_archive.famtrackid, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on tracker_archive.aircraft_icao = a.icao'; |
|
406 | - $query = 'SELECT tracker_archive.date,tracker_archive.famtrackid, tracker_archive.ident, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
404 | + } else { |
|
405 | + //$query = 'SELECT tracker_archive.ident, tracker_archive.famtrackid, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on tracker_archive.aircraft_icao = a.icao'; |
|
406 | + $query = 'SELECT tracker_archive.date,tracker_archive.famtrackid, tracker_archive.ident, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
407 | 407 | FROM tracker_archive |
408 | 408 | INNER JOIN (SELECT * FROM aircraft) a on tracker_archive.aircraft_icao = a.icao |
409 | 409 | WHERE tracker_archive.date >= '."'".$begindate."'".' AND tracker_archive.date <= '."'".$enddate."'".' |
410 | 410 | '.$filter_query.' ORDER BY famtrackid'; |
411 | - } |
|
412 | - //echo $query; |
|
413 | - try { |
|
414 | - $sth = $this->db->prepare($query); |
|
415 | - $sth->execute(); |
|
416 | - } catch(PDOException $e) { |
|
417 | - echo $e->getMessage(); |
|
418 | - die; |
|
419 | - } |
|
420 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
411 | + } |
|
412 | + //echo $query; |
|
413 | + try { |
|
414 | + $sth = $this->db->prepare($query); |
|
415 | + $sth->execute(); |
|
416 | + } catch(PDOException $e) { |
|
417 | + echo $e->getMessage(); |
|
418 | + die; |
|
419 | + } |
|
420 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
421 | 421 | |
422 | - return $spotter_array; |
|
423 | - } |
|
422 | + return $spotter_array; |
|
423 | + } |
|
424 | 424 | |
425 | 425 | /** |
426 | - * Gets Minimal Live Tracker data |
|
427 | - * |
|
428 | - * @return Array the spotter information |
|
429 | - * |
|
430 | - */ |
|
431 | - public function getMinLiveTrackerDataPlayback($begindate,$enddate,$filter = array()) |
|
432 | - { |
|
433 | - global $globalDBdriver, $globalLiveInterval; |
|
434 | - date_default_timezone_set('UTC'); |
|
435 | - |
|
436 | - $filter_query = ''; |
|
437 | - if (isset($filter['source']) && !empty($filter['source'])) { |
|
438 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
439 | - } |
|
440 | - // Should use spotter_output also ? |
|
441 | - if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
|
442 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
443 | - } |
|
444 | - if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
|
445 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
|
446 | - } |
|
447 | - if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
|
448 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
449 | - } |
|
426 | + * Gets Minimal Live Tracker data |
|
427 | + * |
|
428 | + * @return Array the spotter information |
|
429 | + * |
|
430 | + */ |
|
431 | + public function getMinLiveTrackerDataPlayback($begindate,$enddate,$filter = array()) |
|
432 | + { |
|
433 | + global $globalDBdriver, $globalLiveInterval; |
|
434 | + date_default_timezone_set('UTC'); |
|
435 | + |
|
436 | + $filter_query = ''; |
|
437 | + if (isset($filter['source']) && !empty($filter['source'])) { |
|
438 | + $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
439 | + } |
|
440 | + // Should use spotter_output also ? |
|
441 | + if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
|
442 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
443 | + } |
|
444 | + if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
|
445 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
|
446 | + } |
|
447 | + if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
|
448 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
449 | + } |
|
450 | 450 | |
451 | - //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
452 | - if ($globalDBdriver == 'mysql') { |
|
453 | - /* |
|
451 | + //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
452 | + if ($globalDBdriver == 'mysql') { |
|
453 | + /* |
|
454 | 454 | $query = 'SELECT a.aircraft_shadow, tracker_archive.ident, tracker_archive.famtrackid, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk |
455 | 455 | FROM tracker_archive |
456 | 456 | INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON tracker_archive.aircraft_icao = a.icao'; |
@@ -461,95 +461,95 @@ discard block |
||
461 | 461 | WHERE (tracker_archive_output.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') |
462 | 462 | '.$filter_query.' GROUP BY tracker_archive_output.famtrackid, tracker_archive_output.ident, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao, tracker_archive_output.arrival_airport_icao, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow'; |
463 | 463 | |
464 | - } else { |
|
465 | - //$query = 'SELECT tracker_archive_output.ident, tracker_archive_output.famtrackid, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow FROM tracker_archive_output INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive_output l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.famtrackid) s on tracker_archive_output.famtrackid = s.famtrackid AND tracker_archive_output.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on tracker_archive_output.aircraft_icao = a.icao'; |
|
466 | - /* |
|
464 | + } else { |
|
465 | + //$query = 'SELECT tracker_archive_output.ident, tracker_archive_output.famtrackid, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow FROM tracker_archive_output INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive_output l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.famtrackid) s on tracker_archive_output.famtrackid = s.famtrackid AND tracker_archive_output.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on tracker_archive_output.aircraft_icao = a.icao'; |
|
466 | + /* |
|
467 | 467 | $query = 'SELECT tracker_archive_output.ident, tracker_archive_output.famtrackid, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow |
468 | 468 | FROM tracker_archive_output |
469 | 469 | INNER JOIN (SELECT * FROM aircraft) a on tracker_archive_output.aircraft_icao = a.icao |
470 | 470 | WHERE tracker_archive_output.date >= '."'".$begindate."'".' AND tracker_archive_output.date <= '."'".$enddate."'".' |
471 | 471 | '.$filter_query.' GROUP BY tracker_archive_output.famtrackid, tracker_archive_output.ident, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao, tracker_archive_output.arrival_airport_icao, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow'; |
472 | 472 | */ |
473 | - $query = 'SELECT DISTINCT tracker_archive_output.famtrackid, tracker_archive_output.ident, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow |
|
473 | + $query = 'SELECT DISTINCT tracker_archive_output.famtrackid, tracker_archive_output.ident, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow |
|
474 | 474 | FROM tracker_archive_output |
475 | 475 | INNER JOIN (SELECT * FROM aircraft) a on tracker_archive_output.aircraft_icao = a.icao |
476 | 476 | WHERE tracker_archive_output.date >= '."'".$begindate."'".' AND tracker_archive_output.date <= '."'".$enddate."'".' |
477 | 477 | '.$filter_query.' LIMIT 200 OFFSET 0'; |
478 | 478 | // .' GROUP BY spotter_output.famtrackid, spotter_output.ident, spotter_output.aircraft_icao, spotter_output.departure_airport_icao, spotter_output.arrival_airport_icao, spotter_output.latitude, spotter_output.longitude, spotter_output.altitude, spotter_output.heading, spotter_output.ground_speed, spotter_output.squawk, a.aircraft_shadow'; |
479 | 479 | |
480 | - } |
|
481 | - //echo $query; |
|
482 | - try { |
|
483 | - $sth = $this->db->prepare($query); |
|
484 | - $sth->execute(); |
|
485 | - } catch(PDOException $e) { |
|
486 | - echo $e->getMessage(); |
|
487 | - die; |
|
488 | - } |
|
489 | - $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
480 | + } |
|
481 | + //echo $query; |
|
482 | + try { |
|
483 | + $sth = $this->db->prepare($query); |
|
484 | + $sth->execute(); |
|
485 | + } catch(PDOException $e) { |
|
486 | + echo $e->getMessage(); |
|
487 | + die; |
|
488 | + } |
|
489 | + $spotter_array = $sth->fetchAll(PDO::FETCH_ASSOC); |
|
490 | 490 | |
491 | - return $spotter_array; |
|
492 | - } |
|
491 | + return $spotter_array; |
|
492 | + } |
|
493 | 493 | |
494 | 494 | /** |
495 | - * Gets count Live Tracker data |
|
496 | - * |
|
497 | - * @return Array the spotter information |
|
498 | - * |
|
499 | - */ |
|
500 | - public function getLiveTrackerCount($begindate,$enddate,$filter = array()) |
|
501 | - { |
|
502 | - global $globalDBdriver, $globalLiveInterval; |
|
503 | - date_default_timezone_set('UTC'); |
|
504 | - |
|
505 | - $filter_query = ''; |
|
506 | - if (isset($filter['source']) && !empty($filter['source'])) { |
|
507 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
508 | - } |
|
509 | - if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
|
510 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
511 | - } |
|
512 | - if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
|
513 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
|
514 | - } |
|
515 | - if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
|
516 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
517 | - } |
|
495 | + * Gets count Live Tracker data |
|
496 | + * |
|
497 | + * @return Array the spotter information |
|
498 | + * |
|
499 | + */ |
|
500 | + public function getLiveTrackerCount($begindate,$enddate,$filter = array()) |
|
501 | + { |
|
502 | + global $globalDBdriver, $globalLiveInterval; |
|
503 | + date_default_timezone_set('UTC'); |
|
518 | 504 | |
519 | - //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
520 | - if ($globalDBdriver == 'mysql') { |
|
505 | + $filter_query = ''; |
|
506 | + if (isset($filter['source']) && !empty($filter['source'])) { |
|
507 | + $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
508 | + } |
|
509 | + if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
|
510 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
511 | + } |
|
512 | + if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
|
513 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
|
514 | + } |
|
515 | + if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
|
516 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
517 | + } |
|
518 | + |
|
519 | + //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
|
520 | + if ($globalDBdriver == 'mysql') { |
|
521 | 521 | $query = 'SELECT COUNT(DISTINCT famtrackid) as nb |
522 | 522 | FROM tracker_archive l |
523 | 523 | WHERE (l.date BETWEEN DATE_SUB('."'".$begindate."'".',INTERVAL '.$globalLiveInterval.' SECOND) AND '."'".$begindate."'".')'.$filter_query; |
524 | - } else { |
|
524 | + } else { |
|
525 | 525 | $query = 'SELECT COUNT(DISTINCT famtrackid) as nb FROM tracker_archive l WHERE (l.date BETWEEN '."'".$begindate."' - INTERVAL '".$globalLiveInterval." SECONDS' AND "."'".$enddate."'".')'.$filter_query; |
526 | - } |
|
527 | - //echo $query; |
|
528 | - try { |
|
529 | - $sth = $this->db->prepare($query); |
|
530 | - $sth->execute(); |
|
531 | - } catch(PDOException $e) { |
|
532 | - echo $e->getMessage(); |
|
533 | - die; |
|
534 | - } |
|
526 | + } |
|
527 | + //echo $query; |
|
528 | + try { |
|
529 | + $sth = $this->db->prepare($query); |
|
530 | + $sth->execute(); |
|
531 | + } catch(PDOException $e) { |
|
532 | + echo $e->getMessage(); |
|
533 | + die; |
|
534 | + } |
|
535 | 535 | $result = $sth->fetch(PDO::FETCH_ASSOC); |
536 | 536 | $sth->closeCursor(); |
537 | - return $result['nb']; |
|
537 | + return $result['nb']; |
|
538 | 538 | |
539 | - } |
|
539 | + } |
|
540 | 540 | |
541 | 541 | |
542 | 542 | |
543 | 543 | // tracker_archive_output |
544 | 544 | |
545 | - /** |
|
546 | - * Gets all the spotter information |
|
547 | - * |
|
548 | - * @return Array the spotter information |
|
549 | - * |
|
550 | - */ |
|
551 | - public function searchTrackerData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filters=array()) |
|
552 | - { |
|
545 | + /** |
|
546 | + * Gets all the spotter information |
|
547 | + * |
|
548 | + * @return Array the spotter information |
|
549 | + * |
|
550 | + */ |
|
551 | + public function searchTrackerData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filters=array()) |
|
552 | + { |
|
553 | 553 | global $globalTimezone, $globalDBdriver; |
554 | 554 | require_once(dirname(__FILE__).'/class.Translation.php'); |
555 | 555 | $Translation = new Translation($this->db); |
@@ -563,159 +563,159 @@ discard block |
||
563 | 563 | $filter_query = $this->getFilter($filters); |
564 | 564 | if ($q != "") |
565 | 565 | { |
566 | - if (!is_string($q)) |
|
567 | - { |
|
566 | + if (!is_string($q)) |
|
567 | + { |
|
568 | 568 | return false; |
569 | - } else { |
|
569 | + } else { |
|
570 | 570 | |
571 | 571 | $q_array = explode(" ", $q); |
572 | 572 | |
573 | 573 | foreach ($q_array as $q_item){ |
574 | - $additional_query .= " AND ("; |
|
575 | - $additional_query .= "(tracker_archive_output.spotter_id like '%".$q_item."%') OR "; |
|
576 | - $additional_query .= "(tracker_archive_output.aircraft_icao like '%".$q_item."%') OR "; |
|
577 | - $additional_query .= "(tracker_archive_output.aircraft_name like '%".$q_item."%') OR "; |
|
578 | - $additional_query .= "(tracker_archive_output.aircraft_manufacturer like '%".$q_item."%') OR "; |
|
579 | - $additional_query .= "(tracker_archive_output.airline_icao like '%".$q_item."%') OR "; |
|
580 | - $additional_query .= "(tracker_archive_output.airline_name like '%".$q_item."%') OR "; |
|
581 | - $additional_query .= "(tracker_archive_output.airline_country like '%".$q_item."%') OR "; |
|
582 | - $additional_query .= "(tracker_archive_output.departure_airport_icao like '%".$q_item."%') OR "; |
|
583 | - $additional_query .= "(tracker_archive_output.departure_airport_name like '%".$q_item."%') OR "; |
|
584 | - $additional_query .= "(tracker_archive_output.departure_airport_city like '%".$q_item."%') OR "; |
|
585 | - $additional_query .= "(tracker_archive_output.departure_airport_country like '%".$q_item."%') OR "; |
|
586 | - $additional_query .= "(tracker_archive_output.arrival_airport_icao like '%".$q_item."%') OR "; |
|
587 | - $additional_query .= "(tracker_archive_output.arrival_airport_name like '%".$q_item."%') OR "; |
|
588 | - $additional_query .= "(tracker_archive_output.arrival_airport_city like '%".$q_item."%') OR "; |
|
589 | - $additional_query .= "(tracker_archive_output.arrival_airport_country like '%".$q_item."%') OR "; |
|
590 | - $additional_query .= "(tracker_archive_output.registration like '%".$q_item."%') OR "; |
|
591 | - $additional_query .= "(tracker_archive_output.owner_name like '%".$q_item."%') OR "; |
|
592 | - $additional_query .= "(tracker_archive_output.pilot_id like '%".$q_item."%') OR "; |
|
593 | - $additional_query .= "(tracker_archive_output.pilot_name like '%".$q_item."%') OR "; |
|
594 | - $additional_query .= "(tracker_archive_output.ident like '%".$q_item."%') OR "; |
|
595 | - $translate = $Translation->ident2icao($q_item); |
|
596 | - if ($translate != $q_item) $additional_query .= "(tracker_archive_output.ident like '%".$translate."%') OR "; |
|
597 | - $additional_query .= "(tracker_archive_output.highlight like '%".$q_item."%')"; |
|
598 | - $additional_query .= ")"; |
|
574 | + $additional_query .= " AND ("; |
|
575 | + $additional_query .= "(tracker_archive_output.spotter_id like '%".$q_item."%') OR "; |
|
576 | + $additional_query .= "(tracker_archive_output.aircraft_icao like '%".$q_item."%') OR "; |
|
577 | + $additional_query .= "(tracker_archive_output.aircraft_name like '%".$q_item."%') OR "; |
|
578 | + $additional_query .= "(tracker_archive_output.aircraft_manufacturer like '%".$q_item."%') OR "; |
|
579 | + $additional_query .= "(tracker_archive_output.airline_icao like '%".$q_item."%') OR "; |
|
580 | + $additional_query .= "(tracker_archive_output.airline_name like '%".$q_item."%') OR "; |
|
581 | + $additional_query .= "(tracker_archive_output.airline_country like '%".$q_item."%') OR "; |
|
582 | + $additional_query .= "(tracker_archive_output.departure_airport_icao like '%".$q_item."%') OR "; |
|
583 | + $additional_query .= "(tracker_archive_output.departure_airport_name like '%".$q_item."%') OR "; |
|
584 | + $additional_query .= "(tracker_archive_output.departure_airport_city like '%".$q_item."%') OR "; |
|
585 | + $additional_query .= "(tracker_archive_output.departure_airport_country like '%".$q_item."%') OR "; |
|
586 | + $additional_query .= "(tracker_archive_output.arrival_airport_icao like '%".$q_item."%') OR "; |
|
587 | + $additional_query .= "(tracker_archive_output.arrival_airport_name like '%".$q_item."%') OR "; |
|
588 | + $additional_query .= "(tracker_archive_output.arrival_airport_city like '%".$q_item."%') OR "; |
|
589 | + $additional_query .= "(tracker_archive_output.arrival_airport_country like '%".$q_item."%') OR "; |
|
590 | + $additional_query .= "(tracker_archive_output.registration like '%".$q_item."%') OR "; |
|
591 | + $additional_query .= "(tracker_archive_output.owner_name like '%".$q_item."%') OR "; |
|
592 | + $additional_query .= "(tracker_archive_output.pilot_id like '%".$q_item."%') OR "; |
|
593 | + $additional_query .= "(tracker_archive_output.pilot_name like '%".$q_item."%') OR "; |
|
594 | + $additional_query .= "(tracker_archive_output.ident like '%".$q_item."%') OR "; |
|
595 | + $translate = $Translation->ident2icao($q_item); |
|
596 | + if ($translate != $q_item) $additional_query .= "(tracker_archive_output.ident like '%".$translate."%') OR "; |
|
597 | + $additional_query .= "(tracker_archive_output.highlight like '%".$q_item."%')"; |
|
598 | + $additional_query .= ")"; |
|
599 | + } |
|
599 | 600 | } |
600 | - } |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | if ($registration != "") |
604 | 604 | { |
605 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
606 | - if (!is_string($registration)) |
|
607 | - { |
|
605 | + $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
606 | + if (!is_string($registration)) |
|
607 | + { |
|
608 | 608 | return false; |
609 | - } else { |
|
609 | + } else { |
|
610 | 610 | $additional_query .= " AND (tracker_archive_output.registration = '".$registration."')"; |
611 | - } |
|
611 | + } |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | if ($aircraft_icao != "") |
615 | 615 | { |
616 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
617 | - if (!is_string($aircraft_icao)) |
|
618 | - { |
|
616 | + $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
617 | + if (!is_string($aircraft_icao)) |
|
618 | + { |
|
619 | 619 | return false; |
620 | - } else { |
|
620 | + } else { |
|
621 | 621 | $additional_query .= " AND (tracker_archive_output.aircraft_icao = '".$aircraft_icao."')"; |
622 | - } |
|
622 | + } |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | if ($aircraft_manufacturer != "") |
626 | 626 | { |
627 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
628 | - if (!is_string($aircraft_manufacturer)) |
|
629 | - { |
|
627 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
628 | + if (!is_string($aircraft_manufacturer)) |
|
629 | + { |
|
630 | 630 | return false; |
631 | - } else { |
|
631 | + } else { |
|
632 | 632 | $additional_query .= " AND (tracker_archive_output.aircraft_manufacturer = '".$aircraft_manufacturer."')"; |
633 | - } |
|
633 | + } |
|
634 | 634 | } |
635 | 635 | |
636 | 636 | if ($highlights == "true") |
637 | 637 | { |
638 | - if (!is_string($highlights)) |
|
639 | - { |
|
638 | + if (!is_string($highlights)) |
|
639 | + { |
|
640 | 640 | return false; |
641 | - } else { |
|
641 | + } else { |
|
642 | 642 | $additional_query .= " AND (tracker_archive_output.highlight <> '')"; |
643 | - } |
|
643 | + } |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | if ($airline_icao != "") |
647 | 647 | { |
648 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
649 | - if (!is_string($airline_icao)) |
|
650 | - { |
|
648 | + $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
649 | + if (!is_string($airline_icao)) |
|
650 | + { |
|
651 | 651 | return false; |
652 | - } else { |
|
652 | + } else { |
|
653 | 653 | $additional_query .= " AND (tracker_archive_output.airline_icao = '".$airline_icao."')"; |
654 | - } |
|
654 | + } |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | if ($airline_country != "") |
658 | 658 | { |
659 | - $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING); |
|
660 | - if (!is_string($airline_country)) |
|
661 | - { |
|
659 | + $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING); |
|
660 | + if (!is_string($airline_country)) |
|
661 | + { |
|
662 | 662 | return false; |
663 | - } else { |
|
663 | + } else { |
|
664 | 664 | $additional_query .= " AND (tracker_archive_output.airline_country = '".$airline_country."')"; |
665 | - } |
|
665 | + } |
|
666 | 666 | } |
667 | 667 | |
668 | 668 | if ($airline_type != "") |
669 | 669 | { |
670 | - $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
|
671 | - if (!is_string($airline_type)) |
|
672 | - { |
|
670 | + $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
|
671 | + if (!is_string($airline_type)) |
|
672 | + { |
|
673 | 673 | return false; |
674 | - } else { |
|
674 | + } else { |
|
675 | 675 | if ($airline_type == "passenger") |
676 | 676 | { |
677 | - $additional_query .= " AND (tracker_archive_output.airline_type = 'passenger')"; |
|
677 | + $additional_query .= " AND (tracker_archive_output.airline_type = 'passenger')"; |
|
678 | 678 | } |
679 | 679 | if ($airline_type == "cargo") |
680 | 680 | { |
681 | - $additional_query .= " AND (tracker_archive_output.airline_type = 'cargo')"; |
|
681 | + $additional_query .= " AND (tracker_archive_output.airline_type = 'cargo')"; |
|
682 | 682 | } |
683 | 683 | if ($airline_type == "military") |
684 | 684 | { |
685 | - $additional_query .= " AND (tracker_archive_output.airline_type = 'military')"; |
|
685 | + $additional_query .= " AND (tracker_archive_output.airline_type = 'military')"; |
|
686 | + } |
|
686 | 687 | } |
687 | - } |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | if ($airport != "") |
691 | 691 | { |
692 | - $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
693 | - if (!is_string($airport)) |
|
694 | - { |
|
692 | + $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
693 | + if (!is_string($airport)) |
|
694 | + { |
|
695 | 695 | return false; |
696 | - } else { |
|
696 | + } else { |
|
697 | 697 | $additional_query .= " AND ((tracker_archive_output.departure_airport_icao = '".$airport."') OR (tracker_archive_output.arrival_airport_icao = '".$airport."'))"; |
698 | - } |
|
698 | + } |
|
699 | 699 | } |
700 | 700 | |
701 | 701 | if ($airport_country != "") |
702 | 702 | { |
703 | - $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING); |
|
704 | - if (!is_string($airport_country)) |
|
705 | - { |
|
703 | + $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING); |
|
704 | + if (!is_string($airport_country)) |
|
705 | + { |
|
706 | 706 | return false; |
707 | - } else { |
|
707 | + } else { |
|
708 | 708 | $additional_query .= " AND ((tracker_archive_output.departure_airport_country = '".$airport_country."') OR (tracker_archive_output.arrival_airport_country = '".$airport_country."'))"; |
709 | - } |
|
709 | + } |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | if ($callsign != "") |
713 | 713 | { |
714 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
715 | - if (!is_string($callsign)) |
|
716 | - { |
|
714 | + $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
715 | + if (!is_string($callsign)) |
|
716 | + { |
|
717 | 717 | return false; |
718 | - } else { |
|
718 | + } else { |
|
719 | 719 | $translate = $Translation->ident2icao($callsign); |
720 | 720 | if ($translate != $callsign) { |
721 | 721 | $additional_query .= " AND (tracker_archive_output.ident = :callsign OR tracker_archive_output.ident = :translate)"; |
@@ -723,99 +723,99 @@ discard block |
||
723 | 723 | } else { |
724 | 724 | $additional_query .= " AND (tracker_archive_output.ident = '".$callsign."')"; |
725 | 725 | } |
726 | - } |
|
726 | + } |
|
727 | 727 | } |
728 | 728 | |
729 | 729 | if ($owner != "") |
730 | 730 | { |
731 | - $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
|
732 | - if (!is_string($owner)) |
|
733 | - { |
|
731 | + $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
|
732 | + if (!is_string($owner)) |
|
733 | + { |
|
734 | 734 | return false; |
735 | - } else { |
|
735 | + } else { |
|
736 | 736 | $additional_query .= " AND (tracker_archive_output.owner_name = '".$owner."')"; |
737 | - } |
|
737 | + } |
|
738 | 738 | } |
739 | 739 | |
740 | 740 | if ($pilot_name != "") |
741 | 741 | { |
742 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
743 | - if (!is_string($pilot_name)) |
|
744 | - { |
|
742 | + $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
743 | + if (!is_string($pilot_name)) |
|
744 | + { |
|
745 | 745 | return false; |
746 | - } else { |
|
746 | + } else { |
|
747 | 747 | $additional_query .= " AND (tracker_archive_output.pilot_name = '".$pilot_name."')"; |
748 | - } |
|
748 | + } |
|
749 | 749 | } |
750 | 750 | |
751 | 751 | if ($pilot_id != "") |
752 | 752 | { |
753 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT); |
|
754 | - if (!is_string($pilot_id)) |
|
755 | - { |
|
753 | + $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT); |
|
754 | + if (!is_string($pilot_id)) |
|
755 | + { |
|
756 | 756 | return false; |
757 | - } else { |
|
757 | + } else { |
|
758 | 758 | $additional_query .= " AND (tracker_archive_output.pilot_id = '".$pilot_id."')"; |
759 | - } |
|
759 | + } |
|
760 | 760 | } |
761 | 761 | |
762 | 762 | if ($departure_airport_route != "") |
763 | 763 | { |
764 | - $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING); |
|
765 | - if (!is_string($departure_airport_route)) |
|
766 | - { |
|
764 | + $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING); |
|
765 | + if (!is_string($departure_airport_route)) |
|
766 | + { |
|
767 | 767 | return false; |
768 | - } else { |
|
768 | + } else { |
|
769 | 769 | $additional_query .= " AND (tracker_archive_output.departure_airport_icao = '".$departure_airport_route."')"; |
770 | - } |
|
770 | + } |
|
771 | 771 | } |
772 | 772 | |
773 | 773 | if ($arrival_airport_route != "") |
774 | 774 | { |
775 | - $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING); |
|
776 | - if (!is_string($arrival_airport_route)) |
|
777 | - { |
|
775 | + $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING); |
|
776 | + if (!is_string($arrival_airport_route)) |
|
777 | + { |
|
778 | 778 | return false; |
779 | - } else { |
|
779 | + } else { |
|
780 | 780 | $additional_query .= " AND (tracker_archive_output.arrival_airport_icao = '".$arrival_airport_route."')"; |
781 | - } |
|
781 | + } |
|
782 | 782 | } |
783 | 783 | |
784 | 784 | if ($altitude != "") |
785 | 785 | { |
786 | - $altitude_array = explode(",", $altitude); |
|
786 | + $altitude_array = explode(",", $altitude); |
|
787 | 787 | |
788 | - $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
789 | - $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
788 | + $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
789 | + $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
790 | 790 | |
791 | 791 | |
792 | - if ($altitude_array[1] != "") |
|
793 | - { |
|
792 | + if ($altitude_array[1] != "") |
|
793 | + { |
|
794 | 794 | $altitude_array[0] = substr($altitude_array[0], 0, -2); |
795 | 795 | $altitude_array[1] = substr($altitude_array[1], 0, -2); |
796 | 796 | $additional_query .= " AND altitude BETWEEN '".$altitude_array[0]."' AND '".$altitude_array[1]."' "; |
797 | - } else { |
|
797 | + } else { |
|
798 | 798 | $altitude_array[0] = substr($altitude_array[0], 0, -2); |
799 | 799 | $additional_query .= " AND altitude <= '".$altitude_array[0]."' "; |
800 | - } |
|
800 | + } |
|
801 | 801 | } |
802 | 802 | |
803 | 803 | if ($date_posted != "") |
804 | 804 | { |
805 | - $date_array = explode(",", $date_posted); |
|
805 | + $date_array = explode(",", $date_posted); |
|
806 | 806 | |
807 | - $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
808 | - $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
807 | + $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
808 | + $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
809 | 809 | |
810 | - if ($globalTimezone != '') { |
|
810 | + if ($globalTimezone != '') { |
|
811 | 811 | date_default_timezone_set($globalTimezone); |
812 | 812 | $datetime = new DateTime(); |
813 | 813 | $offset = $datetime->format('P'); |
814 | - } else $offset = '+00:00'; |
|
814 | + } else $offset = '+00:00'; |
|
815 | 815 | |
816 | 816 | |
817 | - if ($date_array[1] != "") |
|
818 | - { |
|
817 | + if ($date_array[1] != "") |
|
818 | + { |
|
819 | 819 | $date_array[0] = date("Y-m-d H:i:s", strtotime($date_array[0])); |
820 | 820 | $date_array[1] = date("Y-m-d H:i:s", strtotime($date_array[1])); |
821 | 821 | if ($globalDBdriver == 'mysql') { |
@@ -823,28 +823,28 @@ discard block |
||
823 | 823 | } else { |
824 | 824 | $additional_query .= " AND tracker_archive_output.date::timestamp AT TIME ZONE INTERVAL ".$offset." >= CAST('".$date_array[0]."' AS TIMESTAMP) AND tracker_archive_output.date::timestamp AT TIME ZONE INTERVAL ".$offset." <= CAST('".$date_array[1]."' AS TIMESTAMP) "; |
825 | 825 | } |
826 | - } else { |
|
826 | + } else { |
|
827 | 827 | $date_array[0] = date("Y-m-d H:i:s", strtotime($date_array[0])); |
828 | - if ($globalDBdriver == 'mysql') { |
|
828 | + if ($globalDBdriver == 'mysql') { |
|
829 | 829 | $additional_query .= " AND TIMESTAMP(CONVERT_TZ(tracker_archive_output.date,'+00:00', '".$offset."')) >= '".$date_array[0]."' "; |
830 | 830 | } else { |
831 | 831 | $additional_query .= " AND tracker_archive_output.date::timestamp AT TIME ZONE INTERVAL ".$offset." >= CAST('".$date_array[0]."' AS TIMESTAMP) "; |
832 | 832 | } |
833 | - } |
|
833 | + } |
|
834 | 834 | } |
835 | 835 | |
836 | 836 | if ($limit != "") |
837 | 837 | { |
838 | - $limit_array = explode(",", $limit); |
|
838 | + $limit_array = explode(",", $limit); |
|
839 | 839 | |
840 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
841 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
840 | + $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
841 | + $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
842 | 842 | |
843 | - if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
844 | - { |
|
843 | + if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
844 | + { |
|
845 | 845 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
846 | 846 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
847 | - } |
|
847 | + } |
|
848 | 848 | } |
849 | 849 | |
850 | 850 | |
@@ -875,33 +875,33 @@ discard block |
||
875 | 875 | $spotter_array = $Tracker->getDataFromDB($query, $query_values,$limit_query); |
876 | 876 | |
877 | 877 | return $spotter_array; |
878 | - } |
|
878 | + } |
|
879 | 879 | |
880 | - public function deleteTrackerArchiveData() |
|
881 | - { |
|
880 | + public function deleteTrackerArchiveData() |
|
881 | + { |
|
882 | 882 | global $globalArchiveKeepMonths, $globalDBdriver; |
883 | - date_default_timezone_set('UTC'); |
|
884 | - if ($globalDBdriver == 'mysql') { |
|
883 | + date_default_timezone_set('UTC'); |
|
884 | + if ($globalDBdriver == 'mysql') { |
|
885 | 885 | $query = 'DELETE FROM tracker_archive_output WHERE tracker_archive_output.date < DATE_SUB(UTC_TIMESTAMP(), INTERVAL '.$globalArchiveKeepMonths.' MONTH)'; |
886 | 886 | } else { |
887 | 887 | $query = "DELETE FROM tracker_archive_output WHERE tracker_archive_output.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$globalArchiveKeepMonths." MONTH'"; |
888 | 888 | } |
889 | - try { |
|
890 | - $sth = $this->db->prepare($query); |
|
891 | - $sth->execute(); |
|
892 | - } catch(PDOException $e) { |
|
893 | - return "error"; |
|
894 | - } |
|
889 | + try { |
|
890 | + $sth = $this->db->prepare($query); |
|
891 | + $sth->execute(); |
|
892 | + } catch(PDOException $e) { |
|
893 | + return "error"; |
|
894 | + } |
|
895 | 895 | } |
896 | 896 | |
897 | - /** |
|
898 | - * Gets all the spotter information based on the callsign |
|
899 | - * |
|
900 | - * @return Array the spotter information |
|
901 | - * |
|
902 | - */ |
|
903 | - public function getTrackerDataByIdent($ident = '', $limit = '', $sort = '') |
|
904 | - { |
|
897 | + /** |
|
898 | + * Gets all the spotter information based on the callsign |
|
899 | + * |
|
900 | + * @return Array the spotter information |
|
901 | + * |
|
902 | + */ |
|
903 | + public function getTrackerDataByIdent($ident = '', $limit = '', $sort = '') |
|
904 | + { |
|
905 | 905 | $global_query = "SELECT tracker_archive_output.* FROM tracker_archive_output"; |
906 | 906 | |
907 | 907 | date_default_timezone_set('UTC'); |
@@ -913,35 +913,35 @@ discard block |
||
913 | 913 | |
914 | 914 | if ($ident != "") |
915 | 915 | { |
916 | - if (!is_string($ident)) |
|
917 | - { |
|
916 | + if (!is_string($ident)) |
|
917 | + { |
|
918 | 918 | return false; |
919 | - } else { |
|
919 | + } else { |
|
920 | 920 | $additional_query = " AND (tracker_archive_output.ident = :ident)"; |
921 | 921 | $query_values = array(':ident' => $ident); |
922 | - } |
|
922 | + } |
|
923 | 923 | } |
924 | 924 | |
925 | 925 | if ($limit != "") |
926 | 926 | { |
927 | - $limit_array = explode(",", $limit); |
|
927 | + $limit_array = explode(",", $limit); |
|
928 | 928 | |
929 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
930 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
929 | + $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
930 | + $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
931 | 931 | |
932 | - if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
933 | - { |
|
932 | + if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
933 | + { |
|
934 | 934 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
935 | 935 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
936 | - } |
|
936 | + } |
|
937 | 937 | } |
938 | 938 | |
939 | 939 | if ($sort != "") |
940 | 940 | { |
941 | - $search_orderby_array = $Tracker->getOrderBy(); |
|
942 | - $orderby_query = $search_orderby_array[$sort]['sql']; |
|
941 | + $search_orderby_array = $Tracker->getOrderBy(); |
|
942 | + $orderby_query = $search_orderby_array[$sort]['sql']; |
|
943 | 943 | } else { |
944 | - $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
944 | + $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | $query = $global_query." WHERE tracker_archive_output.ident <> '' ".$additional_query." ".$orderby_query; |
@@ -949,17 +949,17 @@ discard block |
||
949 | 949 | $spotter_array = $Tracker->getDataFromDB($query, $query_values, $limit_query); |
950 | 950 | |
951 | 951 | return $spotter_array; |
952 | - } |
|
952 | + } |
|
953 | 953 | |
954 | 954 | |
955 | - /** |
|
956 | - * Gets all the spotter information based on the owner |
|
957 | - * |
|
958 | - * @return Array the spotter information |
|
959 | - * |
|
960 | - */ |
|
961 | - public function getTrackerDataByOwner($owner = '', $limit = '', $sort = '', $filter = array()) |
|
962 | - { |
|
955 | + /** |
|
956 | + * Gets all the spotter information based on the owner |
|
957 | + * |
|
958 | + * @return Array the spotter information |
|
959 | + * |
|
960 | + */ |
|
961 | + public function getTrackerDataByOwner($owner = '', $limit = '', $sort = '', $filter = array()) |
|
962 | + { |
|
963 | 963 | $global_query = "SELECT tracker_archive_output.* FROM tracker_archive_output"; |
964 | 964 | |
965 | 965 | date_default_timezone_set('UTC'); |
@@ -972,35 +972,35 @@ discard block |
||
972 | 972 | |
973 | 973 | if ($owner != "") |
974 | 974 | { |
975 | - if (!is_string($owner)) |
|
976 | - { |
|
975 | + if (!is_string($owner)) |
|
976 | + { |
|
977 | 977 | return false; |
978 | - } else { |
|
978 | + } else { |
|
979 | 979 | $additional_query = " AND (tracker_archive_output.owner_name = :owner)"; |
980 | 980 | $query_values = array(':owner' => $owner); |
981 | - } |
|
981 | + } |
|
982 | 982 | } |
983 | 983 | |
984 | 984 | if ($limit != "") |
985 | 985 | { |
986 | - $limit_array = explode(",", $limit); |
|
986 | + $limit_array = explode(",", $limit); |
|
987 | 987 | |
988 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
989 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
988 | + $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
989 | + $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
990 | 990 | |
991 | - if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
992 | - { |
|
991 | + if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
992 | + { |
|
993 | 993 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
994 | 994 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
995 | - } |
|
995 | + } |
|
996 | 996 | } |
997 | 997 | |
998 | 998 | if ($sort != "") |
999 | 999 | { |
1000 | - $search_orderby_array = $Tracker->getOrderBy(); |
|
1001 | - $orderby_query = $search_orderby_array[$sort]['sql']; |
|
1000 | + $search_orderby_array = $Tracker->getOrderBy(); |
|
1001 | + $orderby_query = $search_orderby_array[$sort]['sql']; |
|
1002 | 1002 | } else { |
1003 | - $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
1003 | + $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
1004 | 1004 | } |
1005 | 1005 | |
1006 | 1006 | $query = $global_query.$filter_query." tracker_archive_output.owner_name <> '' ".$additional_query." ".$orderby_query; |
@@ -1008,16 +1008,16 @@ discard block |
||
1008 | 1008 | $spotter_array = $Tracker->getDataFromDB($query, $query_values, $limit_query); |
1009 | 1009 | |
1010 | 1010 | return $spotter_array; |
1011 | - } |
|
1012 | - |
|
1013 | - /** |
|
1014 | - * Gets all the spotter information based on the pilot |
|
1015 | - * |
|
1016 | - * @return Array the spotter information |
|
1017 | - * |
|
1018 | - */ |
|
1019 | - public function getTrackerDataByPilot($pilot = '', $limit = '', $sort = '', $filter = array()) |
|
1020 | - { |
|
1011 | + } |
|
1012 | + |
|
1013 | + /** |
|
1014 | + * Gets all the spotter information based on the pilot |
|
1015 | + * |
|
1016 | + * @return Array the spotter information |
|
1017 | + * |
|
1018 | + */ |
|
1019 | + public function getTrackerDataByPilot($pilot = '', $limit = '', $sort = '', $filter = array()) |
|
1020 | + { |
|
1021 | 1021 | $global_query = "SELECT tracker_archive_output.* FROM tracker_archive_output"; |
1022 | 1022 | |
1023 | 1023 | date_default_timezone_set('UTC'); |
@@ -1036,24 +1036,24 @@ discard block |
||
1036 | 1036 | |
1037 | 1037 | if ($limit != "") |
1038 | 1038 | { |
1039 | - $limit_array = explode(",", $limit); |
|
1039 | + $limit_array = explode(",", $limit); |
|
1040 | 1040 | |
1041 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1042 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
1041 | + $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1042 | + $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
1043 | 1043 | |
1044 | - if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1045 | - { |
|
1044 | + if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1045 | + { |
|
1046 | 1046 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
1047 | 1047 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
1048 | - } |
|
1048 | + } |
|
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | if ($sort != "") |
1052 | 1052 | { |
1053 | - $search_orderby_array = $Tracker->getOrderBy(); |
|
1054 | - $orderby_query = $search_orderby_array[$sort]['sql']; |
|
1053 | + $search_orderby_array = $Tracker->getOrderBy(); |
|
1054 | + $orderby_query = $search_orderby_array[$sort]['sql']; |
|
1055 | 1055 | } else { |
1056 | - $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
1056 | + $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | $query = $global_query.$filter_query." tracker_archive_output.pilot_name <> '' ".$additional_query." ".$orderby_query; |
@@ -1061,16 +1061,16 @@ discard block |
||
1061 | 1061 | $spotter_array = $Tracker->getDataFromDB($query, $query_values, $limit_query); |
1062 | 1062 | |
1063 | 1063 | return $spotter_array; |
1064 | - } |
|
1065 | - |
|
1066 | - /** |
|
1067 | - * Gets all number of flight over countries |
|
1068 | - * |
|
1069 | - * @return Array the airline country list |
|
1070 | - * |
|
1071 | - */ |
|
1072 | - public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
1073 | - { |
|
1064 | + } |
|
1065 | + |
|
1066 | + /** |
|
1067 | + * Gets all number of flight over countries |
|
1068 | + * |
|
1069 | + * @return Array the airline country list |
|
1070 | + * |
|
1071 | + */ |
|
1072 | + public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
1073 | + { |
|
1074 | 1074 | global $globalDBdriver; |
1075 | 1075 | /* |
1076 | 1076 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
@@ -1080,14 +1080,14 @@ discard block |
||
1080 | 1080 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
1081 | 1081 | FROM countries c, tracker_archive s |
1082 | 1082 | WHERE c.iso2 = s.over_country "; |
1083 | - if ($olderthanmonths > 0) { |
|
1084 | - if ($globalDBdriver == 'mysql') { |
|
1083 | + if ($olderthanmonths > 0) { |
|
1084 | + if ($globalDBdriver == 'mysql') { |
|
1085 | 1085 | $query .= 'AND date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
1086 | 1086 | } else { |
1087 | 1087 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
1088 | 1088 | } |
1089 | 1089 | } |
1090 | - if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
1090 | + if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
1091 | 1091 | $query .= "GROUP BY c.name, c.iso3, c.iso2 ORDER BY nb DESC"; |
1092 | 1092 | if ($limit) $query .= " LIMIT 0,10"; |
1093 | 1093 | |
@@ -1100,23 +1100,23 @@ discard block |
||
1100 | 1100 | |
1101 | 1101 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
1102 | 1102 | { |
1103 | - $temp_array['flight_count'] = $row['nb']; |
|
1104 | - $temp_array['flight_country'] = $row['name']; |
|
1105 | - $temp_array['flight_country_iso3'] = $row['iso3']; |
|
1106 | - $temp_array['flight_country_iso2'] = $row['iso2']; |
|
1107 | - $flight_array[] = $temp_array; |
|
1103 | + $temp_array['flight_count'] = $row['nb']; |
|
1104 | + $temp_array['flight_country'] = $row['name']; |
|
1105 | + $temp_array['flight_country_iso3'] = $row['iso3']; |
|
1106 | + $temp_array['flight_country_iso2'] = $row['iso2']; |
|
1107 | + $flight_array[] = $temp_array; |
|
1108 | 1108 | } |
1109 | 1109 | return $flight_array; |
1110 | - } |
|
1111 | - |
|
1112 | - /** |
|
1113 | - * Gets all number of flight over countries |
|
1114 | - * |
|
1115 | - * @return Array the airline country list |
|
1116 | - * |
|
1117 | - */ |
|
1118 | - public function countAllFlightOverCountriesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
1119 | - { |
|
1110 | + } |
|
1111 | + |
|
1112 | + /** |
|
1113 | + * Gets all number of flight over countries |
|
1114 | + * |
|
1115 | + * @return Array the airline country list |
|
1116 | + * |
|
1117 | + */ |
|
1118 | + public function countAllFlightOverCountriesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
1119 | + { |
|
1120 | 1120 | global $globalDBdriver; |
1121 | 1121 | /* |
1122 | 1122 | $query = "SELECT c.name, c.iso3, c.iso2, count(c.name) as nb |
@@ -1126,14 +1126,14 @@ discard block |
||
1126 | 1126 | $query = "SELECT o.airline_icao,c.name, c.iso3, c.iso2, count(c.name) as nb |
1127 | 1127 | FROM countries c, tracker_archive s, spotter_output o |
1128 | 1128 | WHERE c.iso2 = s.over_country AND o.airline_icao <> '' AND o.famtrackid = s.famtrackid "; |
1129 | - if ($olderthanmonths > 0) { |
|
1130 | - if ($globalDBdriver == 'mysql') { |
|
1129 | + if ($olderthanmonths > 0) { |
|
1130 | + if ($globalDBdriver == 'mysql') { |
|
1131 | 1131 | $query .= 'AND s.date < DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$olderthanmonths.' MONTH) '; |
1132 | 1132 | } else { |
1133 | 1133 | $query .= "AND s.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
1134 | 1134 | } |
1135 | 1135 | } |
1136 | - if ($sincedate != '') $query .= "AND s.date > '".$sincedate."' "; |
|
1136 | + if ($sincedate != '') $query .= "AND s.date > '".$sincedate."' "; |
|
1137 | 1137 | $query .= "GROUP BY o.airline_icao,c.name, c.iso3, c.iso2 ORDER BY nb DESC"; |
1138 | 1138 | if ($limit) $query .= " LIMIT 0,10"; |
1139 | 1139 | |
@@ -1146,24 +1146,24 @@ discard block |
||
1146 | 1146 | |
1147 | 1147 | while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
1148 | 1148 | { |
1149 | - $temp_array['airline_icao'] = $row['airline_icao']; |
|
1150 | - $temp_array['flight_count'] = $row['nb']; |
|
1151 | - $temp_array['flight_country'] = $row['name']; |
|
1152 | - $temp_array['flight_country_iso3'] = $row['iso3']; |
|
1153 | - $temp_array['flight_country_iso2'] = $row['iso2']; |
|
1154 | - $flight_array[] = $temp_array; |
|
1149 | + $temp_array['airline_icao'] = $row['airline_icao']; |
|
1150 | + $temp_array['flight_count'] = $row['nb']; |
|
1151 | + $temp_array['flight_country'] = $row['name']; |
|
1152 | + $temp_array['flight_country_iso3'] = $row['iso3']; |
|
1153 | + $temp_array['flight_country_iso2'] = $row['iso2']; |
|
1154 | + $flight_array[] = $temp_array; |
|
1155 | 1155 | } |
1156 | 1156 | return $flight_array; |
1157 | - } |
|
1158 | - |
|
1159 | - /** |
|
1160 | - * Gets last spotter information based on a particular callsign |
|
1161 | - * |
|
1162 | - * @return Array the spotter information |
|
1163 | - * |
|
1164 | - */ |
|
1165 | - public function getDateArchiveTrackerDataById($id,$date) |
|
1166 | - { |
|
1157 | + } |
|
1158 | + |
|
1159 | + /** |
|
1160 | + * Gets last spotter information based on a particular callsign |
|
1161 | + * |
|
1162 | + * @return Array the spotter information |
|
1163 | + * |
|
1164 | + */ |
|
1165 | + public function getDateArchiveTrackerDataById($id,$date) |
|
1166 | + { |
|
1167 | 1167 | $Tracker = new Tracker($this->db); |
1168 | 1168 | date_default_timezone_set('UTC'); |
1169 | 1169 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
@@ -1171,16 +1171,16 @@ discard block |
||
1171 | 1171 | $date = date('c',$date); |
1172 | 1172 | $spotter_array = $Tracker->getDataFromDB($query,array(':id' => $id,':date' => $date)); |
1173 | 1173 | return $spotter_array; |
1174 | - } |
|
1175 | - |
|
1176 | - /** |
|
1177 | - * Gets all the spotter information based on a particular callsign |
|
1178 | - * |
|
1179 | - * @return Array the spotter information |
|
1180 | - * |
|
1181 | - */ |
|
1182 | - public function getDateArchiveTrackerDataByIdent($ident,$date) |
|
1183 | - { |
|
1174 | + } |
|
1175 | + |
|
1176 | + /** |
|
1177 | + * Gets all the spotter information based on a particular callsign |
|
1178 | + * |
|
1179 | + * @return Array the spotter information |
|
1180 | + * |
|
1181 | + */ |
|
1182 | + public function getDateArchiveTrackerDataByIdent($ident,$date) |
|
1183 | + { |
|
1184 | 1184 | $Tracker = new Tracker($this->db); |
1185 | 1185 | date_default_timezone_set('UTC'); |
1186 | 1186 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
@@ -1188,16 +1188,16 @@ discard block |
||
1188 | 1188 | $date = date('c',$date); |
1189 | 1189 | $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
1190 | 1190 | return $spotter_array; |
1191 | - } |
|
1192 | - |
|
1193 | - /** |
|
1194 | - * Gets all the spotter information based on the airport |
|
1195 | - * |
|
1196 | - * @return Array the spotter information |
|
1197 | - * |
|
1198 | - */ |
|
1199 | - public function getTrackerDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
|
1200 | - { |
|
1191 | + } |
|
1192 | + |
|
1193 | + /** |
|
1194 | + * Gets all the spotter information based on the airport |
|
1195 | + * |
|
1196 | + * @return Array the spotter information |
|
1197 | + * |
|
1198 | + */ |
|
1199 | + public function getTrackerDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
|
1200 | + { |
|
1201 | 1201 | global $global_query; |
1202 | 1202 | $Tracker = new Tracker($this->db); |
1203 | 1203 | date_default_timezone_set('UTC'); |
@@ -1208,35 +1208,35 @@ discard block |
||
1208 | 1208 | |
1209 | 1209 | if ($airport != "") |
1210 | 1210 | { |
1211 | - if (!is_string($airport)) |
|
1212 | - { |
|
1211 | + if (!is_string($airport)) |
|
1212 | + { |
|
1213 | 1213 | return false; |
1214 | - } else { |
|
1214 | + } else { |
|
1215 | 1215 | $additional_query .= " AND ((tracker_archive_output.departure_airport_icao = :airport) OR (tracker_archive_output.arrival_airport_icao = :airport))"; |
1216 | 1216 | $query_values = array(':airport' => $airport); |
1217 | - } |
|
1217 | + } |
|
1218 | 1218 | } |
1219 | 1219 | |
1220 | 1220 | if ($limit != "") |
1221 | 1221 | { |
1222 | - $limit_array = explode(",", $limit); |
|
1222 | + $limit_array = explode(",", $limit); |
|
1223 | 1223 | |
1224 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1225 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
1224 | + $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1225 | + $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
1226 | 1226 | |
1227 | - if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1228 | - { |
|
1227 | + if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
|
1228 | + { |
|
1229 | 1229 | //$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1]; |
1230 | 1230 | $limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0]; |
1231 | - } |
|
1231 | + } |
|
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | if ($sort != "") |
1235 | 1235 | { |
1236 | - $search_orderby_array = $Tracker->getOrderBy(); |
|
1237 | - $orderby_query = $search_orderby_array[$sort]['sql']; |
|
1236 | + $search_orderby_array = $Tracker->getOrderBy(); |
|
1237 | + $orderby_query = $search_orderby_array[$sort]['sql']; |
|
1238 | 1238 | } else { |
1239 | - $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
1239 | + $orderby_query = " ORDER BY tracker_archive_output.date DESC"; |
|
1240 | 1240 | } |
1241 | 1241 | |
1242 | 1242 | $query = $global_query.$filter_query." tracker_archive_output.ident <> '' ".$additional_query." AND ((tracker_archive_output.departure_airport_icao <> 'NA') AND (tracker_archive_output.arrival_airport_icao <> 'NA')) ".$orderby_query; |
@@ -1244,6 +1244,6 @@ discard block |
||
1244 | 1244 | $spotter_array = $Tracker->getDataFromDB($query, $query_values, $limit_query); |
1245 | 1245 | |
1246 | 1246 | return $spotter_array; |
1247 | - } |
|
1247 | + } |
|
1248 | 1248 | } |
1249 | 1249 | ?> |
1250 | 1250 | \ No newline at end of file |
@@ -14,33 +14,33 @@ discard block |
||
14 | 14 | * @param Array $filter the filter |
15 | 15 | * @return Array the SQL part |
16 | 16 | */ |
17 | - public function getFilter($filter = array(),$where = false,$and = false) { |
|
17 | + public function getFilter($filter = array(), $where = false, $and = false) { |
|
18 | 18 | global $globalFilter, $globalStatsFilters, $globalFilterName, $globalDBdriver; |
19 | 19 | $filters = array(); |
20 | 20 | if (is_array($globalStatsFilters) && isset($globalStatsFilters[$globalFilterName])) { |
21 | 21 | if (isset($globalStatsFilters[$globalFilterName][0]['source'])) { |
22 | 22 | $filters = $globalStatsFilters[$globalFilterName]; |
23 | 23 | } else { |
24 | - $filter = array_merge($filter,$globalStatsFilters[$globalFilterName]); |
|
24 | + $filter = array_merge($filter, $globalStatsFilters[$globalFilterName]); |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | if (isset($filter[0]['source'])) { |
28 | - $filters = array_merge($filters,$filter); |
|
28 | + $filters = array_merge($filters, $filter); |
|
29 | 29 | } |
30 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
30 | + if (is_array($globalFilter)) $filter = array_merge($filter, $globalFilter); |
|
31 | 31 | $filter_query_join = ''; |
32 | 32 | $filter_query_where = ''; |
33 | - foreach($filters as $flt) { |
|
33 | + foreach ($filters as $flt) { |
|
34 | 34 | if (isset($flt['idents']) && !empty($flt['idents'])) { |
35 | 35 | if (isset($flt['source'])) { |
36 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.ident IN ('".implode("','",$flt['idents'])."') AND tracker_archive_output.format_source IN ('".implode("','",$flt['source'])."')) spid ON spid.famtrackid = tracker_archive.famtrackid"; |
|
36 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.ident IN ('".implode("','", $flt['idents'])."') AND tracker_archive_output.format_source IN ('".implode("','", $flt['source'])."')) spid ON spid.famtrackid = tracker_archive.famtrackid"; |
|
37 | 37 | } else { |
38 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.ident IN ('".implode("','",$flt['idents'])."')) spid ON spid.famtrackid = tracker_archive.famtrackid"; |
|
38 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.ident IN ('".implode("','", $flt['idents'])."')) spid ON spid.famtrackid = tracker_archive.famtrackid"; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
42 | 42 | if (isset($filter['source']) && !empty($filter['source'])) { |
43 | - $filter_query_where .= " AND format_source IN ('".implode("','",$filter['source'])."')"; |
|
43 | + $filter_query_where .= " AND format_source IN ('".implode("','", $filter['source'])."')"; |
|
44 | 44 | } |
45 | 45 | if (isset($filter['ident']) && !empty($filter['ident'])) { |
46 | 46 | $filter_query_where .= " AND ident = '".$filter['ident']."'"; |
@@ -68,38 +68,38 @@ discard block |
||
68 | 68 | $filter_query_date .= " AND EXTRACT(DAY FROM tracker_archive_output.date) = '".$filter['day']."'"; |
69 | 69 | } |
70 | 70 | } |
71 | - $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output".preg_replace('/^ AND/',' WHERE',$filter_query_date).") sd ON sd.famtrackid = tracker_archive.famtrackid"; |
|
71 | + $filter_query_join .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output".preg_replace('/^ AND/', ' WHERE', $filter_query_date).") sd ON sd.famtrackid = tracker_archive.famtrackid"; |
|
72 | 72 | } |
73 | 73 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
74 | - $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
74 | + $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
75 | 75 | } |
76 | 76 | if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
77 | 77 | elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
78 | 78 | if ($filter_query_where != '') { |
79 | - $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
|
79 | + $filter_query_where = preg_replace('/^ AND/', ' WHERE', $filter_query_where); |
|
80 | 80 | } |
81 | 81 | $filter_query = $filter_query_join.$filter_query_where; |
82 | 82 | return $filter_query; |
83 | 83 | } |
84 | 84 | |
85 | 85 | // tracker_archive |
86 | - public function addTrackerArchiveData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $comment = '', $type = '',$noarchive = false,$format_source = '', $source_name = '', $over_country = '') { |
|
86 | + public function addTrackerArchiveData($famtrackid = '', $ident = '', $latitude = '', $longitude = '', $altitude = '', $heading = '', $groundspeed = '', $date = '', $putinarchive = false, $comment = '', $type = '', $noarchive = false, $format_source = '', $source_name = '', $over_country = '') { |
|
87 | 87 | require_once(dirname(__FILE__).'/class.Tracker.php'); |
88 | 88 | if ($over_country == '') { |
89 | 89 | $Tracker = new Tracker($this->db); |
90 | - $data_country = $Tracker->getCountryFromLatitudeLongitude($latitude,$longitude); |
|
90 | + $data_country = $Tracker->getCountryFromLatitudeLongitude($latitude, $longitude); |
|
91 | 91 | if (!empty($data_country)) $country = $data_country['iso2']; |
92 | 92 | else $country = ''; |
93 | 93 | } else $country = $over_country; |
94 | 94 | // Route is not added in tracker_archive |
95 | - $query = 'INSERT INTO tracker_archive (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, over_country, comment, type) |
|
95 | + $query = 'INSERT INTO tracker_archive (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, over_country, comment, type) |
|
96 | 96 | VALUES (:famtrackid,:ident,:latitude,:longitude,:altitude,:heading,:groundspeed,:date,:format_source, :source_name, :over_country,:comment,:type)'; |
97 | - $query_values = array(':famtrackid' => $famtrackid,':ident' => $ident,':latitude' => $latitude,':longitude' => $longitude,':altitude' => $altitude,':heading' => $heading,':groundspeed' => $groundspeed,':date' => $date, ':format_source' => $format_source, ':source_name' => $source_name, ':over_country' => $country,':comment' => $comment,':type' => $type); |
|
97 | + $query_values = array(':famtrackid' => $famtrackid, ':ident' => $ident, ':latitude' => $latitude, ':longitude' => $longitude, ':altitude' => $altitude, ':heading' => $heading, ':groundspeed' => $groundspeed, ':date' => $date, ':format_source' => $format_source, ':source_name' => $source_name, ':over_country' => $country, ':comment' => $comment, ':type' => $type); |
|
98 | 98 | try { |
99 | 99 | $sth = $this->db->prepare($query); |
100 | 100 | $sth->execute($query_values); |
101 | 101 | $sth->closeCursor(); |
102 | - } catch(PDOException $e) { |
|
102 | + } catch (PDOException $e) { |
|
103 | 103 | return "error : ".$e->getMessage(); |
104 | 104 | } |
105 | 105 | return "success"; |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | |
120 | 120 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
121 | 121 | //$query = "SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
122 | - $query = "SELECT tracker_archive.* FROM tracker_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1"; |
|
122 | + $query = "SELECT tracker_archive.* FROM tracker_archive WHERE ident = :ident ORDER BY date DESC LIMIT 1"; |
|
123 | 123 | |
124 | - $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident)); |
|
124 | + $spotter_array = $Tracker->getDataFromDB($query, array(':ident' => $ident)); |
|
125 | 125 | |
126 | 126 | return $spotter_array; |
127 | 127 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
141 | 141 | //$query = TrackerArchive->$global_query." WHERE tracker_archive.famtrackid = :id"; |
142 | 142 | //$query = "SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.famtrackid = :id GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
143 | - $query = "SELECT * FROM tracker_archive WHERE famtrackid = :id ORDER BY date DESC LIMIT 1"; |
|
143 | + $query = "SELECT * FROM tracker_archive WHERE famtrackid = :id ORDER BY date DESC LIMIT 1"; |
|
144 | 144 | |
145 | 145 | // $spotter_array = Tracker->getDataFromDB($query,array(':id' => $id)); |
146 | 146 | /* |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } |
154 | 154 | $spotter_array = $sth->fetchAll(PDO->FETCH_ASSOC); |
155 | 155 | */ |
156 | - $spotter_array = $Tracker->getDataFromDB($query,array(':id' => $id)); |
|
156 | + $spotter_array = $Tracker->getDataFromDB($query, array(':id' => $id)); |
|
157 | 157 | |
158 | 158 | return $spotter_array; |
159 | 159 | } |
@@ -164,19 +164,19 @@ discard block |
||
164 | 164 | * @return Array the spotter information |
165 | 165 | * |
166 | 166 | */ |
167 | - public function getAllArchiveTrackerDataById($id,$date = '') |
|
167 | + public function getAllArchiveTrackerDataById($id, $date = '') |
|
168 | 168 | { |
169 | 169 | date_default_timezone_set('UTC'); |
170 | 170 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
171 | - if ($date == '') $query = $this->global_query." WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
172 | - else $query = $this->global_query." WHERE tracker_archive.famtrackid = :id AND date < '".date('c',$date)."' ORDER BY date"; |
|
171 | + if ($date == '') $query = $this->global_query." WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
172 | + else $query = $this->global_query." WHERE tracker_archive.famtrackid = :id AND date < '".date('c', $date)."' ORDER BY date"; |
|
173 | 173 | |
174 | 174 | // $spotter_array = Tracker->getDataFromDB($query,array(':id' => $id)); |
175 | 175 | |
176 | 176 | try { |
177 | 177 | $sth = $this->db->prepare($query); |
178 | 178 | $sth->execute(array(':id' => $id)); |
179 | - } catch(PDOException $e) { |
|
179 | + } catch (PDOException $e) { |
|
180 | 180 | echo $e->getMessage(); |
181 | 181 | die; |
182 | 182 | } |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | { |
196 | 196 | date_default_timezone_set('UTC'); |
197 | 197 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
198 | - $query = "SELECT tracker_archive.latitude, tracker_archive.longitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id"; |
|
198 | + $query = "SELECT tracker_archive.latitude, tracker_archive.longitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id"; |
|
199 | 199 | |
200 | 200 | // $spotter_array = Tracker->getDataFromDB($query,array(':id' => $id)); |
201 | 201 | |
202 | 202 | try { |
203 | 203 | $sth = $this->db->prepare($query); |
204 | 204 | $sth->execute(array(':id' => $id)); |
205 | - } catch(PDOException $e) { |
|
205 | + } catch (PDOException $e) { |
|
206 | 206 | echo $e->getMessage(); |
207 | 207 | die; |
208 | 208 | } |
@@ -224,12 +224,12 @@ discard block |
||
224 | 224 | date_default_timezone_set('UTC'); |
225 | 225 | |
226 | 226 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
227 | - $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.ident = :ident AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
227 | + $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.ident = :ident AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
228 | 228 | |
229 | 229 | try { |
230 | 230 | $sth = $this->db->prepare($query); |
231 | 231 | $sth->execute(array(':ident' => $ident)); |
232 | - } catch(PDOException $e) { |
|
232 | + } catch (PDOException $e) { |
|
233 | 233 | echo $e->getMessage(); |
234 | 234 | die; |
235 | 235 | } |
@@ -250,12 +250,12 @@ discard block |
||
250 | 250 | date_default_timezone_set('UTC'); |
251 | 251 | |
252 | 252 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
253 | - $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
253 | + $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id AND tracker_archive.latitude <> 0 AND tracker_archive.longitude <> 0 ORDER BY date"; |
|
254 | 254 | |
255 | 255 | try { |
256 | 256 | $sth = $this->db->prepare($query); |
257 | 257 | $sth->execute(array(':id' => $id)); |
258 | - } catch(PDOException $e) { |
|
258 | + } catch (PDOException $e) { |
|
259 | 259 | echo $e->getMessage(); |
260 | 260 | die; |
261 | 261 | } |
@@ -276,12 +276,12 @@ discard block |
||
276 | 276 | date_default_timezone_set('UTC'); |
277 | 277 | |
278 | 278 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
279 | - $query = "SELECT tracker_archive.altitude, tracker_archive.ground_speed, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
279 | + $query = "SELECT tracker_archive.altitude, tracker_archive.ground_speed, tracker_archive.date FROM tracker_archive WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
280 | 280 | |
281 | 281 | try { |
282 | 282 | $sth = $this->db->prepare($query); |
283 | 283 | $sth->execute(array(':id' => $id)); |
284 | - } catch(PDOException $e) { |
|
284 | + } catch (PDOException $e) { |
|
285 | 285 | echo $e->getMessage(); |
286 | 286 | die; |
287 | 287 | } |
@@ -303,13 +303,13 @@ discard block |
||
303 | 303 | date_default_timezone_set('UTC'); |
304 | 304 | |
305 | 305 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
306 | - $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
306 | + $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate LIMIT 1"; |
|
307 | 307 | // $query = "SELECT tracker_archive.altitude, tracker_archive.date FROM tracker_archive WHERE tracker_archive.ident = :ident"; |
308 | 308 | |
309 | 309 | try { |
310 | 310 | $sth = $this->db->prepare($query); |
311 | 311 | $sth->execute(array(':ident' => $ident)); |
312 | - } catch(PDOException $e) { |
|
312 | + } catch (PDOException $e) { |
|
313 | 313 | echo $e->getMessage(); |
314 | 314 | die; |
315 | 315 | } |
@@ -326,13 +326,13 @@ discard block |
||
326 | 326 | * @return Array the spotter information |
327 | 327 | * |
328 | 328 | */ |
329 | - public function getTrackerArchiveData($ident,$famtrackid,$date) |
|
329 | + public function getTrackerArchiveData($ident, $famtrackid, $date) |
|
330 | 330 | { |
331 | 331 | $Tracker = new Tracker($this->db); |
332 | 332 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
333 | - $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.famtrackid = :famtrackid AND l.date LIKE :date GROUP BY l.famtrackid) s on spotter_live.famtrackid = s.famtrackid AND spotter_live.date = s.maxdate"; |
|
333 | + $query = "SELECT spotter_live.* FROM spotter_live INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM spotter_live l WHERE l.ident = :ident AND l.famtrackid = :famtrackid AND l.date LIKE :date GROUP BY l.famtrackid) s on spotter_live.famtrackid = s.famtrackid AND spotter_live.date = s.maxdate"; |
|
334 | 334 | |
335 | - $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident,':famtrackid' => $famtrackid,':date' => $date.'%')); |
|
335 | + $spotter_array = $Tracker->getDataFromDB($query, array(':ident' => $ident, ':famtrackid' => $famtrackid, ':date' => $date.'%')); |
|
336 | 336 | |
337 | 337 | return $spotter_array; |
338 | 338 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | try { |
349 | 349 | $sth = $this->db->prepare($query); |
350 | 350 | $sth->execute(); |
351 | - } catch(PDOException $e) { |
|
351 | + } catch (PDOException $e) { |
|
352 | 352 | echo $e->getMessage(); |
353 | 353 | die; |
354 | 354 | } |
@@ -360,24 +360,24 @@ discard block |
||
360 | 360 | * @return Array the spotter information |
361 | 361 | * |
362 | 362 | */ |
363 | - public function getMinLiveTrackerData($begindate,$enddate,$filter = array()) |
|
363 | + public function getMinLiveTrackerData($begindate, $enddate, $filter = array()) |
|
364 | 364 | { |
365 | 365 | global $globalDBdriver, $globalLiveInterval; |
366 | 366 | date_default_timezone_set('UTC'); |
367 | 367 | |
368 | 368 | $filter_query = ''; |
369 | 369 | if (isset($filter['source']) && !empty($filter['source'])) { |
370 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
370 | + $filter_query .= " AND format_source IN ('".implode("','", $filter['source'])."') "; |
|
371 | 371 | } |
372 | 372 | // Use spotter_output also ? |
373 | 373 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
374 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
374 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
375 | 375 | } |
376 | 376 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
377 | 377 | $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
378 | 378 | } |
379 | 379 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
380 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
380 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid |
397 | 397 | AND tracker_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON tracker_archive.aircraft_icao = a.icao'; |
398 | 398 | */ |
399 | - $query = 'SELECT tracker_archive.date,tracker_archive.famtrackid, tracker_archive.ident, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
399 | + $query = 'SELECT tracker_archive.date,tracker_archive.famtrackid, tracker_archive.ident, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
400 | 400 | FROM tracker_archive |
401 | 401 | INNER JOIN (SELECT * FROM aircraft) a on tracker_archive.aircraft_icao = a.icao |
402 | 402 | WHERE tracker_archive.date BETWEEN '."'".$begindate."'".' AND '."'".$begindate."'".' |
403 | 403 | '.$filter_query.' ORDER BY famtrackid'; |
404 | 404 | } else { |
405 | 405 | //$query = 'SELECT tracker_archive.ident, tracker_archive.famtrackid, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE DATE_SUB(UTC_TIMESTAMP(),INTERVAL '.$globalLiveInterval.' SECOND) <= l.date GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate '.$filter_query.'INNER JOIN (SELECT * FROM aircraft) a on tracker_archive.aircraft_icao = a.icao'; |
406 | - $query = 'SELECT tracker_archive.date,tracker_archive.famtrackid, tracker_archive.ident, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
406 | + $query = 'SELECT tracker_archive.date,tracker_archive.famtrackid, tracker_archive.ident, tracker_archive.aircraft_icao, tracker_archive.departure_airport_icao as departure_airport, tracker_archive.arrival_airport_icao as arrival_airport, tracker_archive.latitude, tracker_archive.longitude, tracker_archive.altitude, tracker_archive.heading, tracker_archive.ground_speed, tracker_archive.squawk, a.aircraft_shadow,a.engine_type, a.engine_count, a.wake_category |
|
407 | 407 | FROM tracker_archive |
408 | 408 | INNER JOIN (SELECT * FROM aircraft) a on tracker_archive.aircraft_icao = a.icao |
409 | 409 | WHERE tracker_archive.date >= '."'".$begindate."'".' AND tracker_archive.date <= '."'".$enddate."'".' |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | try { |
414 | 414 | $sth = $this->db->prepare($query); |
415 | 415 | $sth->execute(); |
416 | - } catch(PDOException $e) { |
|
416 | + } catch (PDOException $e) { |
|
417 | 417 | echo $e->getMessage(); |
418 | 418 | die; |
419 | 419 | } |
@@ -428,24 +428,24 @@ discard block |
||
428 | 428 | * @return Array the spotter information |
429 | 429 | * |
430 | 430 | */ |
431 | - public function getMinLiveTrackerDataPlayback($begindate,$enddate,$filter = array()) |
|
431 | + public function getMinLiveTrackerDataPlayback($begindate, $enddate, $filter = array()) |
|
432 | 432 | { |
433 | 433 | global $globalDBdriver, $globalLiveInterval; |
434 | 434 | date_default_timezone_set('UTC'); |
435 | 435 | |
436 | 436 | $filter_query = ''; |
437 | 437 | if (isset($filter['source']) && !empty($filter['source'])) { |
438 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
438 | + $filter_query .= " AND format_source IN ('".implode("','", $filter['source'])."') "; |
|
439 | 439 | } |
440 | 440 | // Should use spotter_output also ? |
441 | 441 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
442 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
442 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
443 | 443 | } |
444 | 444 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
445 | 445 | $filter_query .= " INNER JOIN (SELECT famtrackid FROM tracker_archive_output WHERE tracker_archive_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
446 | 446 | } |
447 | 447 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
448 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
448 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
449 | 449 | } |
450 | 450 | |
451 | 451 | //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | FROM tracker_archive |
456 | 456 | INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE (l.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate '.$filter_query.'LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON tracker_archive.aircraft_icao = a.icao'; |
457 | 457 | */ |
458 | - $query = 'SELECT a.aircraft_shadow, tracker_archive_output.ident, tracker_archive_output.famtrackid, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk |
|
458 | + $query = 'SELECT a.aircraft_shadow, tracker_archive_output.ident, tracker_archive_output.famtrackid, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk |
|
459 | 459 | FROM tracker_archive_output |
460 | 460 | LEFT JOIN (SELECT aircraft_shadow,icao FROM aircraft) a ON tracker_archive_output.aircraft_icao = a.icao |
461 | 461 | WHERE (tracker_archive_output.date BETWEEN '."'".$begindate."'".' AND '."'".$enddate."'".') |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | WHERE tracker_archive_output.date >= '."'".$begindate."'".' AND tracker_archive_output.date <= '."'".$enddate."'".' |
471 | 471 | '.$filter_query.' GROUP BY tracker_archive_output.famtrackid, tracker_archive_output.ident, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao, tracker_archive_output.arrival_airport_icao, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow'; |
472 | 472 | */ |
473 | - $query = 'SELECT DISTINCT tracker_archive_output.famtrackid, tracker_archive_output.ident, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow |
|
473 | + $query = 'SELECT DISTINCT tracker_archive_output.famtrackid, tracker_archive_output.ident, tracker_archive_output.aircraft_icao, tracker_archive_output.departure_airport_icao as departure_airport, tracker_archive_output.arrival_airport_icao as arrival_airport, tracker_archive_output.latitude, tracker_archive_output.longitude, tracker_archive_output.altitude, tracker_archive_output.heading, tracker_archive_output.ground_speed, tracker_archive_output.squawk, a.aircraft_shadow |
|
474 | 474 | FROM tracker_archive_output |
475 | 475 | INNER JOIN (SELECT * FROM aircraft) a on tracker_archive_output.aircraft_icao = a.icao |
476 | 476 | WHERE tracker_archive_output.date >= '."'".$begindate."'".' AND tracker_archive_output.date <= '."'".$enddate."'".' |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | try { |
483 | 483 | $sth = $this->db->prepare($query); |
484 | 484 | $sth->execute(); |
485 | - } catch(PDOException $e) { |
|
485 | + } catch (PDOException $e) { |
|
486 | 486 | echo $e->getMessage(); |
487 | 487 | die; |
488 | 488 | } |
@@ -497,23 +497,23 @@ discard block |
||
497 | 497 | * @return Array the spotter information |
498 | 498 | * |
499 | 499 | */ |
500 | - public function getLiveTrackerCount($begindate,$enddate,$filter = array()) |
|
500 | + public function getLiveTrackerCount($begindate, $enddate, $filter = array()) |
|
501 | 501 | { |
502 | 502 | global $globalDBdriver, $globalLiveInterval; |
503 | 503 | date_default_timezone_set('UTC'); |
504 | 504 | |
505 | 505 | $filter_query = ''; |
506 | 506 | if (isset($filter['source']) && !empty($filter['source'])) { |
507 | - $filter_query .= " AND format_source IN ('".implode("','",$filter['source'])."') "; |
|
507 | + $filter_query .= " AND format_source IN ('".implode("','", $filter['source'])."') "; |
|
508 | 508 | } |
509 | 509 | if (isset($filter['airlines']) && !empty($filter['airlines'])) { |
510 | - $filter_query .= " INNER JOIN (SELECT famtrackid FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','",$filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
510 | + $filter_query .= " INNER JOIN (SELECT famtrackid FROM spotter_output WHERE spotter_output.airline_icao IN ('".implode("','", $filter['airlines'])."')) so ON so.famtrackid = tracker_archive.famtrackid "; |
|
511 | 511 | } |
512 | 512 | if (isset($filter['airlinestype']) && !empty($filter['airlinestype'])) { |
513 | 513 | $filter_query .= " INNER JOIN (SELECT famtrackid FROM spotter_output WHERE spotter_output.airline_type = '".$filter['airlinestype']."') sa ON sa.famtrackid = tracker_archive.famtrackid "; |
514 | 514 | } |
515 | 515 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
516 | - $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
|
516 | + $filter_query = " AND format_source = 'aprs' AND source_name IN ('".implode("','", $filter['source_aprs'])."')"; |
|
517 | 517 | } |
518 | 518 | |
519 | 519 | //if (!isset($globalLiveInterval)) $globalLiveInterval = '200'; |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | try { |
529 | 529 | $sth = $this->db->prepare($query); |
530 | 530 | $sth->execute(); |
531 | - } catch(PDOException $e) { |
|
531 | + } catch (PDOException $e) { |
|
532 | 532 | echo $e->getMessage(); |
533 | 533 | die; |
534 | 534 | } |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | * @return Array the spotter information |
549 | 549 | * |
550 | 550 | */ |
551 | - public function searchTrackerData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '',$pilot_id = '',$pilot_name = '',$altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '',$origLat = '',$origLon = '',$dist = '', $filters=array()) |
|
551 | + public function searchTrackerData($q = '', $registration = '', $aircraft_icao = '', $aircraft_manufacturer = '', $highlights = '', $airline_icao = '', $airline_country = '', $airline_type = '', $airport = '', $airport_country = '', $callsign = '', $departure_airport_route = '', $arrival_airport_route = '', $owner = '', $pilot_id = '', $pilot_name = '', $altitude = '', $date_posted = '', $limit = '', $sort = '', $includegeodata = '', $origLat = '', $origLon = '', $dist = '', $filters = array()) |
|
552 | 552 | { |
553 | 553 | global $globalTimezone, $globalDBdriver; |
554 | 554 | require_once(dirname(__FILE__).'/class.Translation.php'); |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | |
571 | 571 | $q_array = explode(" ", $q); |
572 | 572 | |
573 | - foreach ($q_array as $q_item){ |
|
573 | + foreach ($q_array as $q_item) { |
|
574 | 574 | $additional_query .= " AND ("; |
575 | 575 | $additional_query .= "(tracker_archive_output.spotter_id like '%".$q_item."%') OR "; |
576 | 576 | $additional_query .= "(tracker_archive_output.aircraft_icao like '%".$q_item."%') OR "; |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | |
603 | 603 | if ($registration != "") |
604 | 604 | { |
605 | - $registration = filter_var($registration,FILTER_SANITIZE_STRING); |
|
605 | + $registration = filter_var($registration, FILTER_SANITIZE_STRING); |
|
606 | 606 | if (!is_string($registration)) |
607 | 607 | { |
608 | 608 | return false; |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | |
614 | 614 | if ($aircraft_icao != "") |
615 | 615 | { |
616 | - $aircraft_icao = filter_var($aircraft_icao,FILTER_SANITIZE_STRING); |
|
616 | + $aircraft_icao = filter_var($aircraft_icao, FILTER_SANITIZE_STRING); |
|
617 | 617 | if (!is_string($aircraft_icao)) |
618 | 618 | { |
619 | 619 | return false; |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | |
625 | 625 | if ($aircraft_manufacturer != "") |
626 | 626 | { |
627 | - $aircraft_manufacturer = filter_var($aircraft_manufacturer,FILTER_SANITIZE_STRING); |
|
627 | + $aircraft_manufacturer = filter_var($aircraft_manufacturer, FILTER_SANITIZE_STRING); |
|
628 | 628 | if (!is_string($aircraft_manufacturer)) |
629 | 629 | { |
630 | 630 | return false; |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | |
646 | 646 | if ($airline_icao != "") |
647 | 647 | { |
648 | - $airline_icao = filter_var($airline_icao,FILTER_SANITIZE_STRING); |
|
648 | + $airline_icao = filter_var($airline_icao, FILTER_SANITIZE_STRING); |
|
649 | 649 | if (!is_string($airline_icao)) |
650 | 650 | { |
651 | 651 | return false; |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | |
657 | 657 | if ($airline_country != "") |
658 | 658 | { |
659 | - $airline_country = filter_var($airline_country,FILTER_SANITIZE_STRING); |
|
659 | + $airline_country = filter_var($airline_country, FILTER_SANITIZE_STRING); |
|
660 | 660 | if (!is_string($airline_country)) |
661 | 661 | { |
662 | 662 | return false; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | |
668 | 668 | if ($airline_type != "") |
669 | 669 | { |
670 | - $airline_type = filter_var($airline_type,FILTER_SANITIZE_STRING); |
|
670 | + $airline_type = filter_var($airline_type, FILTER_SANITIZE_STRING); |
|
671 | 671 | if (!is_string($airline_type)) |
672 | 672 | { |
673 | 673 | return false; |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | |
690 | 690 | if ($airport != "") |
691 | 691 | { |
692 | - $airport = filter_var($airport,FILTER_SANITIZE_STRING); |
|
692 | + $airport = filter_var($airport, FILTER_SANITIZE_STRING); |
|
693 | 693 | if (!is_string($airport)) |
694 | 694 | { |
695 | 695 | return false; |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | |
701 | 701 | if ($airport_country != "") |
702 | 702 | { |
703 | - $airport_country = filter_var($airport_country,FILTER_SANITIZE_STRING); |
|
703 | + $airport_country = filter_var($airport_country, FILTER_SANITIZE_STRING); |
|
704 | 704 | if (!is_string($airport_country)) |
705 | 705 | { |
706 | 706 | return false; |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | |
712 | 712 | if ($callsign != "") |
713 | 713 | { |
714 | - $callsign = filter_var($callsign,FILTER_SANITIZE_STRING); |
|
714 | + $callsign = filter_var($callsign, FILTER_SANITIZE_STRING); |
|
715 | 715 | if (!is_string($callsign)) |
716 | 716 | { |
717 | 717 | return false; |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | $translate = $Translation->ident2icao($callsign); |
720 | 720 | if ($translate != $callsign) { |
721 | 721 | $additional_query .= " AND (tracker_archive_output.ident = :callsign OR tracker_archive_output.ident = :translate)"; |
722 | - $query_values = array_merge($query_values,array(':callsign' => $callsign,':translate' => $translate)); |
|
722 | + $query_values = array_merge($query_values, array(':callsign' => $callsign, ':translate' => $translate)); |
|
723 | 723 | } else { |
724 | 724 | $additional_query .= " AND (tracker_archive_output.ident = '".$callsign."')"; |
725 | 725 | } |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | |
729 | 729 | if ($owner != "") |
730 | 730 | { |
731 | - $owner = filter_var($owner,FILTER_SANITIZE_STRING); |
|
731 | + $owner = filter_var($owner, FILTER_SANITIZE_STRING); |
|
732 | 732 | if (!is_string($owner)) |
733 | 733 | { |
734 | 734 | return false; |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | |
740 | 740 | if ($pilot_name != "") |
741 | 741 | { |
742 | - $pilot_name = filter_var($pilot_name,FILTER_SANITIZE_STRING); |
|
742 | + $pilot_name = filter_var($pilot_name, FILTER_SANITIZE_STRING); |
|
743 | 743 | if (!is_string($pilot_name)) |
744 | 744 | { |
745 | 745 | return false; |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | |
751 | 751 | if ($pilot_id != "") |
752 | 752 | { |
753 | - $pilot_id = filter_var($pilot_id,FILTER_SANITIZE_NUMBER_INT); |
|
753 | + $pilot_id = filter_var($pilot_id, FILTER_SANITIZE_NUMBER_INT); |
|
754 | 754 | if (!is_string($pilot_id)) |
755 | 755 | { |
756 | 756 | return false; |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | |
762 | 762 | if ($departure_airport_route != "") |
763 | 763 | { |
764 | - $departure_airport_route = filter_var($departure_airport_route,FILTER_SANITIZE_STRING); |
|
764 | + $departure_airport_route = filter_var($departure_airport_route, FILTER_SANITIZE_STRING); |
|
765 | 765 | if (!is_string($departure_airport_route)) |
766 | 766 | { |
767 | 767 | return false; |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | |
773 | 773 | if ($arrival_airport_route != "") |
774 | 774 | { |
775 | - $arrival_airport_route = filter_var($arrival_airport_route,FILTER_SANITIZE_STRING); |
|
775 | + $arrival_airport_route = filter_var($arrival_airport_route, FILTER_SANITIZE_STRING); |
|
776 | 776 | if (!is_string($arrival_airport_route)) |
777 | 777 | { |
778 | 778 | return false; |
@@ -785,8 +785,8 @@ discard block |
||
785 | 785 | { |
786 | 786 | $altitude_array = explode(",", $altitude); |
787 | 787 | |
788 | - $altitude_array[0] = filter_var($altitude_array[0],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
789 | - $altitude_array[1] = filter_var($altitude_array[1],FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); |
|
788 | + $altitude_array[0] = filter_var($altitude_array[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
789 | + $altitude_array[1] = filter_var($altitude_array[1], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); |
|
790 | 790 | |
791 | 791 | |
792 | 792 | if ($altitude_array[1] != "") |
@@ -804,8 +804,8 @@ discard block |
||
804 | 804 | { |
805 | 805 | $date_array = explode(",", $date_posted); |
806 | 806 | |
807 | - $date_array[0] = filter_var($date_array[0],FILTER_SANITIZE_STRING); |
|
808 | - $date_array[1] = filter_var($date_array[1],FILTER_SANITIZE_STRING); |
|
807 | + $date_array[0] = filter_var($date_array[0], FILTER_SANITIZE_STRING); |
|
808 | + $date_array[1] = filter_var($date_array[1], FILTER_SANITIZE_STRING); |
|
809 | 809 | |
810 | 810 | if ($globalTimezone != '') { |
811 | 811 | date_default_timezone_set($globalTimezone); |
@@ -837,8 +837,8 @@ discard block |
||
837 | 837 | { |
838 | 838 | $limit_array = explode(",", $limit); |
839 | 839 | |
840 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
841 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
840 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
841 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
842 | 842 | |
843 | 843 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
844 | 844 | { |
@@ -849,8 +849,8 @@ discard block |
||
849 | 849 | |
850 | 850 | |
851 | 851 | if ($origLat != "" && $origLon != "" && $dist != "") { |
852 | - $dist = number_format($dist*0.621371,2,'.',''); |
|
853 | - $query="SELECT tracker_archive_output.*, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - ABS(CAST(tracker_archive.latitude as double precision)))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(ABS(CAST(tracker_archive.latitude as double precision))*pi()/180)*POWER(SIN(($origLon-CAST(tracker_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
852 | + $dist = number_format($dist*0.621371, 2, '.', ''); |
|
853 | + $query = "SELECT tracker_archive_output.*, 3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - ABS(CAST(tracker_archive.latitude as double precision)))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(ABS(CAST(tracker_archive.latitude as double precision))*pi()/180)*POWER(SIN(($origLon-CAST(tracker_archive.longitude as double precision))*pi()/180/2),2))) as distance |
|
854 | 854 | FROM tracker_archive_output, tracker_archive WHERE spotter_output_archive.famtrackid = tracker_archive.famtrackid AND spotter_output.ident <> '' ".$additional_query."AND CAST(tracker_archive.longitude as double precision) between ($origLon-$dist/ABS(cos(radians($origLat))*69)) and ($origLon+$dist/ABS(cos(radians($origLat))*69)) and CAST(tracker_archive.latitude as double precision) between ($origLat-($dist/69)) and ($origLat+($dist/69)) |
855 | 855 | AND (3956 * 2 * ASIN(SQRT( POWER(SIN(($origLat - ABS(CAST(tracker_archive.latitude as double precision)))*pi()/180/2),2)+COS( $origLat *pi()/180)*COS(ABS(CAST(tracker_archive.latitude as double precision))*pi()/180)*POWER(SIN(($origLon-CAST(tracker_archive.longitude as double precision))*pi()/180/2),2)))) < $dist".$filter_query." ORDER BY distance"; |
856 | 856 | } else { |
@@ -867,12 +867,12 @@ discard block |
||
867 | 867 | $additional_query .= " AND (tracker_archive_output.waypoints <> '')"; |
868 | 868 | } |
869 | 869 | |
870 | - $query = "SELECT tracker_archive_output.* FROM tracker_archive_output |
|
870 | + $query = "SELECT tracker_archive_output.* FROM tracker_archive_output |
|
871 | 871 | WHERE tracker_archive_output.ident <> '' |
872 | 872 | ".$additional_query." |
873 | 873 | ".$filter_query.$orderby_query; |
874 | 874 | } |
875 | - $spotter_array = $Tracker->getDataFromDB($query, $query_values,$limit_query); |
|
875 | + $spotter_array = $Tracker->getDataFromDB($query, $query_values, $limit_query); |
|
876 | 876 | |
877 | 877 | return $spotter_array; |
878 | 878 | } |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | try { |
890 | 890 | $sth = $this->db->prepare($query); |
891 | 891 | $sth->execute(); |
892 | - } catch(PDOException $e) { |
|
892 | + } catch (PDOException $e) { |
|
893 | 893 | return "error"; |
894 | 894 | } |
895 | 895 | } |
@@ -926,8 +926,8 @@ discard block |
||
926 | 926 | { |
927 | 927 | $limit_array = explode(",", $limit); |
928 | 928 | |
929 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
930 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
929 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
930 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
931 | 931 | |
932 | 932 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
933 | 933 | { |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | $query_values = array(); |
969 | 969 | $limit_query = ''; |
970 | 970 | $additional_query = ''; |
971 | - $filter_query = $this->getFilter($filter,true,true); |
|
971 | + $filter_query = $this->getFilter($filter, true, true); |
|
972 | 972 | |
973 | 973 | if ($owner != "") |
974 | 974 | { |
@@ -985,8 +985,8 @@ discard block |
||
985 | 985 | { |
986 | 986 | $limit_array = explode(",", $limit); |
987 | 987 | |
988 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
989 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
988 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
989 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
990 | 990 | |
991 | 991 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
992 | 992 | { |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | $query_values = array(); |
1027 | 1027 | $limit_query = ''; |
1028 | 1028 | $additional_query = ''; |
1029 | - $filter_query = $this->getFilter($filter,true,true); |
|
1029 | + $filter_query = $this->getFilter($filter, true, true); |
|
1030 | 1030 | |
1031 | 1031 | if ($pilot != "") |
1032 | 1032 | { |
@@ -1038,8 +1038,8 @@ discard block |
||
1038 | 1038 | { |
1039 | 1039 | $limit_array = explode(",", $limit); |
1040 | 1040 | |
1041 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1042 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
1041 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
1042 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1043 | 1043 | |
1044 | 1044 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
1045 | 1045 | { |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | * @return Array the airline country list |
1070 | 1070 | * |
1071 | 1071 | */ |
1072 | - public function countAllFlightOverCountries($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
1072 | + public function countAllFlightOverCountries($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
1073 | 1073 | { |
1074 | 1074 | global $globalDBdriver; |
1075 | 1075 | /* |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | $flight_array = array(); |
1099 | 1099 | $temp_array = array(); |
1100 | 1100 | |
1101 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1101 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1102 | 1102 | { |
1103 | 1103 | $temp_array['flight_count'] = $row['nb']; |
1104 | 1104 | $temp_array['flight_country'] = $row['name']; |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | * @return Array the airline country list |
1116 | 1116 | * |
1117 | 1117 | */ |
1118 | - public function countAllFlightOverCountriesByAirlines($limit = true,$olderthanmonths = 0,$sincedate = '') |
|
1118 | + public function countAllFlightOverCountriesByAirlines($limit = true, $olderthanmonths = 0, $sincedate = '') |
|
1119 | 1119 | { |
1120 | 1120 | global $globalDBdriver; |
1121 | 1121 | /* |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | $flight_array = array(); |
1145 | 1145 | $temp_array = array(); |
1146 | 1146 | |
1147 | - while($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1147 | + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) |
|
1148 | 1148 | { |
1149 | 1149 | $temp_array['airline_icao'] = $row['airline_icao']; |
1150 | 1150 | $temp_array['flight_count'] = $row['nb']; |
@@ -1162,14 +1162,14 @@ discard block |
||
1162 | 1162 | * @return Array the spotter information |
1163 | 1163 | * |
1164 | 1164 | */ |
1165 | - public function getDateArchiveTrackerDataById($id,$date) |
|
1165 | + public function getDateArchiveTrackerDataById($id, $date) |
|
1166 | 1166 | { |
1167 | 1167 | $Tracker = new Tracker($this->db); |
1168 | 1168 | date_default_timezone_set('UTC'); |
1169 | 1169 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
1170 | - $query = 'SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.famtrackid = :id AND l.date <= :date GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate ORDER BY tracker_archive.date DESC'; |
|
1171 | - $date = date('c',$date); |
|
1172 | - $spotter_array = $Tracker->getDataFromDB($query,array(':id' => $id,':date' => $date)); |
|
1170 | + $query = 'SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.famtrackid = :id AND l.date <= :date GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate ORDER BY tracker_archive.date DESC'; |
|
1171 | + $date = date('c', $date); |
|
1172 | + $spotter_array = $Tracker->getDataFromDB($query, array(':id' => $id, ':date' => $date)); |
|
1173 | 1173 | return $spotter_array; |
1174 | 1174 | } |
1175 | 1175 | |
@@ -1179,14 +1179,14 @@ discard block |
||
1179 | 1179 | * @return Array the spotter information |
1180 | 1180 | * |
1181 | 1181 | */ |
1182 | - public function getDateArchiveTrackerDataByIdent($ident,$date) |
|
1182 | + public function getDateArchiveTrackerDataByIdent($ident, $date) |
|
1183 | 1183 | { |
1184 | 1184 | $Tracker = new Tracker($this->db); |
1185 | 1185 | date_default_timezone_set('UTC'); |
1186 | 1186 | $ident = filter_var($ident, FILTER_SANITIZE_STRING); |
1187 | - $query = 'SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate ORDER BY tracker_archive.date DESC'; |
|
1188 | - $date = date('c',$date); |
|
1189 | - $spotter_array = $Tracker->getDataFromDB($query,array(':ident' => $ident,':date' => $date)); |
|
1187 | + $query = 'SELECT tracker_archive.* FROM tracker_archive INNER JOIN (SELECT l.famtrackid, max(l.date) as maxdate FROM tracker_archive l WHERE l.ident = :ident AND l.date <= :date GROUP BY l.famtrackid) s on tracker_archive.famtrackid = s.famtrackid AND tracker_archive.date = s.maxdate ORDER BY tracker_archive.date DESC'; |
|
1188 | + $date = date('c', $date); |
|
1189 | + $spotter_array = $Tracker->getDataFromDB($query, array(':ident' => $ident, ':date' => $date)); |
|
1190 | 1190 | return $spotter_array; |
1191 | 1191 | } |
1192 | 1192 | |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | * @return Array the spotter information |
1197 | 1197 | * |
1198 | 1198 | */ |
1199 | - public function getTrackerDataByAirport($airport = '', $limit = '', $sort = '',$filters = array()) |
|
1199 | + public function getTrackerDataByAirport($airport = '', $limit = '', $sort = '', $filters = array()) |
|
1200 | 1200 | { |
1201 | 1201 | global $global_query; |
1202 | 1202 | $Tracker = new Tracker($this->db); |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | $query_values = array(); |
1205 | 1205 | $limit_query = ''; |
1206 | 1206 | $additional_query = ''; |
1207 | - $filter_query = $this->getFilter($filters,true,true); |
|
1207 | + $filter_query = $this->getFilter($filters, true, true); |
|
1208 | 1208 | |
1209 | 1209 | if ($airport != "") |
1210 | 1210 | { |
@@ -1221,8 +1221,8 @@ discard block |
||
1221 | 1221 | { |
1222 | 1222 | $limit_array = explode(",", $limit); |
1223 | 1223 | |
1224 | - $limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT); |
|
1225 | - $limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT); |
|
1224 | + $limit_array[0] = filter_var($limit_array[0], FILTER_SANITIZE_NUMBER_INT); |
|
1225 | + $limit_array[1] = filter_var($limit_array[1], FILTER_SANITIZE_NUMBER_INT); |
|
1226 | 1226 | |
1227 | 1227 | if ($limit_array[0] >= 0 && $limit_array[1] >= 0) |
1228 | 1228 | { |
@@ -6,7 +6,9 @@ discard block |
||
6 | 6 | public function __construct($dbc = null) { |
7 | 7 | $Connection = new Connection($dbc); |
8 | 8 | $this->db = $Connection->db; |
9 | - if ($this->db === null) die('Error: No DB connection. (TrackerArchive)'); |
|
9 | + if ($this->db === null) { |
|
10 | + die('Error: No DB connection. (TrackerArchive)'); |
|
11 | + } |
|
10 | 12 | } |
11 | 13 | |
12 | 14 | /** |
@@ -27,7 +29,9 @@ discard block |
||
27 | 29 | if (isset($filter[0]['source'])) { |
28 | 30 | $filters = array_merge($filters,$filter); |
29 | 31 | } |
30 | - if (is_array($globalFilter)) $filter = array_merge($filter,$globalFilter); |
|
32 | + if (is_array($globalFilter)) { |
|
33 | + $filter = array_merge($filter,$globalFilter); |
|
34 | + } |
|
31 | 35 | $filter_query_join = ''; |
32 | 36 | $filter_query_where = ''; |
33 | 37 | foreach($filters as $flt) { |
@@ -73,8 +77,11 @@ discard block |
||
73 | 77 | if (isset($filter['source_aprs']) && !empty($filter['source_aprs'])) { |
74 | 78 | $filter_query_where .= " AND format_source = 'aprs' AND source_name IN ('".implode("','",$filter['source_aprs'])."')"; |
75 | 79 | } |
76 | - if ($filter_query_where == '' && $where) $filter_query_where = ' WHERE'; |
|
77 | - elseif ($filter_query_where != '' && $and) $filter_query_where .= ' AND'; |
|
80 | + if ($filter_query_where == '' && $where) { |
|
81 | + $filter_query_where = ' WHERE'; |
|
82 | + } elseif ($filter_query_where != '' && $and) { |
|
83 | + $filter_query_where .= ' AND'; |
|
84 | + } |
|
78 | 85 | if ($filter_query_where != '') { |
79 | 86 | $filter_query_where = preg_replace('/^ AND/',' WHERE',$filter_query_where); |
80 | 87 | } |
@@ -88,9 +95,14 @@ discard block |
||
88 | 95 | if ($over_country == '') { |
89 | 96 | $Tracker = new Tracker($this->db); |
90 | 97 | $data_country = $Tracker->getCountryFromLatitudeLongitude($latitude,$longitude); |
91 | - if (!empty($data_country)) $country = $data_country['iso2']; |
|
92 | - else $country = ''; |
|
93 | - } else $country = $over_country; |
|
98 | + if (!empty($data_country)) { |
|
99 | + $country = $data_country['iso2']; |
|
100 | + } else { |
|
101 | + $country = ''; |
|
102 | + } |
|
103 | + } else { |
|
104 | + $country = $over_country; |
|
105 | + } |
|
94 | 106 | // Route is not added in tracker_archive |
95 | 107 | $query = 'INSERT INTO tracker_archive (famtrackid, ident, latitude, longitude, altitude, heading, ground_speed, date, format_source, source_name, over_country, comment, type) |
96 | 108 | VALUES (:famtrackid,:ident,:latitude,:longitude,:altitude,:heading,:groundspeed,:date,:format_source, :source_name, :over_country,:comment,:type)'; |
@@ -168,8 +180,11 @@ discard block |
||
168 | 180 | { |
169 | 181 | date_default_timezone_set('UTC'); |
170 | 182 | $id = filter_var($id, FILTER_SANITIZE_STRING); |
171 | - if ($date == '') $query = $this->global_query." WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
172 | - else $query = $this->global_query." WHERE tracker_archive.famtrackid = :id AND date < '".date('c',$date)."' ORDER BY date"; |
|
183 | + if ($date == '') { |
|
184 | + $query = $this->global_query." WHERE tracker_archive.famtrackid = :id ORDER BY date"; |
|
185 | + } else { |
|
186 | + $query = $this->global_query." WHERE tracker_archive.famtrackid = :id AND date < '".date('c',$date)."' ORDER BY date"; |
|
187 | + } |
|
173 | 188 | |
174 | 189 | // $spotter_array = Tracker->getDataFromDB($query,array(':id' => $id)); |
175 | 190 | |
@@ -593,7 +608,9 @@ discard block |
||
593 | 608 | $additional_query .= "(tracker_archive_output.pilot_name like '%".$q_item."%') OR "; |
594 | 609 | $additional_query .= "(tracker_archive_output.ident like '%".$q_item."%') OR "; |
595 | 610 | $translate = $Translation->ident2icao($q_item); |
596 | - if ($translate != $q_item) $additional_query .= "(tracker_archive_output.ident like '%".$translate."%') OR "; |
|
611 | + if ($translate != $q_item) { |
|
612 | + $additional_query .= "(tracker_archive_output.ident like '%".$translate."%') OR "; |
|
613 | + } |
|
597 | 614 | $additional_query .= "(tracker_archive_output.highlight like '%".$q_item."%')"; |
598 | 615 | $additional_query .= ")"; |
599 | 616 | } |
@@ -811,7 +828,9 @@ discard block |
||
811 | 828 | date_default_timezone_set($globalTimezone); |
812 | 829 | $datetime = new DateTime(); |
813 | 830 | $offset = $datetime->format('P'); |
814 | - } else $offset = '+00:00'; |
|
831 | + } else { |
|
832 | + $offset = '+00:00'; |
|
833 | + } |
|
815 | 834 | |
816 | 835 | |
817 | 836 | if ($date_array[1] != "") |
@@ -1087,9 +1106,13 @@ discard block |
||
1087 | 1106 | $query .= "AND date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
1088 | 1107 | } |
1089 | 1108 | } |
1090 | - if ($sincedate != '') $query .= "AND date > '".$sincedate."' "; |
|
1109 | + if ($sincedate != '') { |
|
1110 | + $query .= "AND date > '".$sincedate."' "; |
|
1111 | + } |
|
1091 | 1112 | $query .= "GROUP BY c.name, c.iso3, c.iso2 ORDER BY nb DESC"; |
1092 | - if ($limit) $query .= " LIMIT 0,10"; |
|
1113 | + if ($limit) { |
|
1114 | + $query .= " LIMIT 0,10"; |
|
1115 | + } |
|
1093 | 1116 | |
1094 | 1117 | |
1095 | 1118 | $sth = $this->db->prepare($query); |
@@ -1133,9 +1156,13 @@ discard block |
||
1133 | 1156 | $query .= "AND s.date < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' - INTERVAL '".$olderthanmonths." MONTHS'"; |
1134 | 1157 | } |
1135 | 1158 | } |
1136 | - if ($sincedate != '') $query .= "AND s.date > '".$sincedate."' "; |
|
1159 | + if ($sincedate != '') { |
|
1160 | + $query .= "AND s.date > '".$sincedate."' "; |
|
1161 | + } |
|
1137 | 1162 | $query .= "GROUP BY o.airline_icao,c.name, c.iso3, c.iso2 ORDER BY nb DESC"; |
1138 | - if ($limit) $query .= " LIMIT 0,10"; |
|
1163 | + if ($limit) { |
|
1164 | + $query .= " LIMIT 0,10"; |
|
1165 | + } |
|
1139 | 1166 | |
1140 | 1167 | |
1141 | 1168 | $sth = $this->db->prepare($query); |
@@ -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 | // Compressed GeoJson is used if true |
8 | 8 | if (!isset($globalJsonCompress)) $compress = true; |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | |
17 | 17 | <?php |
18 | 18 | if (isset($_GET['fammarine_id'])) { |
19 | - $fammarine_id = filter_input(INPUT_GET,'fammarine_id',FILTER_SANITIZE_STRING); |
|
19 | + $fammarine_id = filter_input(INPUT_GET, 'fammarine_id', FILTER_SANITIZE_STRING); |
|
20 | 20 | } |
21 | 21 | if (isset($_GET['ident'])) { |
22 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
22 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
23 | 23 | } |
24 | 24 | if (!isset($ident) && !isset($fammarine_id)) { |
25 | 25 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | <?php |
183 | 183 | } else { |
184 | 184 | ?> |
185 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
185 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
186 | 186 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
187 | 187 | <?php |
188 | 188 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /* |
199 | 199 | shadowUrl: iconURLShadowpath, |
200 | 200 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
201 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
201 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
202 | 202 | */ |
203 | 203 | }) |
204 | 204 | }) |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <?php |
232 | 232 | } else { |
233 | 233 | ?> |
234 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
234 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
235 | 235 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
236 | 236 | <?php |
237 | 237 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <?php |
280 | 280 | } else { |
281 | 281 | ?> |
282 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
282 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
283 | 283 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
284 | 284 | <?php |
285 | 285 | } |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | |
12 | 15 | |
@@ -156,9 +159,13 @@ discard block |
||
156 | 159 | if (callsign != ""){ markerMarineLabel += callsign; } |
157 | 160 | if (type != ""){ markerMarineLabel += ' - '+type; } |
158 | 161 | <?php |
159 | - if (isset($_COOKIE['MarineIconColor'])) $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
160 | - elseif (isset($globalMarineIconColor)) $MarineIconColor = $globalMarineIconColor; |
|
161 | - else $MarineIconColor = '1a3151'; |
|
162 | + if (isset($_COOKIE['MarineIconColor'])) { |
|
163 | + $MarineIconColor = $_COOKIE['MarineIconColor']; |
|
164 | + } elseif (isset($globalMarineIconColor)) { |
|
165 | + $MarineIconColor = $globalMarineIconColor; |
|
166 | + } else { |
|
167 | + $MarineIconColor = '1a3151'; |
|
168 | + } |
|
162 | 169 | if (!isset($ident) && !isset($fammarine_id)) { |
163 | 170 | ?> |
164 | 171 | //info_marine_update(feature.properties.fc); |
@@ -193,7 +200,12 @@ discard block |
||
193 | 200 | <?php |
194 | 201 | } else { |
195 | 202 | ?> |
196 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
203 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
204 | + print $archiveupdatetime*1000; |
|
205 | +} else { |
|
206 | + print $globalMapRefresh*1000+20000; |
|
207 | +} |
|
208 | +?>+feature.properties.sqt*1000); |
|
197 | 209 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
198 | 210 | <?php |
199 | 211 | } |
@@ -249,7 +261,12 @@ discard block |
||
249 | 261 | <?php |
250 | 262 | } else { |
251 | 263 | ?> |
252 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
264 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
265 | + print $archiveupdatetime*1000; |
|
266 | +} else { |
|
267 | + print $globalMapRefresh*1000+20000; |
|
268 | +} |
|
269 | +?>+feature.properties.sqt*1000); |
|
253 | 270 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
254 | 271 | <?php |
255 | 272 | } |
@@ -304,7 +321,12 @@ discard block |
||
304 | 321 | <?php |
305 | 322 | } else { |
306 | 323 | ?> |
307 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
324 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
325 | + print $archiveupdatetime*1000; |
|
326 | +} else { |
|
327 | + print $globalMapRefresh*1000+20000; |
|
328 | +} |
|
329 | +?>+feature.properties.sqt*1000); |
|
308 | 330 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
309 | 331 | <?php |
310 | 332 | } |
@@ -594,14 +616,24 @@ discard block |
||
594 | 616 | if (isset($archive) && $archive) { |
595 | 617 | ?> |
596 | 618 | //then load it again every 30 seconds |
597 | -// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
619 | +// var reload = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
620 | + print ($globalMapRefresh*1000)/2; |
|
621 | +} else { |
|
622 | + print '15000'; |
|
623 | +} |
|
624 | +?>); |
|
598 | 625 | reloadMarinePage = setInterval(function(){if (noTimeout) getLiveMarineData(0)},<?php print $archiveupdatetime*1000; ?>); |
599 | 626 | <?php |
600 | 627 | } else { |
601 | 628 | ?> |
602 | 629 | //then load it again every 30 seconds |
603 | 630 | reloadMarinePage = setInterval( |
604 | - function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
631 | + function(){if (noTimeout) getLiveMarineData(0)},<?php if (isset($globalMapRefresh)) { |
|
632 | + print $globalMapRefresh*1000; |
|
633 | +} else { |
|
634 | + print '30000'; |
|
635 | +} |
|
636 | +?>); |
|
605 | 637 | <?php |
606 | 638 | } |
607 | 639 | ?> |
@@ -553,8 +553,8 @@ discard block |
||
553 | 553 | } |
554 | 554 | } |
555 | 555 | <?php |
556 | - } else { |
|
557 | - ?> |
|
556 | + } else { |
|
557 | + ?> |
|
558 | 558 | if (map.getZoom() > 7) { |
559 | 559 | var style = { |
560 | 560 | "color": "#1a3151", |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | layer_marine_data.addLayer(layer); |
574 | 574 | } |
575 | 575 | <?php |
576 | - } |
|
576 | + } |
|
577 | 577 | ?> |
578 | 578 | } |
579 | 579 | } |
@@ -598,11 +598,11 @@ discard block |
||
598 | 598 | $( document ).ready(function() { |
599 | 599 | map.on('moveend', function() { |
600 | 600 | <?php |
601 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
601 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
602 | 602 | ?> |
603 | 603 | getLiveMarineData(1); |
604 | 604 | <?php |
605 | - } |
|
605 | + } |
|
606 | 606 | ?> |
607 | 607 | }); |
608 | 608 | //load the function on startup |
@@ -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 | // Compressed GeoJson is used if true |
8 | 8 | if (!isset($globalJsonCompress)) $compress = true; |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | |
18 | 18 | <?php |
19 | 19 | if (isset($_GET['famtrackid'])) { |
20 | - $famtrackid = filter_input(INPUT_GET,'famtrackid',FILTER_SANITIZE_STRING); |
|
20 | + $famtrackid = filter_input(INPUT_GET, 'famtrackid', FILTER_SANITIZE_STRING); |
|
21 | 21 | } |
22 | 22 | if (isset($_GET['ident'])) { |
23 | - $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING); |
|
23 | + $ident = filter_input(INPUT_GET, 'ident', FILTER_SANITIZE_STRING); |
|
24 | 24 | } |
25 | 25 | if (!isset($ident) && !isset($famtrackid)) { |
26 | 26 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | <?php |
183 | 183 | } else { |
184 | 184 | ?> |
185 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
185 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
186 | 186 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
187 | 187 | <?php |
188 | 188 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /* |
199 | 199 | shadowUrl: iconURLShadowpath, |
200 | 200 | shadowSize: [<?php print $globalAircraftSize; ?>, <?php print $globalAircraftSize; ?>], |
201 | - shadowAnchor: [<?php print ($globalAircraftSize/2)+1; ?>, <?php print $globalAircraftSize; ?>] |
|
201 | + shadowAnchor: [<?php print ($globalAircraftSize/2) + 1; ?>, <?php print $globalAircraftSize; ?>] |
|
202 | 202 | */ |
203 | 203 | }) |
204 | 204 | }) |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <?php |
232 | 232 | } else { |
233 | 233 | ?> |
234 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
234 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
235 | 235 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
236 | 236 | <?php |
237 | 237 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <?php |
280 | 280 | } else { |
281 | 281 | ?> |
282 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
282 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000 + 20000; ?>+feature.properties.sqt*1000); |
|
283 | 283 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
284 | 284 | <?php |
285 | 285 | } |
@@ -5,8 +5,11 @@ discard block |
||
5 | 5 | setcookie("MapFormat",'2d'); |
6 | 6 | |
7 | 7 | // Compressed GeoJson is used if true |
8 | -if (!isset($globalJsonCompress)) $compress = true; |
|
9 | -else $compress = $globalJsonCompress; |
|
8 | +if (!isset($globalJsonCompress)) { |
|
9 | + $compress = true; |
|
10 | +} else { |
|
11 | + $compress = $globalJsonCompress; |
|
12 | +} |
|
10 | 13 | ?> |
11 | 14 | |
12 | 15 | |
@@ -157,9 +160,13 @@ discard block |
||
157 | 160 | if (callsign != ""){ markerTrackerLabel += callsign; } |
158 | 161 | if (type != ""){ markerTrackerLabel += ' - '+type; } |
159 | 162 | <?php |
160 | - if (isset($_COOKIE['TrackerIconColor'])) $IconColor = $_COOKIE['TrackerIconColor']; |
|
161 | - elseif (isset($globalTrackerIconColor)) $IconColor = $globalTrackerIconColor; |
|
162 | - else $IconColor = '1a3151'; |
|
163 | + if (isset($_COOKIE['TrackerIconColor'])) { |
|
164 | + $IconColor = $_COOKIE['TrackerIconColor']; |
|
165 | + } elseif (isset($globalTrackerIconColor)) { |
|
166 | + $IconColor = $globalTrackerIconColor; |
|
167 | + } else { |
|
168 | + $IconColor = '1a3151'; |
|
169 | + } |
|
163 | 170 | if (!isset($ident) && !isset($famtrackid)) { |
164 | 171 | ?> |
165 | 172 | //info_tracker_update(feature.properties.fc); |
@@ -193,7 +200,12 @@ discard block |
||
193 | 200 | <?php |
194 | 201 | } else { |
195 | 202 | ?> |
196 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
203 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
204 | + print $archiveupdatetime*1000; |
|
205 | +} else { |
|
206 | + print $globalMapRefresh*1000+20000; |
|
207 | +} |
|
208 | +?>+feature.properties.sqt*1000); |
|
197 | 209 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
198 | 210 | <?php |
199 | 211 | } |
@@ -249,7 +261,12 @@ discard block |
||
249 | 261 | <?php |
250 | 262 | } else { |
251 | 263 | ?> |
252 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
264 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
265 | + print $archiveupdatetime*1000; |
|
266 | +} else { |
|
267 | + print $globalMapRefresh*1000+20000; |
|
268 | +} |
|
269 | +?>+feature.properties.sqt*1000); |
|
253 | 270 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
254 | 271 | <?php |
255 | 272 | } |
@@ -304,7 +321,12 @@ discard block |
||
304 | 321 | <?php |
305 | 322 | } else { |
306 | 323 | ?> |
307 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
324 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
325 | + print $archiveupdatetime*1000; |
|
326 | +} else { |
|
327 | + print $globalMapRefresh*1000+20000; |
|
328 | +} |
|
329 | +?>+feature.properties.sqt*1000); |
|
308 | 330 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
309 | 331 | <?php |
310 | 332 | } |
@@ -595,14 +617,24 @@ discard block |
||
595 | 617 | if (isset($archive) && $archive) { |
596 | 618 | ?> |
597 | 619 | //then load it again every 30 seconds |
598 | -// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
620 | +// var reload = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
621 | + print ($globalMapRefresh*1000)/2; |
|
622 | +} else { |
|
623 | + print '15000'; |
|
624 | +} |
|
625 | +?>); |
|
599 | 626 | reloadTrackerPage = setInterval(function(){if (noTimeout) getLiveTrackerData(0)},<?php print $archiveupdatetime*1000; ?>); |
600 | 627 | <?php |
601 | 628 | } else { |
602 | 629 | ?> |
603 | 630 | //then load it again every 30 seconds |
604 | 631 | reloadTrackerPage = setInterval( |
605 | - function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
632 | + function(){if (noTimeout) getLiveTrackerData(0)},<?php if (isset($globalMapRefresh)) { |
|
633 | + print $globalMapRefresh*1000; |
|
634 | +} else { |
|
635 | + print '30000'; |
|
636 | +} |
|
637 | +?>); |
|
606 | 638 | <?php |
607 | 639 | } |
608 | 640 | ?> |
@@ -554,8 +554,8 @@ discard block |
||
554 | 554 | } |
555 | 555 | } |
556 | 556 | <?php |
557 | - } else { |
|
558 | - ?> |
|
557 | + } else { |
|
558 | + ?> |
|
559 | 559 | if (map.getZoom() > 7) { |
560 | 560 | var style = { |
561 | 561 | "color": "#1a3151", |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | layer_tracker_data.addLayer(layer); |
575 | 575 | } |
576 | 576 | <?php |
577 | - } |
|
577 | + } |
|
578 | 578 | ?> |
579 | 579 | } |
580 | 580 | } |
@@ -599,11 +599,11 @@ discard block |
||
599 | 599 | $( document ).ready(function() { |
600 | 600 | map.on('moveend', function() { |
601 | 601 | <?php |
602 | - if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
602 | + if (isset($globalMapUseBbox) && $globalMapUseBbox) { |
|
603 | 603 | ?> |
604 | 604 | getLiveTrackerData(1); |
605 | 605 | <?php |
606 | - } |
|
606 | + } |
|
607 | 607 | ?> |
608 | 608 | }); |
609 | 609 | //load the function on startup |
@@ -21,7 +21,7 @@ |
||
21 | 21 | } |
22 | 22 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
23 | 23 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
24 | + if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | require_once('header.php'); |
@@ -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 | if ($type == 'aircraft') $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
68 | 68 | elseif ($type == 'marine') $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | print '</thead>'; |
114 | 114 | print '<tbody>'; |
115 | 115 | $i = 1; |
116 | - array_splice($flightover_array,10); |
|
117 | - foreach($flightover_array as $flightover_item) |
|
116 | + array_splice($flightover_array, 10); |
|
117 | + foreach ($flightover_array as $flightover_item) |
|
118 | 118 | { |
119 | 119 | print '<tr>'; |
120 | 120 | print '<td><strong>'.$i.'</strong></td>'; |
@@ -4,7 +4,9 @@ discard block |
||
4 | 4 | require_once('require/class.Language.php'); |
5 | 5 | $Stats = new Stats(); |
6 | 6 | |
7 | -if (!isset($filter_name)) $filter_name = ''; |
|
7 | +if (!isset($filter_name)) { |
|
8 | + $filter_name = ''; |
|
9 | +} |
|
8 | 10 | $type = 'aircraft'; |
9 | 11 | if (isset($_GET['marine'])) { |
10 | 12 | $type = 'marine'; |
@@ -21,8 +23,10 @@ discard block |
||
21 | 23 | } |
22 | 24 | $airline_icao = (string)filter_input(INPUT_GET,'airline',FILTER_SANITIZE_STRING); |
23 | 25 | if ($airline_icao == '' && isset($globalFilter)) { |
24 | - if (isset($globalFilter['airline'])) $airline_icao = $globalFilter['airline'][0]; |
|
25 | -} |
|
26 | + if (isset($globalFilter['airline'])) { |
|
27 | + $airline_icao = $globalFilter['airline'][0]; |
|
28 | + } |
|
29 | + } |
|
26 | 30 | |
27 | 31 | require_once('header.php'); |
28 | 32 | include('statistics-sub-menu.php'); |
@@ -64,10 +68,14 @@ discard block |
||
64 | 68 | $flightover_data = ''; |
65 | 69 | foreach($flightover_array as $flightover_item) |
66 | 70 | { |
67 | - if ($type == 'aircraft') $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
|
68 | - elseif ($type == 'marine') $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
|
69 | - elseif ($type == 'tracker') $flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],'; |
|
70 | -} |
|
71 | + if ($type == 'aircraft') { |
|
72 | + $flightover_data .= '[ "'.$flightover_item['flight_country_iso3'].'",'.$flightover_item['flight_count'].'],'; |
|
73 | + } elseif ($type == 'marine') { |
|
74 | + $flightover_data .= '[ "'.$flightover_item['marine_country_iso3'].'",'.$flightover_item['marine_count'].'],'; |
|
75 | + } elseif ($type == 'tracker') { |
|
76 | + $flightover_data .= '[ "'.$flightover_item['tracker_country_iso3'].'",'.$flightover_item['tracker_count'].'],'; |
|
77 | + } |
|
78 | + } |
|
71 | 79 | $flightover_data = substr($flightover_data, 0, -1); |
72 | 80 | print $flightover_data; |
73 | 81 | print '];'; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ?> |
38 | 38 | </div> |
39 | 39 | <?php |
40 | - if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
40 | + if (!isset($year) || (isset($year) && $year == '') && !isset($month) || (isset($month) && $month == '')) { |
|
41 | 41 | ?> |
42 | 42 | <div class="sub-menu sub-menu-container"> |
43 | 43 | <ul class="nav"> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | </ul> |
96 | 96 | </li> |
97 | 97 | <?php |
98 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
98 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
99 | 99 | ?> |
100 | 100 | <li class="dropdown"> |
101 | 101 | <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | </ul> |
108 | 108 | </li> |
109 | 109 | <?php |
110 | - } |
|
110 | + } |
|
111 | 111 | ?> |
112 | 112 | <?php |
113 | 113 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | </ul> |
128 | 128 | </div> |
129 | 129 | <?php |
130 | - } else { |
|
130 | + } else { |
|
131 | 131 | ?> |
132 | 132 | <div class="sub-menu sub-menu-container"> |
133 | 133 | <ul class="nav"> |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | </li> |
190 | 190 | --> |
191 | 191 | <?php |
192 | - if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
192 | + if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
|
193 | 193 | ?> |
194 | 194 | <!-- |
195 | 195 | <li class="dropdown"> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | </li> |
204 | 204 | --> |
205 | 205 | <?php |
206 | - } |
|
206 | + } |
|
207 | 207 | ?> |
208 | 208 | <?php |
209 | 209 | } elseif ($type == 'marine' || $type == 'tracker') { |
@@ -224,5 +224,5 @@ discard block |
||
224 | 224 | </ul> |
225 | 225 | </div> |
226 | 226 | <?php |
227 | - } |
|
227 | + } |
|
228 | 228 | ?> |
229 | 229 | \ No newline at end of file |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | $Spotter = new Spotter(); |
29 | 29 | $alliances = $Spotter->getAllAllianceNames(); |
30 | 30 | if (!empty($alliances)) { |
31 | - foreach($alliances as $alliance) { |
|
32 | - if (isset($airline_icao) && str_replace('_',' ',str_replace('alliance_','',$airline_icao)) == $alliance['alliance']) { |
|
33 | - print '<option value="alliance_'.str_replace(' ','_',$alliance['alliance']).'" selected>'.$alliance['alliance'].'</option>'; |
|
31 | + foreach ($alliances as $alliance) { |
|
32 | + if (isset($airline_icao) && str_replace('_', ' ', str_replace('alliance_', '', $airline_icao)) == $alliance['alliance']) { |
|
33 | + print '<option value="alliance_'.str_replace(' ', '_', $alliance['alliance']).'" selected>'.$alliance['alliance'].'</option>'; |
|
34 | 34 | } else { |
35 | - print '<option value="alliance_'.str_replace(' ','_',$alliance['alliance']).'">'.$alliance['alliance'].'</option>'; |
|
35 | + print '<option value="alliance_'.str_replace(' ', '_', $alliance['alliance']).'">'.$alliance['alliance'].'</option>'; |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | print '<option disabled>──────────</option>'; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $Stats = new Stats(); |
41 | 41 | if (!isset($filter_name)) $filter_name = ''; |
42 | 42 | $airlines = $Stats->getAllAirlineNames($filter_name); |
43 | - foreach($airlines as $airline) { |
|
43 | + foreach ($airlines as $airline) { |
|
44 | 44 | if ($airline['airline_icao'] != '') { |
45 | 45 | if (isset($airline_icao) && $airline_icao != 'all' && $airline_icao == $airline['airline_icao']) { |
46 | 46 | print '<option value="'.$airline['airline_icao'].'" selected>'.$airline['airline_name'].'</option>'; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if (!isset($type) || $type == 'aircraft') { |
66 | 66 | ?> |
67 | 67 | <li class="dropdown"> |
68 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
68 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
69 | 69 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
70 | 70 | </a> |
71 | 71 | <ul class="dropdown-menu"> |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | </ul> |
77 | 77 | </li> |
78 | 78 | <li class="dropdown"> |
79 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
79 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
80 | 80 | <?php echo _("Airline"); ?> <span class="caret"></span> |
81 | 81 | </a> |
82 | 82 | <ul class="dropdown-menu" role="menu"> |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | </ul> |
93 | 93 | </li> |
94 | 94 | <li class="dropdown"> |
95 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
95 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
96 | 96 | <?php echo _("Airport"); ?> <span class="caret"></span> |
97 | 97 | </a> |
98 | 98 | <ul class="dropdown-menu" role="menu"> |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | </ul> |
104 | 104 | </li> |
105 | 105 | <li class="dropdown"> |
106 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
106 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
107 | 107 | <?php echo _("Route"); ?> <span class="caret"></span> |
108 | 108 | </a> |
109 | 109 | <ul class="dropdown-menu" role="menu"> |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | </ul> |
113 | 113 | </li> |
114 | 114 | <li class="dropdown"> |
115 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
115 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
116 | 116 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
117 | 117 | </a> |
118 | 118 | <ul class="dropdown-menu" role="menu"> |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if (isset($globalAccidents) && $globalAccidents && (!isset($airline_icao) || $airline_icao == '' || $airline_icao == 'all')) { |
125 | 125 | ?> |
126 | 126 | <li class="dropdown"> |
127 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
127 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
128 | 128 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
129 | 129 | </a> |
130 | 130 | <ul class="dropdown-menu" role="menu"> |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } elseif ($type == 'marine' || $type == 'tracker') { |
140 | 140 | ?> |
141 | 141 | <li class="dropdown"> |
142 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
142 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
143 | 143 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
144 | 144 | </a> |
145 | 145 | <ul class="dropdown-menu" role="menu"> |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | if (!isset($type) || $type == 'aircraft') { |
170 | 170 | ?> |
171 | 171 | <li class="dropdown"> |
172 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer"){ print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
172 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-aircraft" || strtolower($current_page) == "statistics-registration" || strtolower($current_page) == "statistics-manufacturer") { print 'active'; } ?>" data-toggle="dropdown" href="#" > |
|
173 | 173 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
174 | 174 | </a> |
175 | 175 | <ul class="dropdown-menu"> |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | </ul> |
181 | 181 | </li> |
182 | 182 | <li class="dropdown"> |
183 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
183 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airline" || strtolower($current_page) == "statistics-airline-country" || strtolower($current_page) == "statistics-callsign") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
184 | 184 | <?php echo _("Airline"); ?> <span class="caret"></span> |
185 | 185 | </a> |
186 | 186 | <ul class="dropdown-menu" role="menu"> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | </ul> |
197 | 197 | </li> |
198 | 198 | <li class="dropdown"> |
199 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
199 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-airport-departure" || strtolower($current_page) == "statistics-airport-departure-country" || strtolower($current_page) == "statistics-airport-arrival" || strtolower($current_page) == "statistics-airport-arrival-country") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
200 | 200 | <?php echo _("Airport"); ?> <span class="caret"></span> |
201 | 201 | </a> |
202 | 202 | <ul class="dropdown-menu" role="menu"> |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | </li> |
209 | 209 | <!-- |
210 | 210 | <li class="dropdown"> |
211 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
211 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-route-airport" || strtolower($current_page) == "statistics-route-waypoint") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
212 | 212 | <?php echo _("Route"); ?> <span class="caret"></span> |
213 | 213 | </a> |
214 | 214 | <ul class="dropdown-menu" role="menu"> |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | --> |
220 | 220 | <!-- |
221 | 221 | <li class="dropdown"> |
222 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
222 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
223 | 223 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
224 | 224 | </a> |
225 | 225 | <ul class="dropdown-menu" role="menu"> |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | ?> |
234 | 234 | <!-- |
235 | 235 | <li class="dropdown"> |
236 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
236 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-fatalities-year" || strtolower($current_page) == "statistics-fatalities-month") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
237 | 237 | <?php echo _("Fatalities"); ?> <span class="caret"></span> |
238 | 238 | </a> |
239 | 239 | <ul class="dropdown-menu" role="menu"> |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } elseif ($type == 'marine' || $type == 'tracker') { |
250 | 250 | ?> |
251 | 251 | <li class="dropdown"> |
252 | - <a class="dropdown-toggle <?php if(strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time"){ print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
252 | + <a class="dropdown-toggle <?php if (strtolower($current_page) == "statistics-date" || strtolower($current_page) == "statistics-time") { print 'active'; } ?>" data-toggle="dropdown" href="#"> |
|
253 | 253 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
254 | 254 | </a> |
255 | 255 | <ul class="dropdown-menu" role="menu"> |
@@ -6,7 +6,13 @@ discard block |
||
6 | 6 | if (!isset($type) || $type != 'satellite') { |
7 | 7 | ?> |
8 | 8 | <form id="changedate" method="post"> |
9 | - <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') echo $year.'-'; ?><?php if (isset($month) && $month != '') echo $month; ?>" /> |
|
9 | + <input type="month" name="date" onchange="statsdatechange(this);" value="<?php if (isset($year) && $year != '') { |
|
10 | + echo $year.'-'; |
|
11 | +} |
|
12 | +?><?php if (isset($month) && $month != '') { |
|
13 | + echo $month; |
|
14 | +} |
|
15 | +?>" /> |
|
10 | 16 | </form> |
11 | 17 | <?php |
12 | 18 | } |
@@ -38,7 +44,9 @@ discard block |
||
38 | 44 | print '<option disabled>──────────</option>'; |
39 | 45 | } |
40 | 46 | $Stats = new Stats(); |
41 | - if (!isset($filter_name)) $filter_name = ''; |
|
47 | + if (!isset($filter_name)) { |
|
48 | + $filter_name = ''; |
|
49 | + } |
|
42 | 50 | $airlines = $Stats->getAllAirlineNames($filter_name); |
43 | 51 | foreach($airlines as $airline) { |
44 | 52 | if ($airline['airline_icao'] != '') { |
@@ -69,10 +77,22 @@ discard block |
||
69 | 77 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
70 | 78 | </a> |
71 | 79 | <ul class="dropdown-menu"> |
72 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
73 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Registration"); ?></a></li> |
|
74 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
75 | - <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Country"); ?></a></li> |
|
80 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
81 | + echo '/'.$airline_icao; |
|
82 | +} |
|
83 | +?>"><?php echo _("Aircraft"); ?></a></li> |
|
84 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
85 | + echo '/'.$airline_icao; |
|
86 | +} |
|
87 | +?>"><?php echo _("Registration"); ?></a></li> |
|
88 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
89 | + echo '/'.$airline_icao; |
|
90 | +} |
|
91 | +?>"><?php echo _("Manufacturer"); ?></a></li> |
|
92 | + <li><a href="<?php print $globalURL; ?>/statistics/country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
93 | + echo '/'.$airline_icao; |
|
94 | +} |
|
95 | +?>"><?php echo _("Country"); ?></a></li> |
|
76 | 96 | </ul> |
77 | 97 | </li> |
78 | 98 | <li class="dropdown"> |
@@ -83,12 +103,21 @@ discard block |
||
83 | 103 | <?php |
84 | 104 | if (!isset($airline_icao) || $airline_icao == 'all') { |
85 | 105 | ?> |
86 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline"); ?></a></li> |
|
87 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
106 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
107 | + echo '/'.$airline_icao; |
|
108 | +} |
|
109 | +?>"><?php echo _("Airline"); ?></a></li> |
|
110 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
111 | + echo '/'.$airline_icao; |
|
112 | +} |
|
113 | +?>"><?php echo _("Airline by Country"); ?></a></li> |
|
88 | 114 | <?php |
89 | 115 | } |
90 | 116 | ?> |
91 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Callsign"); ?></a></li> |
|
117 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
118 | + echo '/'.$airline_icao; |
|
119 | +} |
|
120 | +?>"><?php echo _("Callsign"); ?></a></li> |
|
92 | 121 | </ul> |
93 | 122 | </li> |
94 | 123 | <li class="dropdown"> |
@@ -96,10 +125,22 @@ discard block |
||
96 | 125 | <?php echo _("Airport"); ?> <span class="caret"></span> |
97 | 126 | </a> |
98 | 127 | <ul class="dropdown-menu" role="menu"> |
99 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
100 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
101 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
102 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
128 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
129 | + echo '/'.$airline_icao; |
|
130 | +} |
|
131 | +?>"><?php echo _("Departure Airport"); ?></a></li> |
|
132 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
133 | + echo '/'.$airline_icao; |
|
134 | +} |
|
135 | +?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
136 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
137 | + echo '/'.$airline_icao; |
|
138 | +} |
|
139 | +?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
140 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
141 | + echo '/'.$airline_icao; |
|
142 | +} |
|
143 | +?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
103 | 144 | </ul> |
104 | 145 | </li> |
105 | 146 | <li class="dropdown"> |
@@ -107,8 +148,14 @@ discard block |
||
107 | 148 | <?php echo _("Route"); ?> <span class="caret"></span> |
108 | 149 | </a> |
109 | 150 | <ul class="dropdown-menu" role="menu"> |
110 | - <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Airport"); ?></a></li> |
|
111 | - <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
151 | + <li><a href="<?php print $globalURL; ?>/statistics/route-airport<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
152 | + echo '/'.$airline_icao; |
|
153 | +} |
|
154 | +?>"><?php echo _("Route by Airport"); ?></a></li> |
|
155 | + <li><a href="<?php print $globalURL; ?>/statistics/route-waypoint<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
156 | + echo '/'.$airline_icao; |
|
157 | +} |
|
158 | +?>"><?php echo _("Route by Waypoint"); ?></a></li> |
|
112 | 159 | </ul> |
113 | 160 | </li> |
114 | 161 | <li class="dropdown"> |
@@ -116,8 +163,14 @@ discard block |
||
116 | 163 | <?php echo _("Date & Time"); ?> <span class="caret"></span> |
117 | 164 | </a> |
118 | 165 | <ul class="dropdown-menu" role="menu"> |
119 | - <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Date"); ?></a></li> |
|
120 | - <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>"><?php echo _("Time"); ?></a></li> |
|
166 | + <li><a href="<?php print $globalURL; ?>/statistics/date<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
167 | + echo '/'.$airline_icao; |
|
168 | +} |
|
169 | +?>"><?php echo _("Date"); ?></a></li> |
|
170 | + <li><a href="<?php print $globalURL; ?>/statistics/time<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
171 | + echo '/'.$airline_icao; |
|
172 | +} |
|
173 | +?>"><?php echo _("Time"); ?></a></li> |
|
121 | 174 | </ul> |
122 | 175 | </li> |
123 | 176 | <?php |
@@ -173,9 +226,18 @@ discard block |
||
173 | 226 | <?php echo _("Aircraft"); ?> <span class="caret"></span> |
174 | 227 | </a> |
175 | 228 | <ul class="dropdown-menu"> |
176 | - <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
177 | - <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
178 | - <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
229 | + <li><a href="<?php print $globalURL; ?>/statistics/aircraft<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
230 | + echo '/'.$airline_icao; |
|
231 | +} |
|
232 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Aircraft"); ?></a></li> |
|
233 | + <li><a href="<?php print $globalURL; ?>/statistics/registration<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
234 | + echo '/'.$airline_icao; |
|
235 | +} |
|
236 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Registration"); ?></a></li> |
|
237 | + <li><a href="<?php print $globalURL; ?>/statistics/manufacturer<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
238 | + echo '/'.$airline_icao; |
|
239 | +} |
|
240 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Manufacturer"); ?></a></li> |
|
179 | 241 | <!-- <li><a href="<?php print $globalURL; ?>/statistics/country"><?php echo _("Country"); ?></a></li> --> |
180 | 242 | </ul> |
181 | 243 | </li> |
@@ -187,12 +249,21 @@ discard block |
||
187 | 249 | <?php |
188 | 250 | if (!isset($airline_icao) || $airline_icao == 'all') { |
189 | 251 | ?> |
190 | - <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
191 | - <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
252 | + <li><a href="<?php print $globalURL; ?>/statistics/airline<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
253 | + echo '/'.$airline_icao; |
|
254 | +} |
|
255 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline"); ?></a></li> |
|
256 | + <li><a href="<?php print $globalURL; ?>/statistics/airline-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
257 | + echo '/'.$airline_icao; |
|
258 | +} |
|
259 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Airline by Country"); ?></a></li> |
|
192 | 260 | <?php |
193 | 261 | } |
194 | 262 | ?> |
195 | - <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
263 | + <li><a href="<?php print $globalURL; ?>/statistics/callsign<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
264 | + echo '/'.$airline_icao; |
|
265 | +} |
|
266 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Callsign"); ?></a></li> |
|
196 | 267 | </ul> |
197 | 268 | </li> |
198 | 269 | <li class="dropdown"> |
@@ -200,10 +271,22 @@ discard block |
||
200 | 271 | <?php echo _("Airport"); ?> <span class="caret"></span> |
201 | 272 | </a> |
202 | 273 | <ul class="dropdown-menu" role="menu"> |
203 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
204 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
205 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
206 | - <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') echo '/'.$airline_icao; ?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
274 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
275 | + echo '/'.$airline_icao; |
|
276 | +} |
|
277 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport"); ?></a></li> |
|
278 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-departure-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
279 | + echo '/'.$airline_icao; |
|
280 | +} |
|
281 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Departure Airport by Country"); ?></a></li> |
|
282 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
283 | + echo '/'.$airline_icao; |
|
284 | +} |
|
285 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport"); ?></a></li> |
|
286 | + <li><a href="<?php print $globalURL; ?>/statistics/airport-arrival-country<?php if (isset($airline_icao) && $airline_icao != '' && $airline_icao != 'all') { |
|
287 | + echo '/'.$airline_icao; |
|
288 | +} |
|
289 | +?>/<?php echo $year.'/'.$month.'/'; ?>"><?php echo _("Arrival Airport by Country"); ?></a></li> |
|
207 | 290 | </ul> |
208 | 291 | </li> |
209 | 292 | <!-- |
@@ -40,15 +40,15 @@ |
||
40 | 40 | //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>'; |
41 | 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 | - print '<div><span>'._("Range").'</span>'; |
|
44 | - print $spotter_item['atc_range']; |
|
45 | - print '</div>'; |
|
43 | + print '<div><span>'._("Range").'</span>'; |
|
44 | + print $spotter_item['atc_range']; |
|
45 | + print '</div>'; |
|
46 | 46 | } |
47 | 47 | print '</div>'; |
48 | 48 | if ($spotter_item['info'] != '') { |
49 | - print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | - print $spotter_item['info']; |
|
51 | - print '</div>'; |
|
49 | + print '<div class="notamtext"><span>'._("Info").'</span>'; |
|
50 | + print $spotter_item['info']; |
|
51 | + print '</div>'; |
|
52 | 52 | } |
53 | 53 | print '</div>'; |
54 | 54 | } |
@@ -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']; |
@@ -8,7 +8,9 @@ |
||
8 | 8 | $atcid = filter_input(INPUT_GET,'atcid',FILTER_SANITIZE_NUMBER_INT); |
9 | 9 | $atcident = filter_input(INPUT_GET,'atcident',FILTER_SANITIZE_STRING); |
10 | 10 | $atc_data = $ATC->getById($atcid); |
11 | - if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident); |
|
11 | + if (!isset($atc_data[0])) { |
|
12 | + $atc_data = $ATC->getByIdent($atcident); |
|
13 | + } |
|
12 | 14 | ?> |
13 | 15 | <div class="alldetails"> |
14 | 16 | <button type="button" class="close">×</button> |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | print '<th class="arrival"><span class="nomobile">'._("Going to").'</span><span class="mobile">'._("To").'</span></th>'; |
278 | 278 | } |
279 | 279 | } |
280 | - if ($type == 'aircraft') { |
|
280 | + if ($type == 'aircraft') { |
|
281 | 281 | if ((isset($globalUsePilot) && $globalUsePilot) || (!isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalVAM) && $globalVAM) || (isset($globalphpVMS) && $globalphpVMS)))) { |
282 | 282 | print '<th class="pilot"><span class="nomobile">'._("Pilot name").'</span><span class="mobile">'._("Pilot").'</span></a></th>'; |
283 | 283 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 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 | - $spotter_item['squawk'] = '-'; |
|
582 | + $spotter_item['squawk'] = '-'; |
|
583 | 583 | } |
584 | 584 | if ($spotter_item['image_thumbnail'] != "") |
585 | 585 | { |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | print '</td>'."\n"; |
619 | 619 | } else { |
620 | 620 | print '<td class="aircraft_thumbnail">'."\n"; |
621 | - // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
621 | + // print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
|
622 | 622 | //} |
623 | 623 | if (!isset($spotter_item['airline_name']) && !isset($spotter_item['aircraft_name'])) { |
624 | 624 | print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$globalURL.'/images/placeholder_thumb.png" 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:").' '._("Not available").' ('.$spotter_item['aircraft_type'].')<br />'._("Airline:").' '._("Not available").'<br />'._("Squawk:").' '.$spotter_item['squawk'].'" data-html="true" width="100px" /></a>'."\n"; |
@@ -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 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | print '<th class="more"></th>'; |
141 | 141 | print '</thead>'; |
142 | -} else if (strtolower($current_page) == "upcoming"){ |
|
142 | +} else if (strtolower($current_page) == "upcoming") { |
|
143 | 143 | print '<thead>'; |
144 | 144 | if (!isset($globalNoAirlines) || $globalNoAirlines === FALSE) { |
145 | 145 | if ($_GET['sort'] == "airline_name_asc") |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } |
194 | 194 | */ |
195 | 195 | print '</thead>'; |
196 | -} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive"){ |
|
196 | +} else if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
|
197 | 197 | print '<thead>'; |
198 | 198 | print '<th class="aircraft_thumbnail"></th>'; |
199 | 199 | print '<th class="logo">'._("Airline").'</th>'; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | print '</thead>'; |
231 | 231 | } else { |
232 | 232 | |
233 | - if ($hide_th_links === true){ |
|
233 | + if ($hide_th_links === true) { |
|
234 | 234 | print '<thead>'; |
235 | 235 | print '<th class="aircraft_thumbnail"></th>'; |
236 | 236 | if ($type == 'aircraft') { |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | } |
488 | 488 | |
489 | 489 | print '<tbody>'."\n"; |
490 | -foreach($spotter_array as $spotter_item) |
|
490 | +foreach ($spotter_array as $spotter_item) |
|
491 | 491 | { |
492 | 492 | if (isset($globalTimezone)) |
493 | 493 | { |
@@ -522,13 +522,13 @@ discard block |
||
522 | 522 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
523 | 523 | } |
524 | 524 | if (isset($spotter_item['airline_name'])) { |
525 | - 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>'; |
|
525 | + 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>'; |
|
526 | 526 | } else { |
527 | - 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>'; |
|
527 | + 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>'; |
|
528 | 528 | } |
529 | 529 | } else { |
530 | 530 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
531 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
531 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
532 | 532 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
533 | 533 | if (isset($spotter_item['airline_name'])) { |
534 | 534 | 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>'; |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | { |
548 | 548 | print '<td class="aircraft_thumbnail">'."\n"; |
549 | 549 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
550 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
550 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
551 | 551 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
552 | 552 | if (isset($spotter_item['airline_name'])) { |
553 | 553 | 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>'; |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | { |
566 | 566 | print '<td class="aircraft_thumbnail">'."\n"; |
567 | 567 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
568 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
568 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
569 | 569 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
570 | 570 | 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>'; |
571 | 571 | print '</td>'."\n"; |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | print '</td>'."\n"; |
610 | 610 | } |
611 | 611 | } |
612 | - } 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"){ |
|
612 | + } 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") { |
|
613 | 613 | if ($type == 'aircraft') { |
614 | 614 | if (!isset($spotter_item['squawk']) || $spotter_item['squawk'] == 0) { |
615 | 615 | $spotter_item['squawk'] = '-'; |
@@ -626,17 +626,17 @@ discard block |
||
626 | 626 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
627 | 627 | } |
628 | 628 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
629 | - 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>'; |
|
629 | + 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>'; |
|
630 | 630 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
631 | - 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>'; |
|
631 | + 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>'; |
|
632 | 632 | } elseif (!isset($spotter_item['aircraft_name']) && !isset($spotter_item['airline_name'])) { |
633 | - 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>'; |
|
633 | + 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>'; |
|
634 | 634 | } else { |
635 | - 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>'; |
|
635 | + 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>'; |
|
636 | 636 | } |
637 | 637 | } else { |
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 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
642 | 642 | 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>'; |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | { |
670 | 670 | print '<td class="aircraft_thumbnail">'."\n"; |
671 | 671 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
672 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
672 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
673 | 673 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
674 | 674 | 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>'; |
675 | 675 | print '</td>'."\n"; |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | { |
684 | 684 | print '<td class="aircraft_thumbnail">'."\n"; |
685 | 685 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
686 | - $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
|
686 | + $image_thumbnail = preg_replace("/^http:/i", "https:", $spotter_item['image_thumbnail']); |
|
687 | 687 | } else $image_thumbnail = $spotter_item['image_thumbnail']; |
688 | 688 | 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>'; |
689 | 689 | print '</td>'."\n"; |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | print '</td>'."\n"; |
793 | 793 | } |
794 | 794 | // Aircraft type |
795 | - if(strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive"){ |
|
795 | + if (strtolower($current_page) != "upcoming" && strtolower($current_page) != "acars-latest" && strtolower($current_page) != "acars-archive") { |
|
796 | 796 | print '<td class="type">'."\n"; |
797 | 797 | if ($type == 'aircraft') { |
798 | 798 | if (!isset($spotter_item['aircraft_type']) && isset($spotter_item['aircraft_name'])) { |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | //print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'._("Not available").'</a></span>'."\n"; |
802 | 802 | print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
803 | 803 | } else { |
804 | - $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
|
804 | + $aircraft_names = explode('/', $spotter_item['aircraft_name']); |
|
805 | 805 | if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
806 | 806 | else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
807 | 807 | } |
@@ -845,22 +845,22 @@ discard block |
||
845 | 845 | } |
846 | 846 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
847 | 847 | if ($spotter_item['departure_airport_time'] > 2460) { |
848 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
849 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
848 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
849 | + } else $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
850 | 850 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
851 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
851 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
852 | 852 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
853 | 853 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
854 | 854 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
855 | 855 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
856 | - $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
|
856 | + $real_departure_airport_time = date('H:m', $spotter_item['real_departure_airport_time']); |
|
857 | 857 | } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
858 | 858 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
859 | 859 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
860 | 860 | if ($spotter_item['departure_airport_time'] > 2460) { |
861 | - $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
|
861 | + $departure_airport_time = date('H:m', $spotter_item['departure_airport_time']); |
|
862 | 862 | } else { |
863 | - $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
863 | + $departure_airport_time = substr($spotter_item['departure_airport_time'], 0, -2).':'.substr($spotter_item['departure_airport_time'], -2); |
|
864 | 864 | } |
865 | 865 | print '<br /><span class="airport_time">'.$departure_airport_time.'</span>'."\n"; |
866 | 866 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | $latitude = $spotter_item['latitude']; |
876 | 876 | $longitude = $spotter_item['longitude']; |
877 | 877 | } |
878 | - $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
|
878 | + $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'], $latitude, $longitude); |
|
879 | 879 | } else $distance = ''; |
880 | 880 | if ($distance != '') { |
881 | 881 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -918,20 +918,20 @@ discard block |
||
918 | 918 | } |
919 | 919 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
920 | 920 | if ($spotter_item['arrival_airport_time'] > 2460) { |
921 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
921 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
922 | 922 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
923 | 923 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
924 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
924 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
925 | 925 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
926 | 926 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
927 | 927 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
928 | 928 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
929 | - $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
|
929 | + $real_arrival_airport_time = date('H:m', $spotter_item['real_arrival_airport_time']); |
|
930 | 930 | } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
931 | 931 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
932 | 932 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
933 | 933 | if ($spotter_item['arrival_airport_time'] > 2460) { |
934 | - $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
|
934 | + $arrival_airport_time = date('H:m', $spotter_item['arrival_airport_time']); |
|
935 | 935 | } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
936 | 936 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
937 | 937 | } |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | $latitude = $spotter_item['latitude']; |
945 | 945 | $longitude = $spotter_item['longitude']; |
946 | 946 | } |
947 | - $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
|
947 | + $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'], $latitude, $longitude); |
|
948 | 948 | } else $distance = ''; |
949 | 949 | if ($distance != '') { |
950 | 950 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
@@ -987,19 +987,19 @@ discard block |
||
987 | 987 | print '<span class="mobile">-</span>'."\n"; |
988 | 988 | } else { |
989 | 989 | if ((!isset($_COOKIE['unitdistance']) && ((isset($globalUnitDistance) && $globalUnitDistance == 'km') || !isset($globalUnitDistance))) || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'km')) { |
990 | - print '<span class="nomobile">'.round($spotter_item['distance'],2).' km</span>'."\n"; |
|
991 | - print '<span class="mobile">'.round($spotter_item['distance'],2).' km</span><br />'."\n"; |
|
990 | + print '<span class="nomobile">'.round($spotter_item['distance'], 2).' km</span>'."\n"; |
|
991 | + print '<span class="mobile">'.round($spotter_item['distance'], 2).' km</span><br />'."\n"; |
|
992 | 992 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'mi') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'mi')) { |
993 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.621371,2).' mi</span>'."\n"; |
|
994 | - print '<span class="mobile">'.round($spotter_item['distance']*0.621371,2).' mi</span><br />'."\n"; |
|
993 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span>'."\n"; |
|
994 | + print '<span class="mobile">'.round($spotter_item['distance']*0.621371, 2).' mi</span><br />'."\n"; |
|
995 | 995 | } elseif ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
996 | - print '<span class="nomobile">'.round($spotter_item['distance']*0.539957,2).' nm</span>'."\n"; |
|
997 | - print '<span class="mobile">'.round($spotter_item['distance']*0.539957,2).' nm</span><br />'."\n"; |
|
996 | + print '<span class="nomobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span>'."\n"; |
|
997 | + print '<span class="mobile">'.round($spotter_item['distance']*0.539957, 2).' nm</span><br />'."\n"; |
|
998 | 998 | } |
999 | 999 | } |
1000 | 1000 | print '</td>'."\n"; |
1001 | 1001 | } |
1002 | - if(strtolower($current_page) != "upcoming"){ |
|
1002 | + if (strtolower($current_page) != "upcoming") { |
|
1003 | 1003 | if ($type == 'aircraft') { |
1004 | 1004 | //if ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) { |
1005 | 1005 | if ((isset($globalUsePilot) && $globalUsePilot) || !isset($globalUsePilot) && ((isset($globalVA) && $globalVA) || (isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS) || (isset($globalVAM) && $globalVAM))) { |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | |
1043 | 1043 | if ($showRouteStop) { |
1044 | 1044 | // Route stop |
1045 | - if(strtolower($current_page) != "upcoming"){ |
|
1045 | + if (strtolower($current_page) != "upcoming") { |
|
1046 | 1046 | print '<td class="route_stop">'."\n"; |
1047 | 1047 | if (!isset($spotter_item['route_stop']) || $spotter_item['route_stop'] == '' || $spotter_item['route_stop'] == 'NULL') { |
1048 | 1048 | print '<span class="nomobile">-</span>'."\n"; |
@@ -1061,11 +1061,11 @@ discard block |
||
1061 | 1061 | } |
1062 | 1062 | if ($showDuration) { |
1063 | 1063 | // Duration |
1064 | - if(strtolower($current_page) != "upcoming"){ |
|
1064 | + if (strtolower($current_page) != "upcoming") { |
|
1065 | 1065 | print '<td class="duration">'."\n"; |
1066 | 1066 | if (isset($spotter_item['duration'])) { |
1067 | - print '<span class="nomobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
1068 | - print '<span class="mobile">'.gmdate('H:i:s',$spotter_item['duration']).'</span>'."\n"; |
|
1067 | + print '<span class="nomobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
1068 | + print '<span class="mobile">'.gmdate('H:i:s', $spotter_item['duration']).'</span>'."\n"; |
|
1069 | 1069 | } else { |
1070 | 1070 | print '<span class="nomobile">-</span>'."\n"; |
1071 | 1071 | print '<span class="mobile">-</span>'."\n"; |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive") { |
1079 | 1079 | if (isset($spotter_item['decode']) && $spotter_item['decode'] != '') { |
1080 | 1080 | print '<td class="message"><p>'."\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 '</p><p class="decode">'; |
1083 | 1083 | $decode_array = json_decode($spotter_item['decode']); |
1084 | 1084 | foreach ($decode_array as $key => $value) { |
@@ -1088,7 +1088,7 @@ discard block |
||
1088 | 1088 | print '</td>'."\n"; |
1089 | 1089 | } else { |
1090 | 1090 | print '<td class="message">'."\n"; |
1091 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1091 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1092 | 1092 | print '</td>'."\n"; |
1093 | 1093 | } |
1094 | 1094 | } |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | } |
1114 | 1114 | print '</td>'."\n"; |
1115 | 1115 | print '<td class="message">'."\n"; |
1116 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1116 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1117 | 1117 | print '</td>'."\n"; |
1118 | 1118 | } |
1119 | 1119 | if (strtolower($current_page) == "incident-latest" || strtolower($current_page) == "incident-detailed") { |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | print '</td>'."\n"; |
1140 | 1140 | */ |
1141 | 1141 | print '<td class="message">'."\n"; |
1142 | - print str_replace(array("\r\n", "\n", "\r"),'<br />',$spotter_item['message']); |
|
1142 | + print str_replace(array("\r\n", "\n", "\r"), '<br />', $spotter_item['message']); |
|
1143 | 1143 | print '</td>'."\n"; |
1144 | 1144 | } |
1145 | 1145 |
@@ -7,7 +7,9 @@ discard block |
||
7 | 7 | $showRouteStop = $Common->multiKeyExists($spotter_array,'route_stop'); |
8 | 8 | $showDuration = $Common->multiKeyExists($spotter_array,'duration'); |
9 | 9 | |
10 | -if (!isset($type)) $type = 'aircraft'; |
|
10 | +if (!isset($type)) { |
|
11 | + $type = 'aircraft'; |
|
12 | +} |
|
11 | 13 | |
12 | 14 | if (!isset($_GET['sort'])) |
13 | 15 | { |
@@ -492,7 +494,9 @@ discard block |
||
492 | 494 | if (isset($globalTimezone)) |
493 | 495 | { |
494 | 496 | date_default_timezone_set($globalTimezone); |
495 | - } else date_default_timezone_set('UTC'); |
|
497 | + } else { |
|
498 | + date_default_timezone_set('UTC'); |
|
499 | + } |
|
496 | 500 | if ($showSpecial === true) |
497 | 501 | { |
498 | 502 | print '<tr class="special">'."\n"; |
@@ -507,7 +511,9 @@ discard block |
||
507 | 511 | print '<tr class="active">'; |
508 | 512 | } elseif (isset($spotter_item['spotted_registration'])) { |
509 | 513 | print '<tr class="info">'; |
510 | - } else print '<tr>'; |
|
514 | + } else { |
|
515 | + print '<tr>'; |
|
516 | + } |
|
511 | 517 | } |
512 | 518 | if (strtolower($current_page) == "acars-latest" || strtolower($current_page) == "acars-archive" || strtolower($current_page) == "currently" || strtolower($current_page) == "accident-latest" || strtolower($current_page) == "incident-latest" || strtolower($current_page) == "accident-detailed" || strtolower($current_page) == "incident-detailed") { |
513 | 519 | if ($type == 'aircraft') { |
@@ -515,8 +521,9 @@ discard block |
||
515 | 521 | { |
516 | 522 | print '<td class="aircraft_thumbnail">'."\n"; |
517 | 523 | if ($spotter_item['image_source'] == 'planespotters') { |
518 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
519 | - else { |
|
524 | + if ($spotter_item['image_source_website'] != '') { |
|
525 | + $image_src = $spotter_item['image_source_website']; |
|
526 | + } else { |
|
520 | 527 | $planespotter_url_array = explode("_", $spotter_item['image']); |
521 | 528 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
522 | 529 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -529,7 +536,9 @@ discard block |
||
529 | 536 | } else { |
530 | 537 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
531 | 538 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
532 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
539 | + } else { |
|
540 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
541 | + } |
|
533 | 542 | if (isset($spotter_item['airline_name'])) { |
534 | 543 | 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>'; |
535 | 544 | } else { |
@@ -548,7 +557,9 @@ discard block |
||
548 | 557 | print '<td class="aircraft_thumbnail">'."\n"; |
549 | 558 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
550 | 559 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
551 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
560 | + } else { |
|
561 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
562 | + } |
|
552 | 563 | if (isset($spotter_item['airline_name'])) { |
553 | 564 | 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>'; |
554 | 565 | } else { |
@@ -566,7 +577,9 @@ discard block |
||
566 | 577 | print '<td class="aircraft_thumbnail">'."\n"; |
567 | 578 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
568 | 579 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
569 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
580 | + } else { |
|
581 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
582 | + } |
|
570 | 583 | 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>'; |
571 | 584 | print '</td>'."\n"; |
572 | 585 | } else { |
@@ -619,8 +632,9 @@ discard block |
||
619 | 632 | print '<td class="aircraft_thumbnail">'."\n"; |
620 | 633 | //print '<a href="'.$globalURL.'/flightid/'.$spotter_item['spotter_id'].'"><img src="'.$spotter_item['image_thumbnail'].'" alt="Click to see more information about this flight" title="Click to see more information about this flight" width="100px" /></a>'; |
621 | 634 | if ($spotter_item['image_source'] == 'planespotters') { |
622 | - if ($spotter_item['image_source_website'] != '') $image_src = $spotter_item['image_source_website']; |
|
623 | - else { |
|
635 | + if ($spotter_item['image_source_website'] != '') { |
|
636 | + $image_src = $spotter_item['image_source_website']; |
|
637 | + } else { |
|
624 | 638 | $planespotter_url_array = explode("_", $spotter_array[0]['image']); |
625 | 639 | $planespotter_id = str_replace(".jpg", "", $planespotter_url_array[1]); |
626 | 640 | $image_src = 'https://www.planespotters.net/Aviation_Photos/photo.show?id='.$planespotter_id; |
@@ -637,7 +651,9 @@ discard block |
||
637 | 651 | } else { |
638 | 652 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
639 | 653 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
640 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
654 | + } else { |
|
655 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
656 | + } |
|
641 | 657 | if (!isset($spotter_item['airline_name']) && isset($spotter_item['aircraft_name'])) { |
642 | 658 | 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>'; |
643 | 659 | } elseif (!isset($spotter_item['aircraft_name']) && isset($spotter_item['airline_name'])) { |
@@ -670,7 +686,9 @@ discard block |
||
670 | 686 | print '<td class="aircraft_thumbnail">'."\n"; |
671 | 687 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
672 | 688 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
673 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
689 | + } else { |
|
690 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
691 | + } |
|
674 | 692 | 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>'; |
675 | 693 | print '</td>'."\n"; |
676 | 694 | } else { |
@@ -684,7 +702,9 @@ discard block |
||
684 | 702 | print '<td class="aircraft_thumbnail">'."\n"; |
685 | 703 | if ($spotter_item['image_source'] == 'wikimedia' || $spotter_item['image_source'] == 'devianart' || $spotter_item['image_source'] == 'flickr') { |
686 | 704 | $image_thumbnail = preg_replace("/^http:/i","https:",$spotter_item['image_thumbnail']); |
687 | - } else $image_thumbnail = $spotter_item['image_thumbnail']; |
|
705 | + } else { |
|
706 | + $image_thumbnail = $spotter_item['image_thumbnail']; |
|
707 | + } |
|
688 | 708 | 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>'; |
689 | 709 | print '</td>'."\n"; |
690 | 710 | } else { |
@@ -802,8 +822,11 @@ discard block |
||
802 | 822 | print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
803 | 823 | } else { |
804 | 824 | $aircraft_names = explode('/',$spotter_item['aircraft_name']); |
805 | - if (count($aircraft_names) == 1) print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
|
806 | - else print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
|
825 | + if (count($aircraft_names) == 1) { |
|
826 | + print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_manufacturer'].' '.$spotter_item['aircraft_name'].'</a></span>'."\n"; |
|
827 | + } else { |
|
828 | + print '<span class="nomobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'" title="'.$spotter_item['aircraft_name'].'">'.$spotter_item['aircraft_manufacturer'].' '.$aircraft_names[0].'</a></span>'."\n"; |
|
829 | + } |
|
807 | 830 | } |
808 | 831 | print '<span class="mobile"><a href="'.$globalURL.'/aircraft/'.$spotter_item['aircraft_type'].'">'.$spotter_item['aircraft_type'].'</a></span>'."\n"; |
809 | 832 | } elseif ($type == 'marine') { |
@@ -846,15 +869,21 @@ discard block |
||
846 | 869 | if (isset($spotter_item['departure_airport_time']) && isset($spotter_item['real_departure_airport_time'])) { |
847 | 870 | if ($spotter_item['departure_airport_time'] > 2460) { |
848 | 871 | $departure_airport_time = date('H:m',$spotter_item['departure_airport_time']); |
849 | - } else $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
872 | + } else { |
|
873 | + $departure_airport_time = substr($spotter_item['departure_airport_time'],0,-2).':'.substr($spotter_item['departure_airport_time'],-2); |
|
874 | + } |
|
850 | 875 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
851 | 876 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
852 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
877 | + } else { |
|
878 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
879 | + } |
|
853 | 880 | print '<br /><span class="airport_time">'.$departure_airport_time.' ('.$real_departure_airport_time.')</span>'."\n"; |
854 | 881 | } elseif (isset($spotter_item['real_departure_airport_time']) && $spotter_item['real_departure_airport_time'] != 'NULL') { |
855 | 882 | if ($spotter_item['real_departure_airport_time'] > 2460) { |
856 | 883 | $real_departure_airport_time = date('H:m',$spotter_item['real_departure_airport_time']); |
857 | - } else $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
884 | + } else { |
|
885 | + $real_departure_airport_time = $spotter_item['real_departure_airport_time']; |
|
886 | + } |
|
858 | 887 | print '<br /><span class="airport_time">'.$real_departure_airport_time.'</span>'."\n"; |
859 | 888 | } elseif (isset($spotter_item['departure_airport_time']) && $spotter_item['departure_airport_time'] != 'NULL') { |
860 | 889 | if ($spotter_item['departure_airport_time'] > 2460) { |
@@ -876,7 +905,9 @@ discard block |
||
876 | 905 | $longitude = $spotter_item['longitude']; |
877 | 906 | } |
878 | 907 | $distance = $Spotter->getAirportDistance($spotter_item['departure_airport'],$latitude,$longitude); |
879 | - } else $distance = ''; |
|
908 | + } else { |
|
909 | + $distance = ''; |
|
910 | + } |
|
880 | 911 | if ($distance != '') { |
881 | 912 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
882 | 913 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |
@@ -903,7 +934,9 @@ discard block |
||
903 | 934 | } else { |
904 | 935 | if (isset($spotter_item['real_arrival_airport']) && $spotter_item['real_arrival_airport'] != $spotter_item['arrival_airport']) { |
905 | 936 | print '<span class="nomobile">Scheduled : <a href="'.$globalURL.'/airport/'.$spotter_item['arrival_airport'].'">'.$spotter_item['arrival_airport_city'].', '.$spotter_item['arrival_airport_country'].' ('.$spotter_item['arrival_airport'].')</a></span>'."\n"; |
906 | - if (!isset($Spotter)) $Spotter = new Spotter(); |
|
937 | + if (!isset($Spotter)) { |
|
938 | + $Spotter = new Spotter(); |
|
939 | + } |
|
907 | 940 | $arrival_airport_info = $Spotter->getAllAirportInfo($spotter_item['real_arrival_airport']); |
908 | 941 | print '<br /><span class="nomobile">'._("Real:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$arrival_airport_info[0]['city'].','.$arrival_airport_info[0]['country'].' ('.$spotter_item['real_arrival_airport'].')</a></span>'."\n"; |
909 | 942 | print '<span class="mobile">'._("Scheduled:").' <a href="'.$globalURL.'/airport/'.$spotter_item['real_arrival_airport'].'">'.$spotter_item['real_arrival_airport'].'</a></span>'."\n"; |
@@ -919,20 +952,28 @@ discard block |
||
919 | 952 | if (isset($spotter_item['arrival_airport_time']) && isset($spotter_item['real_arrival_airport_time'])) { |
920 | 953 | if ($spotter_item['arrival_airport_time'] > 2460) { |
921 | 954 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
922 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
955 | + } else { |
|
956 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
957 | + } |
|
923 | 958 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
924 | 959 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
925 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
960 | + } else { |
|
961 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
962 | + } |
|
926 | 963 | print '<br /><span class="airport_time">'.$spotter_item['arrival_airport_time'].' ('.$spotter_item['real_arrival_airport_time'].')</span>'."\n"; |
927 | 964 | } elseif (isset($spotter_item['real_arrival_airport_time'])) { |
928 | 965 | if ($spotter_item['real_arrival_airport_time'] > 2460) { |
929 | 966 | $real_arrival_airport_time = date('H:m',$spotter_item['real_arrival_airport_time']); |
930 | - } else $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
967 | + } else { |
|
968 | + $real_arrival_airport_time = $spotter_item['real_arrival_airport_time']; |
|
969 | + } |
|
931 | 970 | print '<br /><span class="airport_time">'.$real_arrival_airport_time.'</span>'."\n"; |
932 | 971 | } elseif (isset($spotter_item['arrival_airport_time']) && $spotter_item['arrival_airport_time'] != 'NULL') { |
933 | 972 | if ($spotter_item['arrival_airport_time'] > 2460) { |
934 | 973 | $arrival_airport_time = date('H:m',$spotter_item['arrival_airport_time']); |
935 | - } else $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
974 | + } else { |
|
975 | + $arrival_airport_time = $spotter_item['arrival_airport_time']; |
|
976 | + } |
|
936 | 977 | print '<br /><span class="airport_time">'.$arrival_airport_time.'</span>'."\n"; |
937 | 978 | } |
938 | 979 | if (!isset($spotter_item['real_arrival_airport']) && $spotter_item['arrival_airport'] != 'NA') { |
@@ -945,7 +986,9 @@ discard block |
||
945 | 986 | $longitude = $spotter_item['longitude']; |
946 | 987 | } |
947 | 988 | $distance = $Spotter->getAirportDistance($spotter_item['arrival_airport'],$latitude,$longitude); |
948 | - } else $distance = ''; |
|
989 | + } else { |
|
990 | + $distance = ''; |
|
991 | + } |
|
949 | 992 | if ($distance != '') { |
950 | 993 | if ((!isset($_COOKIE['unitdistance']) && isset($globalUnitDistance) && $globalUnitDistance == 'nm') || (isset($_COOKIE['unitdistance']) && $_COOKIE['unitdistance'] == 'nm')) { |
951 | 994 | echo '<br/><i>'.round($distance*0.539957).' nm</i>'; |