if ($flight->autoScore) {
    // means that there is manual optimization present
    if (!$valiStr) {
        $valiStr = " ";
    }
    $vStr = 'This flight was optimized manually.';
    $valiStr .= "<img class='listIcons' src='" . $moduleRelPath . "/img/icon_olc_manual.gif' align='absmiddle' title='{$vStr}' alt='{$vStr}' width='17' height='16' border='0' />";
    if ($flight->autoScore > $flight->FLIGHT_POINTS) {
        $vStr = "The manual optimization is worst than the auto optimization (Auto score:" . $flight->autoScore . ")";
        $valiStr .= "<img class='listIcons' src='" . $moduleRelPath . "/img/icon_att1.gif' align='absmiddle' title='{$vStr}' alt='{$vStr}' width='17' height='17' border='0' />";
    } else {
        $vStr = "The manual optimization is better than the auto optimization (Auto score:" . $flight->autoScore . ")";
        $valiStr .= "<img class='listIcons' src='" . $moduleRelPath . "/img/olc_icon_submited.gif' align='absmiddle' title='{$vStr}' alt='{$vStr}' width='16' height='16' border='0' />";
    }
}
DEBUG_END();
// flush debug here
$flightHours = $flight->DURATION / 3600;
if ($flightHours) {
    $openDistanceSpeed = formatSpeed($flight->LINEAR_DISTANCE / ($flightHours * 1000));
    $maxDistanceSpeed = formatSpeed($flight->MAX_LINEAR_DISTANCE / ($flightHours * 1000));
    $olcDistanceSpeed = formatSpeed($flight->FLIGHT_KM / ($flightHours * 1000));
} else {
    $openDistanceSpeed = 0;
    $maxDistanceSpeed = 0;
    $olcDistanceSpeed = 0;
}
$takeoffLink = "<div id='takeoffAddPos'><a href=\"javascript:takeoffTip.newTip('inline',0,13, 'takeoffAddPos', 250, '" . $flight->takeoffID . "','" . str_replace("'", "\\'", $location) . "'," . $firstPoint->lat . "," . $firstPoint->lon . ")\"  onmouseout=\"takeoffTip.hide()\">{$location}</a>";
if ($flight->takeoffVinicity > $takeoffRadious * 2) {
    $takeoffLink .= "<div id='attentionLinkPos' class='attentionLink'><a\n\t\t\t href=\"javascript:user_add_takeoff(" . $firstPoint->lat . "," . $firstPoint->lon . "," . $flight->takeoffID . ")\" \n\t\t\t onmouseover='unknownTakeoffTip.show(\"floating\")'  onmouseout='unknownTakeoffTip.hide()'><img\n\t\t\t src='{$moduleRelPath}/img/icon_att3.gif' border=0 align=absmiddle>" . _Unknown_takeoff . "<img \n\t\t\t src='{$moduleRelPath}/img/icon_att3.gif' border=0 align=absmiddle></a></div>";
}
  }

	if ($flight->autoScore) { // means that there is manual optimization present
		if (!$valiStr) $valiStr="&nbsp;";
		$vStr='This flight was optimized manually.';
		$valiStr.="<img class='listIcons' src='".$moduleRelPath."/img/icon_olc_manual.gif' align='absmiddle' title='$vStr' alt='$vStr' width='17' height='16' border='0' />";
		if ($flight->autoScore > $flight->FLIGHT_POINTS ) {
			$vStr="The manual optimization is worst than the auto optimization (Auto score:".$flight->autoScore.")";
			$valiStr.="<img class='listIcons' src='".$moduleRelPath."/img/icon_att1.gif' align='absmiddle' title='$vStr' alt='$vStr' width='17' height='17' border='0' />";				
		} else {
			$vStr="The manual optimization is better than the auto optimization (Auto score:".$flight->autoScore.")";
			$valiStr.="<img class='listIcons' src='".$moduleRelPath."/img/olc_icon_submited.gif' align='absmiddle' title='$vStr' alt='$vStr' width='16' height='16' border='0' />";
		}
	}
  
  DEBUG_END(); // flush debug here
	
	$flightHours=$flight->DURATION/3600;
	if ($flightHours) {
		$openDistanceSpeed=formatSpeed($flight->LINEAR_DISTANCE/($flightHours*1000));
		$maxDistanceSpeed=formatSpeed($flight->MAX_LINEAR_DISTANCE/($flightHours*1000));
		$olcDistanceSpeed=formatSpeed($flight->FLIGHT_KM/($flightHours*1000));
	} else {
		$openDistanceSpeed=0;
		$maxDistanceSpeed=0;
		$olcDistanceSpeed=0;	
	}
	

	$takeoffLink="<div id='takeoffAddPos'><a href=\"javascript:takeoffTip.newTip('inline',0,13, 'takeoffAddPos', 250, '".$flight->takeoffID."','".str_replace("'","\'",$location)."',".$firstPoint->lat.",".$firstPoint->lon.")\"  onmouseout=\"takeoffTip.hide()\">$location</a>";
		
Example #3
0
function exitPage($exitNow=1){
   global $opMode,$noFooterMenu,$moduleRelPath,$PREFS,$CONF_use_own_template,$CONF;
   global $sqlQueriesTime ,$sqlQueriesNum,$sqlFetchTime,$sqlFetchNum;
   global $pageStart,$DBGlvl;
   global $RUN;


   echo "<br>";
   if (!$noFooterMenu ) {
   	 if ($RUN['view']!='print') {
	 	echo "<br><div class='main_text' align=center><a href='#top_of_page'>"._RETURN_TO_TOP."</a></div>";
   	 }
   }
   echo "</div>";

   $pageEnd=leo_getmicrotime();
   $pageTime=$pageEnd-$pageStart;
   DEBUG("MAIN",1,"PAGE CREATION: $pageTime secs<BR>");
   DEBUG_END();


   require_once dirname(__FILE__)."/BLOCKS_end.php";
	
   if ($opMode==1) {
		CloseTable();
		include("footer.php");
   } else if (0 && ($opMode==3 || $opMode==4 || $opMode==6 || ($opMode==5 &&  $CONF_use_own_template ))  ) {
		require_once dirname(__FILE__)."/GUI_footer.php";
   }  else if ($opMode==3 || $opMode==4 || $opMode==6 || ($opMode==5 &&  $CONF_use_own_template ) ) {
	    global $Ltemplate;
		$Ltemplate->set_filenames(array('overall_footer' => 'tpl/overall_footer.html'));
		$Ltemplate->assign_vars(array(
			'SIDE_BLOCKS_HTML' => $side_blocks_html,
			'CUSTOM_FOOTER_CODE'=> 	$CONF['footer']['custom_code'],
		) );
		$Ltemplate->pparse('overall_footer');
		
		// Close our DB connection.
		//$db->sql_close();

   } 
	if ($DBGlvl) {
		// db execution time

		echo "<div class='debugBoxTop'>";
		printf("DB query: <b>%.4f</b> secs in %d queries <hr>",$sqlQueriesTime ,$sqlQueriesNum);

		printf("DB fetch: <b>%.4f</b> secs in %d fetches <hr>",$sqlFetchTime,$sqlFetchNum);
		printf("DB Total: <b>%.5f</b> secs<hr>",($sqlQueriesTime + $sqlFetchTime )) ;
		printf("Page Total: <b>%.5f</b> secs<hr>",$pageTime) ;
		echo "</div>";
		// end db
	}

   statsLogger::Log($pageTime);

   if ($exitNow) exit;
}