Exemplo n.º 1
0


  if (!$flight->active &&  (mktime() - datetime2UnixTimestamp($flight->dateAdded) > 5 ) )  {  //  5 secs
		$flight->activateFlight();
  } else if (!$flight->active) {
		open_tr();
		echo "<TD align=center>"._FLIGHT_WILL_BE_ACTIVATED_SOON."<a href=''>"._TRY_AGAIN."</a></td>";
  		close_tr(); 
		close_inner_table();  
		return;
  }

  if ($_REQUEST['updateMap']) $flight->getMapFromServer();		
  // if ($_REQUEST['updateMap3d']) $flight->getMapFromServer(1);		
  if ($_REQUEST['updateCharts']) $flight->updateCharts(1);		
  if ($_REQUEST['updateData'])  {
	$flight->getFlightFromIGC( $flight->getIGCFilename() );
	$flight->updateTakeoffLanding();

	$flight->createEncodedPolyline(1);
	$flight->makeJSON(1);

	$flight->putFlightToDB(1); // 1== UPDATE
  }
  $flight->checkDirs(); //Added 27.11.2011 for localhost installations P.Wild
  $flight->updateAll(0);
  //echo "START<br>";
  $location=formatLocation(getWaypointName($flight->takeoffID),$flight->takeoffVinicity,$takeoffRadious);

Exemplo n.º 2
0
    $flight->activateFlight();
} else {
    if (!$flight->active) {
        open_tr();
        echo "<TD align=center>" . _FLIGHT_WILL_BE_ACTIVATED_SOON . "<a href=''>" . _TRY_AGAIN . "</a></td>";
        close_tr();
        close_inner_table();
        return;
    }
}
if ($_REQUEST['updateMap']) {
    $flight->getMapFromServer();
}
// if ($_REQUEST['updateMap3d']) $flight->getMapFromServer(1);
if ($_REQUEST['updateCharts']) {
    $flight->updateCharts(1);
}
if ($_REQUEST['updateData']) {
    $flight->getFlightFromIGC($flight->getIGCFilename());
    $flight->updateTakeoffLanding();
    $flight->createEncodedPolyline(1);
    $flight->makeJSON(1);
    $flight->putFlightToDB(1);
    // 1== UPDATE
}
$flight->checkDirs();
//Added 27.11.2011 for localhost installations P.Wild
$flight->updateAll(0);
//echo "START<br>";
$location = formatLocation(getWaypointName($flight->takeoffID), $flight->takeoffVinicity, $takeoffRadious);
// $firstPoint=new gpsPoint($flight->FIRST_POINT,$flight->timezone);
require_once dirname(__FILE__) . "/config.php";
$CONF_use_utf = 1;
require_once dirname(__FILE__) . "/EXT_config.php";
require_once dirname(__FILE__) . "/CL_flightData.php";
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->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";
} else {
    if (is_file($flight->getChartfilename("takeoff_distance", $PREFS->metricSystem, 1))) {
        $chart1 = $flight->getChartRelPath("takeoff_distance", $PREFS->metricSystem, 1);
        $title1 = "Distance from takeoff";
    }
}
$hlines = $flight->getRawHeader();
foreach ($hlines as $line) {
    if (strlen($line) == 0) {
        continue;
    }