Merge pull request #456 from Struart88/patch-2
[FlightAirMap.git] / atc-data.php
blobee3391def3dc523b9e48c3cc57f5fe35b9894d37
1 <?php
2 require_once('require/class.Connection.php');
3 require_once('require/class.Language.php');
4 require_once('require/class.ATC.php');
5 $ATC = new ATC();
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);
10 $atc_data = $ATC->getById($atcid);
11 if (!isset($atc_data[0])) $atc_data = $ATC->getByIdent($atcident);
13 <div class="alldetails">
14 <button type="button" class="close">&times;</button>
15 <?php
16 $spotter_item = $atc_data[0];
18 date_default_timezone_set('UTC');
20 print '<div class="top">';
21 print '<div class="right"><div class="callsign-details"><div class="callsign">'.$spotter_item['ident'].'</div>';
22 print '</div>';
24 print '</div></div>';
25 print '<div class="details"><div class="mobile airports"><div class="airport">';
26 print '</div></div><div>';
28 if (isset($spotter_item['frequency']) && $spotter_item['frequency'] != '') {
29 print '<span>'._("Frequency").'</span>';
30 print $spotter_item['frequency'];
31 print '</div>';
33 if (isset($spotter_item['ivao_name']) && $spotter_item['ivao_name'] != '') {
34 print '<div><span>'._("Name").'</span>';
35 print $spotter_item['ivao_name'];
36 print '</div>';
38 print '<div><span>'._("Type").'</span>';
39 print $spotter_item['type'];
40 print '</div>';
42 //print '<div><span>'._("Country").'</span>'.$spotter_item['country'].'</div>';
43 print '<div><span>'._("Coordinates").'</span>'.round($spotter_item['latitude'],3).', '.round($spotter_item['longitude'],3).'</div>';
44 if ($spotter_item['atc_range'] > 0) {
45 print '<div><span>'._("Range").'</span>';
46 print $spotter_item['atc_range'];
47 print '</div>';
49 print '</div>';
50 if ($spotter_item['info'] != '') {
51 print '<div class="notamtext"><span>'._("Info").'</span>';
52 print $spotter_item['info'];
53 print '</div>';
55 print '</div>';
58 </div>