require_once dirname(__FILE__) . "/FN_waypoint.php"; require_once dirname(__FILE__) . "/FN_output.php"; require_once dirname(__FILE__) . "/FN_pilot.php"; // setDEBUGfromGET(); $flightID = makeSane($_GET['id'], 1); if ($flightID <= 0) { exit; } $flight = new flight(); $flight->getFlightFromDB($flightID, 0); $flight->makeJSON(0); // no force // we dont use png files any more //$flight->updateCharts(0,1); // no force update, raw charts if ($flight->is3D() && is_file($flight->getChartfilename("alt", $PREFS->metricSystem, 1))) { $chart1 = $flight->getChartRelPath("alt", $PREFS->metricSystem, 1); $title1 = _Altitude . ' (' . ($PREFS->metricSystem == 1 ? _M : _FT) . ')'; } else { if (is_file($flight->getChartfilename("takeoff_distance", $PREFS->metricSystem, 1))) { $chart1 = $flight->getChartRelPath("takeoff_distance", $PREFS->metricSystem, 1); $title1 = _Distance_from_takeoff . ' (' . ($PREFS->metricSystem == 1 ? _KM_PER_HR : _MPH) . ')'; } } $hlines = $flight->getRawHeader(); foreach ($hlines as $line) { if (strlen($line) == 0) { continue; } eval($line); } $START_TIME = $flight->START_TIME;
$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) . '" } '; $i++; } //$JSON_str='{"totalCount":"'.$i.'","flights":[ '. $JSON_str." ] } "; $JSON_str = '{ ' . ' "flights":[ ' . $JSON_str . ' ] } '; sendJson($JSON_str); } } } } } } } function sendJson($JSON_str)
} if ($localMap) { $mapImg .= "<div id='tabmap' class='tab_content'>{$localMap}</div>"; } if ($imagesHtml) { $mapImg .= "<div id='tabphotos' class='tab_content'>{$imagesHtml}</div>"; } // always include the comments tab $mapImg .= $commentsHtml; $mapImg .= "</div>"; if ($imagesHtml) { $mapImg .= "<script type='text/javascript' src='{$moduleRelPath}/js/xns.js'></script>"; } $mapImg = $mapImg0 . $mapImg; if ($flight->is3D() && is_file($flight->getChartfilename("alt", $PREFS->metricSystem))) { $chart1 = "<br><br><img src='" . $flight->getChartRelPath("alt", $PREFS->metricSystem) . "'>"; } if (is_file($flight->getChartfilename("takeoff_distance", $PREFS->metricSystem))) { $chart2 = "<br><br><img src='" . $flight->getChartRelPath("takeoff_distance", $PREFS->metricSystem) . "'>"; } if (is_file($flight->getChartfilename("speed", $PREFS->metricSystem))) { $chart3 = "<br><br><img src='" . $flight->getChartRelPath("speed", $PREFS->metricSystem) . "'>"; } if ($flight->is3D() && is_file($flight->getChartfilename("vario", $PREFS->metricSystem))) { $chart4 = "<br><br><img src='" . $flight->getChartRelPath("vario", $PREFS->metricSystem) . "'>"; } $extLinkLanguageStr = ""; if ($CONF['servers']['list'][$flight->serverID]['isLeo']) { $extLinkLanguageStr = "&lng={$currentlang}"; } $extFlightLegend = _Ext_text1 . " <i>" . $CONF['servers']['list'][$flight->serverID]['name'] . "</i>. <a href='" . $flight->getOriginalURL() . $extLinkLanguageStr . "' target='_blank'>" . _Ext_text3 . leoHtml::img('icon_link.gif', 0, 0, '', _External_Entry, 'icons1 flagIcon') . "</a>";
body, p, table,tr,td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} body {margin:0px; background-color:#E9E9E9} .box { background-color:#F4F0D5; border:1px solid #555555; padding:3px; margin-bottom:5px; } .boxTop {margin:0; } </style> </head> <?php $flight->updateCharts(1, 1); // force update, raw charts if ($flight->is3D() && is_file($flight->getChartfilename("alt", $PREFS->metricSystem, 1))) { $chart1 = $flight->getChartRelPath("alt", $PREFS->metricSystem, 1); } if (is_file($flight->getChartfilename("takeoff_distance", $PREFS->metricSystem, 1))) { $chart2 = $flight->getChartRelPath("takeoff_distance", $PREFS->metricSystem, 1); } if (is_file($flight->getChartfilename("speed", $PREFS->metricSystem, 1))) { $chart3 = $flight->getChartRelPath("speed", $PREFS->metricSystem, 1); } if ($flight->is3D() && is_file($flight->getChartfilename("vario", $PREFS->metricSystem))) { $chart4 = $flight->getChartRelPath("vario", $PREFS->metricSystem, 1); } if ($chart1) { // thereis altitude -> select alt, vario, and check for speed graph if present $img1 = $chart1; // alt $title1 = "Height";