$adminPanel="<b>"._TIMES_VIEWED.":</b> ".$flight->timesViewed."  ";
	$adminPanel.="<b>"._SUBMISION_DATE.":</b> ".$flight->dateAdded." :: ";

	//	$adminPanel.='<pre>'.processIGC($flight->getIGCFilename());

	// DEBUG TIMEZONE DETECTION 
	// $firstPoint=new gpsPoint($flight->FIRST_POINT);
	$firstPoint=new gpsPoint('',$flight->timezone);
	$firstPoint->setLat($flight->firstLat);
	$firstPoint->setLon($flight->firstLon);
	$firstPoint->gpsTime=$flight->firstPointTM;		
	
	//$time=substr($flight->FIRST_POINT,1,6);
	$time=date('H:i:s',$firstPoint->gpsTime);
	
	$zone= getUTMzoneLocal( $firstPoint->lon,$firstPoint->lat);
	$timezone1= ceil(-$firstPoint->lon / (180/12) );

	$timezone2=	 getTZ( $firstPoint->lat,$firstPoint->lon, $flight->DATE );

	$adminPanel.="<pre><b>UTM zone:</b> $zone ";
	$adminPanel.="<b>TZ (lat estimation):</b> $timezone1 ";
	$adminPanel.="<b>TZ (estimation 2):</b> $timezone2 ";
	$adminPanel.="<b>TZ (db):</b> ".$flight->timezone."\n";
	$adminPanel.="<b>First point time:</b> $time ";
	$adminPanel.="DATE : ".$flight->DATE." ";
	$adminPanel.='</pre>';

	// display the trunpoints
	//echo "<hr> ";
	//for($k=1;$k<=5;$k++) { $vn="turnpoint$k"; echo " ".$flight->$vn." <BR>"; }
Beispiel #2
0
function processIGC($filePath)
{
    global $takeoffRadious;
    //echo $filePath."<br>";
    //echo filesize( $filePath)."<br>";
    $lines = file($filePath);
    $points = 0;
    foreach ($lines as $line) {
        $line = trim($line);
        if (strlen($line) == 0) {
            continue;
        }
        if ($line[0] == 'B') {
            $firstPoint = new gpsPoint($line);
            //$res.=_TAKEOFF_COORDS." ";
            //$res.=$firstPoint->lat." ";
            //$res.=$firstPoint->lon."<br>";
            $time = substr($line, 1, 6);
            $zone = getUTMzoneLocal($firstPoint->lon, $firstPoint->lat);
            $timezone = ceil(-$firstPoint->lon / (180 / 12));
            $res .= "<b>UTM zone:</b> " . $zone . " ";
            $res .= "<b>Timezone:</b> " . $timezone . " <b>First point time:</b> {$time} ";
            break;
        }
    }
    return $res;
}