2 require_once('require/class.Connection.php');
3 require_once('require/class.Language.php');
4 if (isset($_GET['marine'])) {
6 require_once('require/class.Marine.php');
7 $Marine = new Marine();
8 } elseif (isset($_GET['tracker'])) {
10 require_once('require/class.Tracker.php');
11 $Tracker = new Tracker();
13 require_once('require/class.Spotter.php');
14 require_once('require/class.SpotterArchive.php');
15 $Spotter = new Spotter();
16 $orderby = $Spotter->getOrderBy();
21 //$page_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
22 $page_url = $_SERVER['REQUEST_URI'];
25 require_once('header.php');
27 if (isset($_GET['start_date'])) {
28 //for the date manipulation into the query
29 if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
30 if (strtotime($_GET['start_date']) !== false && strtotime($_GET['end_date']) !== false) {
31 //$start_date = $_GET['start_date']." 00:00:00";
32 $start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
33 //$end_date = $_GET['end_date']." 00:00:00";
34 $end_date = date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
35 $sql_date = $start_date.",".$end_date;
37 } else if($_GET['start_date'] != ""){
38 if (strtotime($_GET['start_date']) !== false) {
39 //$start_date = $_GET['start_date']." 00:00:00";
40 $start_date = date("Y-m-d",strtotime($_GET['start_date']))." 00:00:00";
41 $sql_date = $start_date;
43 } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
44 if (strtotime($_GET['end_date']) !== false) {
45 //$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
46 $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".date("Y-m-d",strtotime($_GET['end_date']))." 00:00:00";
47 $sql_date = $end_date;
49 } else $sql_date = '';
52 if (isset($_GET['highest_altitude'])) {
53 //for altitude manipulation
54 if($_GET['highest_altitude'] != "" && $_GET['lowest_altitude'] != ""){
55 $end_altitude = filter_input(INPUT_GET
,'highest_altitude',FILTER_SANITIZE_NUMBER_INT
);
56 $start_altitude = filter_input(INPUT_GET
,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT
);
57 $sql_altitude = $start_altitude.",".$end_altitude;
58 } else if($_GET['highest_altitude'] != ""){
59 $end_altitude = filter_input(INPUT_GET
,'highest_altitude',FILTER_SANITIZE_NUMBER_INT
);
60 $sql_altitude = $end_altitude;
61 } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){
62 $start_altitude = filter_input(INPUT_GET
,'lowest_altitude',FILTER_SANITIZE_NUMBER_INT
).",60000";
63 $sql_altitude = $start_altitude;
64 } else $sql_altitude = '';
65 } else $sql_altitude = '';
67 //calculuation for the pagination
68 if(!isset($_GET['limit']))
70 if (!isset($_GET['number_results']))
74 $absolute_difference = 25;
76 if ($_GET['number_results'] > 1000){
77 $_GET['number_results'] = 1000;
80 $limit_end = filter_input(INPUT_GET
,'number_results',FILTER_SANITIZE_NUMBER_INT
);
81 $absolute_difference = filter_input(INPUT_GET
,'number_results',FILTER_SANITIZE_NUMBER_INT
);
84 $limit_explode = explode(",", $_GET['limit']);
85 $limit_start = filter_var($limit_explode[0],FILTER_SANITIZE_NUMBER_INT
);
86 $limit_end = filter_var($limit_explode[1],FILTER_SANITIZE_NUMBER_INT
);
88 $absolute_difference = abs($limit_start - $limit_end);
89 $limit_next = $limit_end +
$absolute_difference;
90 $limit_previous_1 = $limit_start - $absolute_difference;
91 $limit_previous_2 = $limit_end - $absolute_difference;
94 (isset($_GET['q']) && $_GET['q'] != '') ||
95 (isset($_GET['registration']) && $_GET['registration'] != '') ||
96 (isset($_GET['aircraft']) && $_GET['aircraft'] != '') ||
97 (isset($_GET['manufacturer']) && $_GET['manufacturer'] != '') ||
98 (isset($_GET['highlights']) && $_GET['highlights'] != '') ||
99 (isset($_GET['airline']) && $_GET['airline'] != '') ||
100 (isset($_GET['airline_country']) && $_GET['airline_country'] != '') ||
101 (isset($_GET['airline_type']) && $_GET['airline_type'] != '') ||
102 (isset($_GET['airport']) && $_GET['airport'] != '') ||
103 (isset($_GET['airport_country']) && $_GET['airport_country'] != '') ||
104 (isset($_GET['callsign']) && $_GET['callsign'] != '') ||
105 (isset($_GET['captain_id']) && $_GET['captain_id'] != '') ||
106 (isset($_GET['race_id']) && $_GET['race_id'] != '') ||
107 (isset($_GET['captain_name']) && $_GET['captain_name'] != '') ||
108 (isset($_GET['race_name']) && $_GET['race_name'] != '') ||
109 (isset($_GET['owner']) && $_GET['owner'] != '') ||
110 (isset($_GET['pilot_name']) && $_GET['pilot_name'] != '') ||
111 (isset($_GET['pilot_id']) && $_GET['pilot_id'] != '') ||
112 (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != '') ||
113 (isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != '') ||
114 (isset($_GET['mmsi']) && $_GET['mmsi'] != '') ||
115 (isset($_GET['imo']) && $_GET['imo'] != '') ||
116 ((isset($_GET['origlat']) && $_GET['origlat'] != '') &&
117 (isset($_GET['origlon']) && $_GET['origlon'] != '') &&
118 (isset($_GET['dist']) && $_GET['dist'] != ''))
120 $q = filter_input(INPUT_GET
, 'q',FILTER_SANITIZE_STRING
);
121 $registration = filter_input(INPUT_GET
, 'registration',FILTER_SANITIZE_STRING
);
122 $aircraft = filter_input(INPUT_GET
, 'aircraft',FILTER_SANITIZE_STRING
);
123 $manufacturer = filter_input(INPUT_GET
, 'manufacturer',FILTER_SANITIZE_STRING
);
124 $highlights = filter_input(INPUT_GET
, 'highlights',FILTER_SANITIZE_STRING
);
125 $airline = filter_input(INPUT_GET
, 'airline',FILTER_SANITIZE_STRING
);
126 $airline_country = filter_input(INPUT_GET
, 'airline_country',FILTER_SANITIZE_STRING
);
127 $airline_type = filter_input(INPUT_GET
, 'airline_type',FILTER_SANITIZE_STRING
);
128 $airport = filter_input(INPUT_GET
, 'airport',FILTER_SANITIZE_STRING
);
129 $airport_country = filter_input(INPUT_GET
, 'airport_country',FILTER_SANITIZE_STRING
);
130 $callsign = filter_input(INPUT_GET
, 'callsign',FILTER_SANITIZE_STRING
);
131 $owner = filter_input(INPUT_GET
, 'owner',FILTER_SANITIZE_STRING
);
132 $pilot_name = filter_input(INPUT_GET
, 'pilot_name',FILTER_SANITIZE_STRING
);
133 $pilot_id = filter_input(INPUT_GET
, 'pilot_id',FILTER_SANITIZE_STRING
);
134 $mmsi = filter_input(INPUT_GET
, 'mmsi',FILTER_SANITIZE_NUMBER_INT
);
135 $imo = filter_input(INPUT_GET
, 'imo',FILTER_SANITIZE_NUMBER_INT
);
136 $captain_id = filter_input(INPUT_GET
, 'captain_id',FILTER_SANITIZE_NUMBER_INT
);
137 $race_id = filter_input(INPUT_GET
, 'race_id',FILTER_SANITIZE_NUMBER_INT
);
138 $captain_name = filter_input(INPUT_GET
, 'captain_name',FILTER_SANITIZE_STRING
);
139 $race_name = filter_input(INPUT_GET
, 'race_name',FILTER_SANITIZE_STRING
);
140 $departure_airport_route = filter_input(INPUT_GET
, 'departure_airport_route',FILTER_SANITIZE_STRING
);
141 $arrival_airport_route = filter_input(INPUT_GET
, 'arrival_airport_route',FILTER_SANITIZE_STRING
);
142 $sort = filter_input(INPUT_GET
,'sort',FILTER_SANITIZE_STRING
);
143 $archive = filter_input(INPUT_GET
,'archive',FILTER_SANITIZE_NUMBER_INT
);
144 $origlat = filter_input(INPUT_GET
,'origlat',FILTER_SANITIZE_NUMBER_FLOAT
,FILTER_FLAG_ALLOW_FRACTION
);
145 $origlon = filter_input(INPUT_GET
,'origlon',FILTER_SANITIZE_NUMBER_FLOAT
,FILTER_FLAG_ALLOW_FRACTION
);
146 $dist = filter_input(INPUT_GET
,'dist',FILTER_SANITIZE_NUMBER_INT
);
147 $number_results = filter_input(INPUT_GET
,'number_results',FILTER_SANITIZE_NUMBER_INT
);
149 if (isset($globalDistanceUnit) && $globalDistanceUnit == 'mi') $dist = $dist*1.60934;
150 elseif (isset($globalDistanceUnit) && $globalDistanceUnit == 'nm') $dist = $dist*1.852;
152 if (!isset($sql_date)) $sql_date = '';
154 if ($type == 'aircraft') {
155 $SpotterArchive = new SpotterArchive();
156 $spotter_array = $SpotterArchive->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
159 if ($type == 'aircraft') {
160 $spotter_array = $Spotter->searchSpotterData($q,$registration,$aircraft,strtolower(str_replace("-", " ", $manufacturer)),$highlights,$airline,$airline_country,$airline_type,$airport,$airport_country,$callsign,$departure_airport_route,$arrival_airport_route,$owner,$pilot_id,$pilot_name,$sql_altitude,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
161 } elseif ($type == 'tracker') {
162 $spotter_array = $Tracker->searchTrackerData($q,$callsign,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist);
163 } elseif ($type == 'marine') {
164 $spotter_array = $Marine->searchMarineData($q,$callsign,$mmsi,$imo,$sql_date,$limit_start.",".$absolute_difference,$sort,'',$origlat,$origlon,$dist,$captain_id,$captain_name,$race_id,$race_name);
168 print '<span class="sub-menu-statistic column mobile">';
169 print '<a href="#" onclick="showSubMenu(); return false;">Export <i class="fa fa-plus"></i></a>';
171 print '<div class="sub-menu sub-menu-container">';
172 print '<ul class="nav">';
173 if ($type == 'aircraft') {
174 print '<li class="dropdown">';
175 print '<a class="dropdown-toggle" data-toggle="dropdown" href="#" ><i class="fa fa-download"></i> '._("Download Search Results").' <span class="caret"></span></a>';
176 print '<ul class="dropdown-menu">';
177 print '<li><a href="'.$globalURL.'/search/csv?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">CSV</a></li>';
178 print '<li><a href="'.$globalURL.'/search/rss?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">RSS</a></li>';
179 print '<li><hr /></li>';
180 print '<li><span>For Advanced Users</strong></li>';
181 print '<li><a href="'.$globalURL.'/search/json?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">JSON</a></li>';
182 print '<li><a href="'.$globalURL.'/search/xml?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">XML</a></li>';
183 print '<li><a href="'.$globalURL.'/search/yaml?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">YAML</a></li>';
184 print '<li><a href="'.$globalURL.'/search/php?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">PHP (serialized array)</a></li>';
185 print '<li><hr /></li>';
186 print '<li><span>For Geo/Map Users</span></li>';
187 print '<li><a href="'.$globalURL.'/search/kml?'.htmlentities($_SERVER['QUERY_STRING']).'">KML</a></li>';
188 print '<li><a href="'.$globalURL.'/search/geojson?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">GeoJSON</a></li>';
189 print '<li><a href="'.$globalURL.'/search/georss?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">GeoRSS</a></li>';
190 print '<li><a href="'.$globalURL.'/search/gpx?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">GPX</a></li>';
191 print '<li><a href="'.$globalURL.'/search/wkt?'.htmlentities($_SERVER['QUERY_STRING']).'&download=true" target="_blank">WKT</a></li>';
192 print '<li><hr /></li>';
193 print '<li><a href="'.$globalURL.'/about/export" target="_blank" class="export-info">'._("Download Info/Licence").'»</a></li>';
197 //remove 3D=true parameter
198 $no3D = str_replace("&3D=true", "", $_SERVER['QUERY_STRING']);
199 $kmlURL = str_replace("http://", "kml://", $globalURL);
200 if (!isset($_GET['3D'])){
201 print '<li><a href="'.$globalURL.'/search?'.$no3D.'" class="active"><i class="fa fa-table"></i> '._("Table").'</a></li>';
203 print '<li><span class="notablet"><a href="'.$globalURL.'/search?'.$no3D.'"><i class="fa fa-table"></i> '._("Table").'</a></span></li>';
205 if (isset($_GET['3D'])){
206 print '<li><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="active"><i class="fa fa-globe"></i> '._("3D Map").'</a></li>';
208 print '<li ><a href="'.$globalURL.'/search?'.$no3D.'&3D=true" class="notablet nomobile"><i class="fa fa-globe"></i> '._("3D Map").'</a><a href="'.$kmlURL.'/search/kml?'.htmlentities($_SERVER['QUERY_STRING']).'" class="tablet mobile"><i class="fa fa-globe"></i> 3D Map</a></li>';
210 //checks to see if the Bit.ly API settings are set
211 if ($globalBitlyAccessToken != "")
213 print '<li class="short-url">';
214 $bitly = $Spotter->getBitlyURL(urlencode('http://'.$_SERVER[HTTP_HOST
].''.$_SERVER[REQUEST_URI
]));
215 print 'Short URL: <input type="text" name="short_url" value="'.$bitly.'" readonly="readonly" />';
221 if (!empty($spotter_array))
223 print '<div class="column">';
224 print '<div class="info">';
225 print '<h1>'._("Search Results for").' ';
226 if (isset($_GET['q']) && $_GET['q'] != ""){ print _("Keyword:").' <span>'.$q.'</span> '; }
227 if (isset($_GET['aircraft']) && $_GET['aircraft'] != ""){ print _("Aircraft:").' <span>'.$aircraft.'</span> '; }
228 if (isset($_GET['manufacturer']) && $_GET['manufacturer'] != ""){ print _("Manufacturer:").' <span>'.$manufacturer.'</span> '; }
229 if (isset($_GET['registration']) && $_GET['registration'] != ""){ print _("Registration:").' <span>'.$registration.'</span> '; }
230 if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print _("Highlights:").' <span>'.$highlights.'</span> '; }
231 if (isset($_GET['airline']) && $_GET['airline'] != ""){ print _("Airline:").' <span>'.$airline.'</span> '; }
232 if (isset($_GET['airline_country']) && $_GET['airline_country'] != ""){ print _("Airline country:").' <span>'.$airline_country.'</span> '; }
233 if (isset($_GET['airline_type']) && $_GET['airline_type'] != ""){ print _("Airline type:").' <span>'.$airline_type.'</span> '; }
234 if (isset($_GET['airport']) && $_GET['airport'] != ""){ print _("Airport:").' <span>'.$airport.'</span> '; }
235 if (isset($_GET['airport_country']) && $_GET['airport_country'] != ""){ print _("Airport country:").' <span>'.$airport_country.'</span> '; }
236 if (isset($_GET['callsign']) && $_GET['callsign'] != ""){ print _("Callsign:").' <span>'.$callsign.'</span> '; }
237 if (isset($_GET['owner']) && $_GET['owner'] != ""){ print _("Owner:").' <span>'.$owner.'</span> '; }
238 if (isset($_GET['pilot_id']) && $_GET['pilot_id'] != ""){ print _("Pilot id:").' <span>'.$pilot_id.'</span> '; }
239 if (isset($_GET['pilot_name']) && $_GET['pilot_name'] != ""){ print _("Pilot name:").' <span>'.$pilot_name.'</span> '; }
240 if (isset($_GET['captain_id']) && $_GET['captain_id'] != ""){ print _("Captain id:").' <span>'.$captain_id.'</span> '; }
241 if (isset($_GET['captain_name']) && $_GET['captain_name'] != ""){ print _("Captain name:").' <span>'.$captain_name.'</span> '; }
242 if (isset($_GET['race_id']) && $_GET['race_id'] != ""){ print _("Race id:").' <span>'.$race_id.'</span> '; }
243 if (isset($_GET['race_name']) && $_GET['race_name'] != ""){ print _("Race name:").' <span>'.$race_name.'</span> '; }
244 if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && (!isset($_GET['arrival_airport_route']) ||
$_GET['arrival_airport_route'] == "")){ print _("Route out of:").' <span>'.$departure_airport_route.'</span> '; }
245 if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] == "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route into:").' <span>'.$arrival_airport_route.'</span> '; }
246 if (isset($_GET['departure_airport_route']) && $_GET['departure_airport_route'] != "" && isset($_GET['arrival_airport_route']) && $_GET['arrival_airport_route'] != ""){ print _("Route between:").' <span>'.$departure_airport_route.'</span> and <span>'.$_GET['arrival_airport_route'].'</span> '; }
247 if (isset($_GET['mmsi']) && $_GET['mmsi'] != ""){ print _("MMSI:").' <span>'.$mmsi.'</span> '; }
248 if (isset($_GET['imo']) && $_GET['imo'] != ""){ print _("IMO:").' <span>'.$imo.'</span> '; }
249 if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] == ""){ print _("Date starting at:").' <span>'.$start_date.'</span> '; }
250 if (isset($_GET['start_date']) && $_GET['start_date'] == "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date ending at:").' <span>'.$end_date.'</span> '; }
251 if (isset($_GET['start_date']) && $_GET['start_date'] != "" && isset($_GET['end_date']) && $_GET['end_date'] != ""){ print _("Date between:").' <span>'.$start_date.'</span> and <span>'.$end_date.'</span> '; }
252 if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == ""){ print _("Altitude starting at:").' <span>'.number_format($lowest_altitude).' feet</span> '; }
253 if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude ending at:").' <span>'.number_format($highest_altitude).' feet</span> '; }
254 if (isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] != "" && isset($_GET['highest_altitude']) && $_GET['highest_altitude'] != ""){ print _("Altitude between:").' <span>'.number_format($lowest_altitude).' feet</span> '._("and").' <span>'.number_format($highest_altitude).' feet</span> '; }
255 if (isset($_GET['number_results']) && $_GET['number_results'] != ""){ print _("limit per page:").' <span>'.$number_results.'</span> '; }
259 // if ($_GET['3D'] == "true")
260 if (isset($_GET['3D']))
263 <script type
="text/javascript" src
="https://www.google.com/jsapi"> </script
>
264 <script type
="text/javascript">
266 google
.load("earth", "1", {"other_params":"sensor=false"});
269 google
.earth
.createInstance('map3d', initCB
, failureCB
);
272 function initCB(instance
) {
274 ge
.getWindow().setVisibility(true);
276 //set default coordinates
277 var lookAt
= ge
.createLookAt('');
278 lookAt
.setLatitude(44.413333);
279 lookAt
.setLongitude(-79.68);
280 lookAt
.setRange(400000.0);
281 ge
.getView().setAbstractView(lookAt
);
283 //show navigation control
284 ge
.getNavigationControl().setVisibility(ge
.VISIBILITY_SHOW
);
286 //show bottom status bar
287 ge
.getOptions().setStatusBarVisibility(true);
289 //enable the atmosphere
290 ge
.getOptions().setAtmosphereVisibility(true);
294 var href
= '<?php print $globalURL; ?>/search/kml?<?php print $_SERVER['QUERY_STRING
']; ?>';
295 google
.earth
.fetchKml(ge
, href
, function(kmlObject
) {
297 ge
.getFeatures().appendChild(kmlObject
);
299 if (kmlObject
.getAbstractView() !== null)
300 ge
.getView().setAbstractView(kmlObject
.getAbstractView());
304 function failureCB(errorCode
) {
307 google
.setOnLoadCallback(init
);
309 <div id
="map3d"></div
>
312 include('table-output.php');
313 $_SERVER['QUERY_STRING'] = preg_replace('/&?limit=[^&]*/', '', $_SERVER['QUERY_STRING']);
314 print '<div class="pagination">';
315 if ($limit_previous_1 >= 0)
317 if ($type == 'aircraft') {
318 print '<a href="'.$globalURL.'/search?'.$_SERVER['QUERY_STRING'].'&limit='.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>';
319 } elseif ($type == 'tracker') {
320 print '<a href="'.$globalURL.'/tracker/search?'.$_SERVER['QUERY_STRING'].'&limit='.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>';
321 } elseif ($type == 'marine') {
322 print '<a href="'.$globalURL.'/marine/search?'.$_SERVER['QUERY_STRING'].'&limit='.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>';
325 if ($spotter_array[0]['query_number_rows'] == $absolute_difference)
327 if ($type == 'aircraft') {
328 print '<a href="'.$globalURL.'/search?'.$_SERVER['QUERY_STRING'].'&limit='.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>';
329 } elseif ($type == 'tracker') {
330 print '<a href="'.$globalURL.'/tracker/search?'.$_SERVER['QUERY_STRING'].'&limit='.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>';
331 } elseif ($type == 'marine') {
332 print '<a href="'.$globalURL.'/marine/search?'.$_SERVER['QUERY_STRING'].'&limit='.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>';
339 print '<div class="column">';
340 print '<div class="info">';
341 print '<h1>'._("Search").'</h1>';
343 print '<p>'._("Sorry, your search did not produce any results. :(").'</p>';
347 print '<div class="info column">';
348 print '<h1>'._("Search").'</h1>';
355 if ($type == 'aircraft') {
357 <form action
="<?php print $globalURL; ?>/search" method
="get" role
="form" class="form-horizontal">
359 } elseif ($type == 'marine') {
361 <form action
="<?php print $globalURL; ?>/marine/search" method
="get" role
="form" class="form-horizontal">
363 } elseif ($type == 'tracker') {
365 <form action
="<?php print $globalURL; ?>/tracker/search" method
="get" role
="form" class="form-horizontal">
371 <div
class="form-group">
372 <label
class="control-label col-sm-2"><?php
echo _("Keywords"); ?
></label
>
373 <div
class="col-sm-10">
374 <input type
="text" class="form-control" id
="q" name
="q" value
="<?php if (isset($_GET['q'])) print $q; ?>" size
="10" placeholder
="<?php echo _("Keywords
"); ?>" />
379 <div
class="advanced-form">
381 if ($type == 'aircraft') {
384 <legend
><?php
echo _("Aircraft"); ?
></legend
>
385 <div
class="form-group">
386 <label
class="control-label col-sm-2"><?php
echo _("Manufacturer"); ?
></label
>
387 <div
class="col-sm-10">
388 <select name
="manufacturer" class="form-control" id
="manufacturer" class="selectpicker" data
-live
-search
="true">
393 <script type
="text/javascript">getSelect('manufacturer','<?php if(isset($_GET['manufacturer
'])) print $manufacturer; ?>')</script
>
394 <div
class="form-group">
395 <label
class="control-label col-sm-2"><?php
echo _("Type"); ?
></label
>
396 <div
class="col-sm-10">
397 <select name
="aircraft" class="form-control" id
="aircrafttypes" class="selectpicker" data
-live
-search
="true">
402 <script type
="text/javascript">getSelect('aircrafttypes','<?php if(isset($_GET['aircraft_icao
'])) print $aircraft_icao; ?>');</script
>
403 <div
class="form-group">
404 <label
class="control-label col-sm-2"><?php
echo _("Registration"); ?
></label
>
405 <div
class="col-sm-10">
406 <input type
="text" class="form-control" name
="registration" value
="<?php if (isset($_GET['registration'])) print $registration; ?>" size
="8" placeholder
="<?php echo _("Registration
"); ?>" />
410 if ((isset($globalVA) && $globalVA) ||
(isset($globalIVAO) && $globalIVAO) ||
(isset($globalVATSIM) && $globalVATSIM) ||
(isset($globalphpVMS) && $globalphpVMS)) {
412 <div
class="form-group">
413 <label
class="control-label col-sm-2"><?php
echo _("Pilot id"); ?
></label
>
414 <div
class="col-sm-10">
415 <input type
="text" class="form-control" name
="pilot_id" value
="<?php if (isset($_GET['pilot_id'])) print $pilot_id; ?>" size
="15" placeholder
="<?php echo _("Pilot id
"); ?>" />
418 <div
class="form-group">
419 <label
class="control-label col-sm-2"><?php
echo _("Pilot name"); ?
></label
>
420 <div
class="col-sm-10">
421 <input type
="text" class="form-control" name
="pilot_name" value
="<?php if (isset($_GET['pilot_name'])) print $pilot_name; ?>" size
="15" placeholder
="<?php echo _("Pilot name
"); ?>" />
427 <div
class="form-group">
428 <label
class="control-label col-sm-2"><?php
echo _("Owner name"); ?
></label
>
429 <div
class="col-sm-10">
430 <input type
="text" class="form-control" name
="owner" value
="<?php if (isset($_GET['owner'])) print $owner; ?>" size
="15" placeholder
="<?php echo _("Owner name
"); ?>" />
436 <div
class="form-group">
437 <div
class="col-sm-offset-2 col-sm-10">
438 <!--<div
><input type
="checkbox" class="form-control" name
="highlights" value
="true" id
="highlights" <?php
if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?
>> <label
for="highlights"><?php
echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?
></label
></div
>-->
439 <label
class="checkbox-inline"><input type
="checkbox" name
="highlights" value
="true" id
="highlights" <?php
if (isset($_GET['highlights'])) if ($_GET['highlights'] == "true"){ print 'checked="checked"'; } ?
>> <?php
echo _("Include only aircraft with special highlights (unique liveries, destinations etc.)"); ?
></label
>
444 <legend
><?php
echo _("Airline"); ?
></legend
>
445 <div
class="form-group">
446 <label
class="control-label col-sm-2"><?php
echo _("Name"); ?
></label
>
447 <div
class="col-sm-10">
448 <select name
="airline" id
="airlinenames" class="form-control selectpicker" data
-live
-search
="true">
453 <script type
="text/javascript">getSelect('airlinenames','<?php if(isset($_GET['airline
'])) print $airline; ?>');</script
>
454 <div
class="form-group">
455 <label
class="control-label col-sm-2"><?php
echo _("Country"); ?
></label
>
456 <div
class="col-sm-10">
457 <select name
="airline_country" id
="airlinecountries" class="form-control selectpicker" data
-live
-search
="true">
462 <script type
="text/javascript">getSelect('airlinecountries','<?php if(isset($_GET['airline_country
'])) print $airline_country; ?>');</script
>
463 <div
class="form-group">
464 <label
class="control-label col-sm-2"><?php
echo _("Callsign"); ?
></label
>
465 <div
class="col-sm-10">
466 <input type
="text" name
="callsign" class="form-control" value
="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size
="8" placeholder
="<?php echo _("Callsign
"); ?>" />
469 <div
class="form-group">
470 <div
class="col-sm-offset-2 col-sm-10">
471 <label
class="radio-inline"><input type
="radio" name
="airline_type" value
="all" id
="airline_type_all" <?php
if (!isset($_GET['airline_type']) ||
$_GET['airline_type'] == "all"){ print 'checked="checked"'; } ?
>> <?php
echo _("All airlines types"); ?
></label
>
472 <label
class="radio-inline"><input type
="radio" name
="airline_type" value
="passenger" id
="airline_type_passenger" <?php
if (isset($_GET['airline_type'])) if ($_GET['airline_type'] == "passenger"){ print 'checked="checked"'; } ?
>> <?php
echo _("Only Passenger airlines"); ?
></label
>
473 <label
class="radio-inline"><input type
="radio" name
="airline_type" value
="cargo" id
="airline_type_cargo" <?php
if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "cargo"){ print 'checked="checked"'; } ?
>> <?php
echo _("Only Cargo airlines"); ?
></label
>
474 <label
class="radio-inline"><input type
="radio" name
="airline_type" value
="military" id
="airline_type_military" <?php
if (isset($_GET['airline_type'])) if ( $_GET['airline_type'] == "military"){ print 'checked="checked"'; } ?
>> <?php
echo _("Only Military airlines"); ?
></label
>
479 <legend
><?php
echo _("Airport"); ?
></legend
>
480 <div
class="form-group">
481 <label
class="control-label col-sm-2"><?php
echo _("Name"); ?
></label
>
482 <div
class="col-sm-10">
483 <select name
="airport" id
="airportnames" class="form-control selectpicker" data
-live
-search
="true">
488 <script type
="text/javascript">getSelect('airportnames','<?php if(isset($_GET['airport_icao
'])) print $airport_icao; ?>');</script
>
489 <div
class="form-group">
490 <label
class="control-label col-sm-2"><?php
echo _("Country"); ?
></label
>
491 <div
class="col-sm-10">
492 <select name
="airport_country" id
="airportcountries" class="form-control selectpicker" data
-live
-search
="true">
497 <script type
="text/javascript">getSelect('airportcountries','<?php if(isset($_GET['airport_country
'])) print $airport_country; ?>');</script
>
500 <legend
><?php
echo _("Route"); ?
></legend
>
501 <div
class="form-group">
502 <label
class="control-label col-sm-2"><?php
echo _("Departure Airport"); ?
></label
>
503 <div
class="col-sm-10">
504 <select name
="departure_airport_route" id
="departureairportnames" class="form-control selectpicker" data
-live
-search
="true">
509 <script type
="text/javascript">getSelect('departureairportnames','<?php if(isset($_GET['departure_airport_route
'])) print $departure_airport_route; ?>');</script
>
510 <div
class="form-group">
511 <label
class="control-label col-sm-2"><?php
echo _("Arrival Airport"); ?
></label
>
512 <div
class="col-sm-10">
513 <select name
="arrival_airport_route" id
="arrivalairportnames" class="form-control selectpicker" data
-live
-search
="true">
518 <script type
="text/javascript">getSelect('arrivalairportnames','<?php if(isset($_GET['arrival_airport_route
'])) print $arrival_airport_route; ?>');</script
>
521 <legend
><?php
echo _("Altitude"); ?
></legend
>
522 <div
class="form-group">
523 <label
class="control-label col-sm-2"><?php
echo _("Lowest Altitude"); ?
></label
>
524 <div
class="col-sm-10">
525 <select name
="lowest_altitude" class="form-control selectpicker" data
-live
-search
="true">
528 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
529 foreach($altitude_array as $altitude)
531 if(isset($_GET['lowest_altitude']) && $_GET['lowest_altitude'] == $altitude)
533 print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
535 print '<option value="'.$altitude.'">'.number_format($altitude).' feet</option>';
542 <div
class="form-group">
543 <label
class="control-label col-sm-2"><?php
echo _("Highest Altitude"); ?
></label
>
544 <div
class="col-sm-10">
545 <select name
="highest_altitude" class="form-control selectpicker" data
-live
-search
="true">
548 $altitude_array = Array(1000, 5000, 10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000);
549 foreach($altitude_array as $altitude)
551 if(isset($_GET['highest_altitude']) && $_GET['highest_altitude'] == $altitude)
553 print '<option value="'.$altitude.'" selected="selected">'.number_format($altitude).' feet</option>';
555 print '<option value="'.$altitude.'">'.number_format($altitude).' feet</option>';
564 <legend
><?php
echo _("Flights near"); ?
></legend
>
565 <div
class="form-group">
566 <label
class="control-label col-sm-2"><?php
echo _("Latitude"); ?
></label
>
567 <div
class="col-sm-10">
568 <input type
="text" name
="origlat" class="form-control" placeholder
="<?php echo _("Center point latitude
"); ?>" value
="<?php if (isset($_GET['origlat'])) print $origlat; ?>" />
571 <div
class="form-group">
572 <label
class="control-label col-sm-2"><?php
echo _("Longitude"); ?
></label
>
573 <div
class="col-sm-10">
574 <input type
="text" name
="origlon" class="form-control" placeholder
="<?php echo _("Center point longitude
"); ?>" value
="<?php if (isset($_GET['origlon'])) print $origlon; ?>" />
577 <div
class="form-group">
578 <label
class="control-label col-sm-2"><?php
echo _("Distance").' ('; if (isset($globalDistanceUnit)) print $globalDistanceUnit; else print 'km'; print ')'; ?
></label
>
579 <div
class="col-sm-10">
580 <input type
="text" name
="dist" class="form-control" placeholder
="<?php echo _("Distance from center point
"); ?>" value
="<?php if (isset($_GET['distance'])) print $distance; ?>" />
585 } elseif ($type == 'tracker') {
588 <div
class="form-group">
589 <label
class="control-label col-sm-2"><?php
echo _("Callsign"); ?
></label
>
590 <div
class="col-sm-10">
591 <input type
="text" name
="callsign" class="form-control" value
="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size
="8" placeholder
="<?php echo _("Callsign
"); ?>" />
596 } elseif ($type == 'marine') {
599 <div
class="form-group">
600 <label
class="control-label col-sm-2"><?php
echo _("Callsign"); ?
></label
>
601 <div
class="col-sm-10">
602 <input type
="text" name
="callsign" class="form-control" value
="<?php if (isset($_GET['callsign'])) print $callsign; ?>" size
="8" placeholder
="<?php echo _("Callsign
"); ?>" />
607 if (isset($globalVM) && $globalVM) {
610 <div
class="form-group">
611 <label
class="control-label col-sm-2"><?php
echo _("Captain id"); ?
></label
>
612 <div
class="col-sm-10">
613 <input type
="text" name
="captain_id" class="form-control" value
="<?php if (isset($_GET['captain_id'])) print $captain_id; ?>" size
="8" placeholder
="<?php echo _("Captain id
"); ?>" />
618 <div
class="form-group">
619 <label
class="control-label col-sm-2"><?php
echo _("Captain name"); ?
></label
>
620 <div
class="col-sm-10">
621 <input type
="text" name
="captain_name" class="form-control" value
="<?php if (isset($_GET['captain_name'])) print $captain_name; ?>" size
="8" placeholder
="<?php echo _("Captain name
"); ?>" />
626 <div
class="form-group">
627 <label
class="control-label col-sm-2"><?php
echo _("Race id"); ?
></label
>
628 <div
class="col-sm-10">
629 <input type
="text" name
="race_id" class="form-control" value
="<?php if (isset($_GET['race_id'])) print $race_id; ?>" size
="8" placeholder
="<?php echo _("Race id
"); ?>" />
634 <div
class="form-group">
635 <label
class="control-label col-sm-2"><?php
echo _("Race name"); ?
></label
>
636 <div
class="col-sm-10">
637 <input type
="text" name
="race_name" class="form-control" value
="<?php if (isset($_GET['race_name'])) print $race_name; ?>" size
="8" placeholder
="<?php echo _("Race name
"); ?>" />
645 <div
class="form-group">
646 <label
class="control-label col-sm-2"><?php
echo _("MMSI"); ?
></label
>
647 <div
class="col-sm-10">
648 <input type
="text" name
="mmsi" class="form-control" value
="<?php if (isset($_GET['mmsi'])) print $mmsi; ?>" size
="8" placeholder
="<?php echo _("MMSI
"); ?>" />
653 <div
class="form-group">
654 <label
class="control-label col-sm-2"><?php
echo _("IMO"); ?
></label
>
655 <div
class="col-sm-10">
656 <input type
="text" name
="imo" class="form-control" value
="<?php if (isset($_GET['imo'])) print $imo; ?>" size
="8" placeholder
="<?php echo _("IMO
"); ?>" />
665 <legend
><?php
echo _("Date"); ?
></legend
>
666 <div
class="form-group">
667 <label
class="control-label col-sm-2"><?php
echo _("Start Date"); ?
></label
>
668 <div
class="col-sm-10">
669 <div
class='input-group date' id
='datetimepicker1'>
670 <input type
='text' name
="start_date" class="form-control" value
="<?php if (isset($_GET['start_date']) && $_GET['start_date'] != '') print $start_date; ?>" placeholder
="<?php echo _("Start Date
/Time
"); ?>" />
671 <span
class="input-group-addon">
672 <span
class="glyphicon glyphicon-calendar"></span
>
677 <div
class="form-group">
678 <label
class="control-label col-sm-2"><?php
echo _("End Date"); ?
></label
>
679 <div
class="col-sm-10">
680 <div
class='input-group date' id
='datetimepicker2'>
681 <input type
='text' name
="end_date" class="form-control" value
="<?php if (isset($_GET['end_date']) && $_GET['end_date'] != '') print $end_date; ?>" placeholder
="<?php echo _("End Date
/Time
"); ?>" />
682 <span
class="input-group-addon">
683 <span
class="glyphicon glyphicon-calendar"></span
>
687 <script type
="text/javascript">
689 $
('#datetimepicker1').datetimepicker({
692 $
('#datetimepicker2').datetimepicker({
693 format
: 'YYYY-MM-DD',
694 useCurrent
: false //Important! See issue #1075
696 $
("#datetimepicker1").on("dp.change", function (e
) {
697 $
('#datetimepicker2').data("DateTimePicker").minDate(e
.date
);
699 $
("#datetimepicker2").on("dp.change", function (e
) {
700 $
('#datetimepicker1').data("DateTimePicker").maxDate(e
.date
);
707 <legend
><?php
echo _("Limit per Page"); ?
></legend
>
708 <div
class="form-group">
709 <label
class="control-label col-sm-2"><?php
echo _("Number of Results"); ?
></label
>
710 <div
class="col-sm-10">
711 <select
class="form-control" name
="number_results">
713 $number_results_array = Array(25, 50, 100, 150, 200, 250, 300, 400, 500, 600, 700, 800, 900, 1000);
714 foreach($number_results_array as $number)
716 if(isset($_GET['number_results']) && $_GET['number_results'] == $number)
718 print '<option value="'.$number.'" selected="selected">'.$number.'</option>';
720 print '<option value="'.$number.'">'.$number.'</option>';
729 if (isset($globalArchiveKeepMonths) && $globalArchiveKeepMonths > 0) {
730 if (isset($globalDemo) && $globalDemo) {
733 <div
class="form-group">
734 <div
class="col-sm-offset-2 col-sm-10">
735 <label
class="checkbox-inline"><input type
="checkbox" name
="archive" value
="1" disabled
/><?php
echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?
></label
>
736 <p
class="help-block">Disabled in demo
</p
>
744 <div
class="form-group">
745 <div
class="col-sm-offset-2 col-sm-10">
746 <label
class="checkbox-inline"><input type
="checkbox" name
="archive" value
="1" /><?php
echo sprintf(_("Search in archive (older than %s months)"),$globalArchiveKeepMonths); ?
></label
>
755 <div
class="col-sm-offset-2 col-sm-10">
756 <input type
="submit" class="btn btn-default" value
="<?php echo _("Search
"); ?>" />
763 require_once('footer.php');