'SCORE_INFO_LINK'=>$showScoreInfo, )); } else { $Ltemplate->assign_vars(array( 'MAX_DISTANCE'=>0, 'OLC_TYPE'=>0, 'OLC_KM'=>0, 'OLC_SCORE'=>0, )); } $Ltemplate->assign_vars(array( 'MAX_SPEED'=>formatSpeed($flight->MAX_SPEED), 'MAX_VARIO'=>formatVario($flight->MAX_VARIO), 'MEAN_SPEED'=>formatSpeed($flight->MEAN_SPEED), 'MIN_VARIO'=>formatVario($flight->MIN_VARIO), )); if ($flight->is3D()) { $Ltemplate->assign_vars(array( 'MAX_ALT'=>formatAltitude($flight->MAX_ALT), 'TAKEOFF_ALT'=>formatAltitude($flight->TAKEOFF_ALT), 'MIN_ALT'=>formatAltitude($flight->MIN_ALT), 'ALTITUDE_GAIN'=>formatAltitude($flight->MAX_ALT-$flight->TAKEOFF_ALT), )); } else { $Ltemplate->assign_vars(array( 'MAX_ALT'=>0, 'TAKEOFF_ALT'=>0, 'MIN_ALT'=>0, 'ALTITUDE_GAIN'=>0,
$olcScoreTypeImg = "photo_icon_blank.gif"; } } } echo "<TR class='hr'><TD>" . _OLC_SCORE_TYPE . "</td><td>" . formatOLCScoreType($flight->BEST_FLIGHT_TYPE) . " " . leoHtml::img($olcScoreTypeImg, 0, 0, 'absmiddle', '', 'icons1', '', 0) . "\n"; echo "<TR><TD>" . _OLC_DISTANCE . "</td><td>" . formatDistanceOpen($flight->FLIGHT_KM) . " ({$olcDistanceSpeed})\n"; echo "<TR><TD>" . _OLC_SCORING . "</td><td>" . formatOLCScore($flight->FLIGHT_POINTS) . "<td></tr>\n"; echo "<TR class='hr'><TD>" . _OPEN_DISTANCE . "</td><td>" . formatDistanceOpen($flight->LINEAR_DISTANCE) . " ({$openDistanceSpeed})" . "<td></tr>\n"; echo "<TR><TD>" . _MAX_DISTANCE . "</td><td>" . formatDistanceOpen($flight->MAX_LINEAR_DISTANCE) . " ({$maxDistanceSpeed})\n"; } echo "<TR class='hr'><TD>" . _TAKEOFF_LOCATION . "</td><td>" . formatLocation(getWaypointName($flight->takeoffID), $flight->takeoffVinicity, $takeoffRadious) . "<td></tr>\n"; echo "<TR><TD>" . _TAKEOFF_TIME . "</td><td>" . sec2Time($flight->START_TIME) . "<td></tr>\n"; echo "<TR><TD>" . _DURATION . "</td><td>" . sec2Time($flight->DURATION) . "<td></tr>\n"; echo "<TR class='hr'><TD>" . _MAX_SPEED . "</td><td>" . formatSpeed($flight->MAX_SPEED) . "<td></tr>\n"; echo "<TR><TD>" . _MAX_VARIO . "</td><td>" . formatVario($flight->MAX_VARIO) . "<td></tr>\n"; echo "<TR><TD>" . _MIN_VARIO . "</td><td>" . formatVario($flight->MIN_VARIO) . "<td></tr>\n"; if ($flight->is3D()) { echo "<TR><TD>" . _MAX_ALTITUDE . "</td><td>" . formatAltitude($flight->MAX_ALT) . "<td></tr>\n"; echo "<TR><TD>" . _TAKEOFF_ALTITUDE . "</td><td>" . formatAltitude($flight->TAKEOFF_ALT) . "<td></tr>\n"; } if ($flight->commentsNum && 0) { $flightComments = new flightComments($flightID); $commentRow = $flightComments->getFirstFromDB(); $comment = leoHtml::cutString($commentRow['text'], 300); echo "<TR class='hr'><TD>" . _COMMENTS . "</td><td>" . $comment . "</td></tr>\n"; } echo "</table>"; // echo "</pre>"; } else { if ($op == 'sql') { $flight = new flight();
} else { if ($olcScoreType == "FREE_TRIANGLE") { $olcScoreTypeImg = "icon_triangle_free.gif"; } else { if ($olcScoreType == "FAI_TRIANGLE") { $olcScoreTypeImg = "icon_triangle_fai.gif"; } else { $olcScoreTypeImg = "photo_icon_blank.gif"; } } } $Ltemplate->assign_vars(array('MAX_DISTANCE' => formatDistanceOpen($flight->MAX_LINEAR_DISTANCE) . " ({$maxDistanceSpeed})", 'OLC_TYPE' => formatOLCScoreType($flight->BEST_FLIGHT_TYPE) . " " . leoHtml::img($olcScoreTypeImg, 0, 0, 'absmiddle', '', 'icons1'), 'OLC_KM' => formatDistanceOpen($flight->FLIGHT_KM) . " ({$olcDistanceSpeed})", 'OLC_SCORE' => formatOLCScore($flight->FLIGHT_POINTS), 'SCORE_INFO_LINK' => $showScoreInfo)); } else { $Ltemplate->assign_vars(array('MAX_DISTANCE' => 0, 'OLC_TYPE' => 0, 'OLC_KM' => 0, 'OLC_SCORE' => 0)); } $Ltemplate->assign_vars(array('MAX_SPEED' => formatSpeed($flight->MAX_SPEED), 'MAX_VARIO' => formatVario($flight->MAX_VARIO), 'MEAN_SPEED' => formatSpeed($flight->MEAN_SPEED), 'MIN_VARIO' => formatVario($flight->MIN_VARIO))); if ($flight->is3D()) { $Ltemplate->assign_vars(array('MAX_ALT' => formatAltitude($flight->MAX_ALT), 'TAKEOFF_ALT' => formatAltitude($flight->TAKEOFF_ALT), 'MIN_ALT' => formatAltitude($flight->MIN_ALT), 'ALTITUDE_GAIN' => formatAltitude($flight->MAX_ALT - $flight->TAKEOFF_ALT))); } else { $Ltemplate->assign_vars(array('MAX_ALT' => 0, 'TAKEOFF_ALT' => 0, 'MIN_ALT' => 0, 'ALTITUDE_GAIN' => 0)); } /* $flight->filename echo "<div id='geOptionsPos' style='float:right'>"; echo "<a href='javascript:nop()' onclick=\"toggleVisible('geOptionsID','geOptionsPos',14,-80,170,'auto');return false;\">Google Earth <img src='".$moduleRelPath."/img/icon_arrow_down.gif' border=0></a></div>"; */ if ($flight->comments) { $comments = $flight->comments; } $linkURL = _N_A; if ($flight->linkURL) { $linkURL = "<a href='" . formatURL($flight->linkURL, 0) . "' title='" . formatURL($flight->linkURL, 0) . "' target=_blank>" . formatURL($flight->linkURL, 15) . "</a>";
function kmlGetDescription($ext, $getFlightKML, $loadTrackLink = 0) { if ($this->takeoffVinicity > $takeoffRadious) { $location = getWaypointName($this->takeoffID, 0) . " [~" . sprintf("%.1f", $this->takeoffVinicity / 1000) . " km]"; } else { $location = getWaypointName($this->takeoffID, 0); } if ($this->landingVinicity > $landingRadious) { $location_land = getWaypointName($this->landingID, 0) . " [~" . sprintf("%.1f", $this->landingVinicity / 1000) . " km]"; } else { $location_land = getWaypointName($this->landingID, 0); } $fl_url = $this->getFlightLinkURL(); //$fl_url=str_replace("&","&",$this->getFlightLinkURL()); //$fl_url=str_replace(" "," ",$fl_url); $str = "<description><![CDATA[<table cellpadding=0 cellspacing=0>"; if ($loadTrackLink) { $str .= "<tr bgcolor='#D7E1EE'><td></td><td><div align='right'><a href='{$getFlightKML}'><b>Load Track</b></a></div></td></tr>"; } else { $str .= "<tr bgcolor='#D7E1EE'><td></td><td><div align='right'><a href='{$fl_url}'><b>" . _See_more_details . "</b></a></div></td></tr>"; } $str .= "<tr bgcolor='#CCCCCC'><td>" . _PILOT . "</td><td> " . htmlspecialchars($this->userName) . "</td></tr>" . "<tr><td>" . _TAKEOFF_LOCATION . "</td><td> " . $location . "</td></tr>" . "<tr bgcolor='#CCCCCC'><td>" . _TAKEOFF_TIME . "</td><td> " . formatDate($this->DATE, false) . " - " . sec2Time($this->START_TIME, 1) . "</td></tr>" . "<tr><td>" . _LANDING_LOCATION . "</td><td> " . $location_land . "</td></tr>" . "<tr bgcolor='#CCCCCC'><td>" . _OPEN_DISTANCE . "</td><td> " . formatDistance($this->LINEAR_DISTANCE, 1) . "</td></tr>" . "<tr><td>" . _DURATION . "</td><td> " . sec2Time($this->DURATION, 1) . "</td></tr>" . "<tr bgcolor='#CCCCCC'><td>" . _OLC_SCORE_TYPE . "</td><td> " . htmlspecialchars(formatOLCScoreType($this->BEST_FLIGHT_TYPE, false)) . "</td></tr>" . "<tr><td>" . _OLC_DISTANCE . "</td><td> " . formatDistance($this->FLIGHT_KM, 1) . "</td></tr>" . "<tr bgcolor='#CCCCCC'><td>" . _OLC_SCORING . "</td><td> " . sprintf("%.1f", $this->FLIGHT_POINTS) . "</td></tr>" . "<tr><td>" . _MAX_SPEED . "</td><td> " . formatSpeed($this->MAX_SPEED) . "</td></tr>" . "<tr bgcolor='#CCCCCC'><td>" . _MAX_VARIO . "</td><td> " . formatVario($this->MAX_VARIO) . "</td></tr>" . "<tr><td>" . _MIN_VARIO . "</td><td> " . formatVario($this->MIN_VARIO) . "</td></tr>" . "<tr bgcolor='#CCCCCC'><td>" . _MAX_ALTITUDE . "</td><td> " . formatAltitude($this->MAX_ALT) . "</td></tr>" . "<tr><td>" . _MIN_ALTITUDE . "</td><td> " . formatAltitude($this->MIN_ALT) . "</td></tr>" . "<tr bgcolor='#CCCCCC'><td>" . _TAKEOFF_ALTITUDE . "</td><td> " . formatAltitude($this->TAKEOFF_ALT) . "</td></tr>" . "<tr><td>" . _GLIDER . "</td><td>" . $this->glider . "</td></tr>" . "<tr bgcolor='#D7E1EE'><td></td><td><div align='right'>" . _KML_file_made_by . " <a href='http://www.leonardoxc.net'>Leonardo</a></div></td></tr>"; if ($ext) { $str .= "<tr bgcolor='#D7E1EE'><td></td><td><div align='right'>Extra analysis module by Man\\'s <a href='http://www.parawing.net'>GPS2GE V2.0</a></div></td></tr>"; } $str .= "<tr bgcolor='#D7E1EE'><td></td><td><div align='right'><a href='{$getFlightKML}&show_url=1'>URL of this KML file</div></td></tr>"; $str .= "</table>]]></description>"; return $str; }
} $olcScoreType = leoHtml::img($olcScoreTypeImg, 16, 16, 'top', formatOLCScoreType($olcScoreType, 0), 'icons1', '', 0); $gliderType = $row["cat"]; // 1=pg 2=hg flex 4=hg rigid 8=glider $gliderBrandImg = brands::getBrandImg($row["gliderBrandID"], $row['flight_glider'], $gliderType); $gliderTypeDesc = $gliderCatList[$row["cat"]]; if ($row["category"]) { $gliderTypeDesc .= " - " . $CONF['gliderClasses'][$row["cat"]]['classes'][$row["category"]]; $categoryImg = leoHtml::img("icon_class_" . $row["category"] . ".png", 0, 0, 'top', $gliderTypeDesc, 'icons1', '', 0); } else { $categoryImg = ''; } $gliderCat = leoHtml::img("icon_cat_" . $row["cat"] . ".png", 0, 0, 'top', $gliderTypeDesc, 'icons1 catListIcon', '', 0); $MAX_ALT = formatAltitude($row['MAX_ALT']); $MAX_VARIO = formatVario($row['MAX_VARIO']); $MIN_VARIO = formatVario($row['MIN_VARIO']); if ($singleFlight) { $flightID = $row['ID'] + 0; $flight = new flight(); $flight->getFlightFromDB($flightID, 0); //$flight->makeJSON(0); // no force $mapUrl = $flight->createStaticMap(0); } // $pref="http://xc.dhv.de/xc/modules/leonardo"; $pref = "http://" . $_SERVER['SERVER_NAME']; $JSON_str .= ' {"flightID": "' . $row["ID"] . '", "date": "' . json::prepStr($row["DATE"]) . '", ' . '"DURATION": "' . json::prepStr($duration) . '", ' . '"START_TIME": "' . json::prepStr($START_TIME) . '", ' . '"END_TIME": "' . json::prepStr($END_TIME) . '", ' . '"MAX_ALT": "' . json::prepStr($MAX_ALT) . '", ' . '"MAX_VARIO": "' . json::prepStr($MAX_VARIO) . '", '; '"MIN_VARIO": "' . json::prepStr($MIN_VARIO) . '", '; if ($singleFlight) { $JSON_str .= '"g1": "' . json::prepStr($pref . substr($flight->getChartRelPath('alt', 1, 0), 0)) . '", ' . '"g2": "' . json::prepStr($pref . substr($flight->getChartRelPath('vario', 1, 0), 0)) . '" , ' . '"g3": "' . json::prepStr($pref . substr($flight->getChartRelPath('speed', 1, 0), 0)) . '" , ' . '"g4": "' . json::prepStr($pref . substr($flight->getChartRelPath('takeoff_distance', 1, 0), 0)) . '" , ' . '"firstLat": "' . json::prepStr($row["firstLat"]) . '", ' . '"firstLon": "' . json::prepStr($row["firstLon"]) . '", ' . '"lastLat": "' . json::prepStr($row["lastLat"]) . '", ' . '"lastLon": "' . json::prepStr($row["lastLon"]) . '", ' . '"map": "' . json::prepStr($pref . substr($mapUrl, 0)) . '" , '; } $JSON_str .= '"linearDistance": "' . json::prepStr($linearDistance) . '", ' . '"olcDistance": "' . json::prepStr($olcDistance) . '", ' . '"olcScore": "' . json::prepStr($olcScore) . '", ' . '"scoreSpeed": "' . json::prepStr($scoreSpeed) . '", ' . '"olcScoreType": "' . json::prepStr($olcScoreType) . '", ' . '"glider": "' . json::prepStr($row['glider']) . '", ' . '"gliderBrandImg": "' . json::prepStr($gliderBrandImg) . '", ' . '"gliderCat": "' . json::prepStr($gliderCat) . '", ' . '"categoryImg": "' . json::prepStr($categoryImg) . '", ' . '"pilotName": "' . json::prepStr($name) . '", ' . '"takeoff": "' . json::prepStr($location) . '" } ';
} } $olcScoreType = leoHtml::img($olcScoreTypeImg, 16, 16, 'top', formatOLCScoreType($olcScoreType, 0), 'icons1'); $gliderType = $row["cat"]; // 1=pg 2=hg flex 4=hg rigid 8=glider $gliderBrandImg = brands::getBrandImg($row["gliderBrandID"], $row['flight_glider'], $gliderType); $gliderTypeDesc = $gliderCatList[$row["cat"]]; if ($row["category"]) { $gliderTypeDesc .= " - " . $CONF['gliderClasses'][$row["cat"]]['classes'][$row["category"]]; $categoryImg = leoHtml::img("icon_class_" . $row["category"] . ".png", 0, 0, 'top', $gliderTypeDesc, 'icons1', ''); } else { $categoryImg = ''; } $gliderCat = leoHtml::img("icon_cat_" . $row["cat"] . ".png", 0, 0, 'top', $gliderTypeDesc, 'icons1 catListIcon'); $MAX_ALT = formatAltitude($row['MAX_ALT']); $MAX_VARIO = formatVario($row['MAX_VARIO']); $JSON_str .= ' {"flightID": "' . $row["ID"] . '", "date": "' . json::prepStr($row["DATE"]) . '", ' . '"firstLat": "' . json::prepStr($row["firstLat"]) . '", ' . '"firstLon": "' . json::prepStr($row["firstLon"]) . '", ' . '"lastLat": "' . json::prepStr($row["lastLat"]) . '", ' . '"lastLon": "' . json::prepStr($row["lastLon"]) . '", ' . '"DURATION": "' . json::prepStr($duration) . '", ' . '"START_TIME": "' . json::prepStr($START_TIME) . '", ' . '"END_TIME": "' . json::prepStr($END_TIME) . '", ' . '"MAX_ALT": "' . json::prepStr($MAX_ALT) . '", ' . '"MAX_VARIO": "' . json::prepStr($MAX_VARIO) . '", ' . '"linearDistance": "' . json::prepStr($linearDistance) . '", ' . '"olcDistance": "' . json::prepStr($olcDistance) . '", ' . '"olcScore": "' . json::prepStr($olcScore) . '", ' . '"scoreSpeed": "' . json::prepStr($scoreSpeed) . '", ' . '"olcScoreType": "' . json::prepStr($olcScoreType) . '", ' . '"gliderBrandImg": "' . json::prepStr($gliderBrandImg) . '", ' . '"gliderCat": "' . json::prepStr($gliderCat) . '", ' . '"categoryImg": "' . json::prepStr($categoryImg) . '", ' . '"pilotName": "' . json::prepStr($name) . '", ' . '"takeoff": "' . json::prepStr($location) . '" } '; $i++; } //$JSON_str='{"totalCount":"'.$i.'","flights":[ '. $JSON_str." ] } "; $JSON_str = '{ "flights":[ ' . $JSON_str . " ] } "; if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2')) { header('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0'); } else { header('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); } header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Content-Type: text/html'); //$callbackFunction=$_GET['callback']; //echo $callbackFunction."(".$JSON_str.")";