echo $latitud['deg'];
?>
" placeholder="Grados" /><label>&deg;</label>
				<input type="text" name="la_minutos" id="txt_titulo" class="txt" style="" value="<?php 
echo $latitud['min'];
?>
" placeholder="Minutos" /><label>'</label>
				<input type="text" name="la_segundos" id="txt_titulo" class="txt" style="" value="<?php 
echo $latitud['sec'];
?>
" placeholder="Segundos" /><label>"</label>
				
				<br /><br />
				
				<?php 
$longitud = DECtoDMS($propiedades->longitud);
?>

				<label>Longitud</label>
				<br />
				<input type="text" name="lo_grados" id="txt_titulo" class="txt" style="" value="<?php 
echo $longitud['deg'];
?>
" placeholder="Grados" /><label>&deg;</label>
				<input type="text" name="lo_minutos" id="txt_titulo" class="txt" style="" value="<?php 
echo $longitud['min'];
?>
" placeholder="Minutos" /><label>'</label>
				<input type="text" name="lo_segundos" id="txt_titulo" class="txt" style="" value="<?php 
echo $longitud['sec'];
?>
  * GPS
  */
 $url = "http://maps.google.com/maps/api/geocode/json?address=" . urlencode($adresa) . "&sensor=false";
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_HEADER, 0);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language:cs-CZ,cs;q=0.8'));
 $json = curl_exec($ch);
 curl_close($ch);
 $result = json_decode($json, true);
 if (isset($result['results'][0]['geometry']['location'])) {
     $return['lat'] = $result['results'][0]['geometry']['location']['lat'];
     $return['lng'] = $result['results'][0]['geometry']['location']['lng'];
     $lat_format = DECtoDMS($return['lat']);
     $lng_format = DECtoDMS($return['lng']);
     $return['lat_format'] = $lat_format['deg'] . "° " . $lat_format['min'] . "' " . $lat_format['sec'] . '"';
     $return['lng_format'] = $lng_format['deg'] . "° " . $lng_format['min'] . "' " . $lng_format['sec'] . '"';
     // $return['lng'] = $result['results'][0]['geometry']['location']['lng'];
     // $return['lat_lng'] = $return['lat'].",".$return['lng'];
     /**
      * Address
      */
     $url = "http://maps.google.com/maps/api/geocode/json?latlng=" . urlencode($return['lat'] . "," . $return['lng']) . "&sensor=false";
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_HEADER, 0);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language:cs-CZ,cs;q=0.8'));
     $json = curl_exec($ch);
     curl_close($ch);
Beispiel #3
0
function writeGpsPosToFile($_fullPath, $_lat, $_lon)
{
    $latDms = DECtoDMS($_lat);
    $lonDms = DECtoDMS($_lon);
    exec('exiftool -exif:gpslatitude="' . $latDms['deg'] . ' ' . $latDms['min'] . ' ' . $latDms['sec'] . '" ' . $_fullPath . '');
    exec('exiftool -exif:gpslongitude="' . $lonDms['deg'] . ' ' . $lonDms['min'] . ' ' . $lonDms['sec'] . '" ' . $_fullPath . '');
}
function getDetailsAD($icao)
{
    // SQL Pointer is a global variable
    global $navdatabase, $rfedatabase, $sqlconn;
    change_db($sqlconn, $navdatabase);
    $sql = "SELECT Latitude,Longtitude,Elevation FROM Airports WHERE ICAO='{$icao}'";
    $res = mysqlexec($iddata, $sql);
    change_db($sqlconn, $rfedatabase);
    $latitud = mysql_result($res, 0, 0);
    $longitud = mysql_result($res, 0, 1);
    $elevation = mysql_result($res, 0, 2);
    echo '<table class="table table-bordered table-condensed table-striped">';
    //echo '<table class="table table-condensed">';
    echo '<tr><th>Coordinates</th><td colspan="3">' . DECtoDMS($latitud, "Lat") . ', ' . DECtoDMS($longitud, "Lon") . ' (' . sprintf('%2.6f', $latitud) . ', ' . sprintf('%3.6f', $longitud) . ')</td></tr>';
    echo '<tr><th>Elevation</th><td colspan="3">' . $elevation . ' ft (' . bcmul($elevation, 0.3048, 0) . ' m)</td></tr>';
    echo '<tr><th>DMG</th><td colspan="3">' . getDMG($latitud, $longitud) . '</td></tr>';
    //echo '</table>';
    change_db($sqlconn, $navdatabase);
    $sql = "SELECT rwy.Ident,rwy.TrueHeading,rwy.Length,rwy.Width,rwy.Surface,ils.ident,ils.category,ils.Freq,ils.HasDME\n\t\t\tFROM Airports AS apt\n\t\t\tLEFT JOIN Runways AS rwy ON rwy.AirportID = apt.ID\n\t\t\tLEFT JOIN ILSes AS ils ON ils.RunwayID = rwy.ID\n\t\t\tWHERE apt.ICAO = '" . $icao . "' ORDER BY rwy.Ident";
    $res = mysqlexec($iddata, $sql);
    change_db($sqlconn, $rfedatabase);
    //echo '<table class="table table-bordered table-condensed table-striped">';
    echo '<tr><th colspan=4 style="background: #d4d4d4;"><center>Runways</center></th></tr>';
    echo "<tr><th style='text-align: center;'>ID</th><th style='text-align: center;'>Dimensions</th><th style='text-align: center;'>Surface</th><th style='text-align: center;'>ILS</th></tr>";
    for ($i = 0; $i < mysql_num_rows($res); $i++) {
        echo "<tr><td style='text-align: center;vertical-align: middle;'>" . mysql_result($res, $i, 0) . "</td><td style='text-align: center;vertical-align: middle;'>" . mysql_result($res, $i, 2) . " ft X " . mysql_result($res, $i, 3) . " ft<br>" . bcmul(mysql_result($res, $i, 2), 0.3048, 0) . " m X " . bcmul(mysql_result($res, $i, 3), 0.3048, 0) . " m</td><td style='text-align: center;vertical-align: middle;'>" . mysql_result($res, $i, 4) . "</td>";
        $ils = mysql_result($res, $i, 5);
        if (!empty($ils)) {
            if (mysql_result($res, $i, 6) == 0) {
                echo "<td style='text-align: center;vertical-align: middle;'>" . $ils . " (LOC) - " . bcdiv(dechex(mysql_result($res, $i, 7)), "10000", 3) . "</td></tr>";
            } else {
                echo "<td style='text-align: center;vertical-align: middle;'>" . $ils . " (CAT " . mysql_result($res, $i, 6) . ") - " . bcdiv(dechex(mysql_result($res, $i, 7)), "10000", 3) . "</td></tr>";
            }
        } else {
            echo "<td style='text-align: center;vertical-align: middle;'>none</td></tr>";
        }
    }
    echo "</table>";
}