Exemplo n.º 1
0
     $this_year = substr($row[DATE], 0, 4);
     $linkIGC = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . getRelMainDir() . str_replace("%PILOTID%", getPilotID($row["userServerID"], $row["userID"]), str_replace("%YEAR%", $this_year, $CONF['paths']['igc'])) . '/' . $row['filename']);
     //$flightsRelPath."/".$row[userID]."/flights/".$this_year."/".$row[filename] );
     if ($row['takeoffVinicity'] > $takeoffRadious) {
         $location = getWaypointName($row['takeoffID']) . " [~" . sprintf("%.1f", $row['takeoffVinicity'] / 1000) . " km]";
     } else {
         $location = getWaypointName($row['takeoffID']);
     }
     $flight = new flight();
     $flight->getFlightFromDB($row['ID'], 0, $row);
     $extendedInfo = 0;
     $lineColor = "ff0000";
     $exaggeration = 1;
     $lineWidth = 2;
     $getFlightKML = $flight->getFlightKML() . "&c={$lineColor}&w={$lineWidth}&an={$extendedInfo}";
     $desc = $flight->kmlGetDescription($extendedInfo, $getFlightKML, 1);
     $snippet = "<![CDATA[" . formatDistance($flight->FLIGHT_KM, 1) . ", " . _DURATION . ": " . sec2Time($flight->DURATION, 1) . "]]>";
     $str .= "<Placemark>\n\t\t\t\t<name><![CDATA[{$location}]]></name>\n\t\t\t\t<styleUrl>#marker_cat_" . $row['cat'] . "</styleUrl>\n\t\t\t\t<Snippet  maxLines='1'>{$snippet}</Snippet>\n\t\t\t\t" . $desc . "\n\t\t\t\t<Point>\n\t\t\t\t<coordinates>" . $row['firstLon'] . ',' . $row['firstLat'] . "</coordinates>\n\t\t\t\t</Point>\n\t\t\t\t</Placemark>\t\t\t\n\t\t\t";
     $i++;
 }
 $trackNum = $i;
 $incWaypoints = 1;
 if ($cameraAlt > 100000) {
     $incWaypoints = 0;
 }
 if ($incWaypoints) {
     $query = "SELECT * FROM {$waypointsTable} WHERE \n\t\t\t\t type=1000 AND\n\t\t\t\t lat>={$south} AND lat<={$north} AND \n\t\t\t\t lon<=" . -$west . " AND lon>=" . -$east . " ORDER BY ID";
     //echo $query;
     $res = $db->sql_query($query);
     if ($res <= 0) {
         echo "<H3> Error in query! {$query} </H3>\n";