}
             }
         }
         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();
         $flight->getFlightFromDB($flightID);
require_once dirname(__FILE__) . "/FN_functions.php";
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);
}
Esempio n. 3
0
	$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,
	));
}