<style type="text/css"> body, p, table,tr,td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} body {margin:0px} </style> <script language="javascript" src="<?php echo $moduleRelPath; ?> /js/DHTML_functions.js"></script> </head> <?php $waypointIDview = makeSane($_GET['wID'], 1); $wpInfo = new waypoint($waypointIDview); $wpInfo->getFromDB(); // $wpName= getWaypointName($waypointIDview); $wpName = selectWaypointName($wpInfo->name, $wpInfo->intName, $wpInfo->countryCode); $wpLocation = selectWaypointLocation($wpInfo->location, $wpInfo->intLocation, $wpInfo->countryCode); if (L_auth::isAdmin($userID)) { $opString = "<a href='" . getLeonardoLink(array('op' => 'edit_waypoint', 'waypointIDedit' => $waypointIDview)) . "'><img src='" . $moduleRelPath . "/img/change_icon.png' border=0 align=bottom></a>"; } $titleString = _Waypoint_Name . " : " . $wpName . " (" . $countries[$wpInfo->countryCode] . ") "; //$opString="<a href='#' onclick=\"toggleVisible('takeoffID','takeoffPos',14,-20,0,0);return false;\"> //<img src='".$moduleRelPath."/templates/".$PREFS->themeName."/img/exit.png' border=0></a>"; open_inner_table("<table class=main_text width=100% cellpadding=0 cellspacing=0><tr><td>" . $titleString . "</td><td align=right width=50><div align=right>" . $opString . "</div></td></tr></table>", 705, "icon_pin.png"); open_tr(); echo "<td>"; ?> <style type="text/css"> <!-- .style1 {font-weight: bold} -->
function makeWaypointPlacemark($waypointID, $returnCountryCode = 0, $includeStyle = 1, $includeLookat = 1, $styleUrl = '') { global $db, $waypointsTable; global $flightsTable, $countries, $CONF_mainfile, $moduleRelPath; $wpInfo = new waypoint($waypointID); $wpInfo->getFromDB(); $wpName = selectWaypointName($wpInfo->name, $wpInfo->intName, $wpInfo->countryCode); $wpLocation = selectWaypointLocation($wpInfo->location, $wpInfo->intLocation, $wpInfo->countryCode); $query = "SELECT MAX(MAX_LINEAR_DISTANCE) as record_km, ID FROM {$flightsTable} WHERE takeoffID =" . $waypointID . " GROUP BY ID ORDER BY record_km DESC "; $flightNum = 0; $res = $db->sql_query($query); if ($res > 0) { $flightNum = mysql_num_rows($res); $row = $db->sql_fetchrow($res); $siteRecordLink = "<a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['ID'])) . "'>" . formatDistance($row['record_km'], 1) . "</a>"; } else { $siteRecordLink = ""; } $pointFlightsLink = "<a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'list_flights', 'takeoffID' => $waypointID, 'year' => '0', 'season' => '0')) . "'>" . _See_flights_near_this_point . " [ " . $flightNum . " ]</a>"; $countryFlightsLink = "<a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'list_flights', 'takeoffID' => '0', 'year' => '0', 'season' => '0', 'country' => $wpInfo->countryCode)) . "'>" . $countries[$wpInfo->countryCode] . "</a>"; if ($wpInfo->link) { $siteLink = '<a href="' . formatURL($wpInfo->link) . '" target="_blank">' . formatURL($wpInfo->link) . '</a>'; } else { $siteLink = "-"; } // "<?xml version='1.0' encoding='".$langEncodings[$currentlang]."'? > // <?xml version="1.0" encoding="UTF-8"? > $xml_text = '<Placemark> <name><![CDATA[' . $wpName . ' ]]></name> <description><![CDATA[<table cellpadding=0 cellspacing=0 width=300>' . '<tr bgcolor="#D7E1EE"><td>' . _SITE_REGION . ': ' . $wpLocation . ' - ' . $countryFlightsLink . '</td></tr>' . '<tr bgcolor="#CCCCCC"><td>' . $pointFlightsLink . '</td></tr>' . '<tr ><td>' . _SITE_RECORD . ' : ' . $siteRecordLink . '</td></tr>' . '<tr bgcolor="#CCCCCC"><td>' . _SITE_LINK . ' : ' . $siteLink . '</td></tr>' . '<tr ><td>' . $wpInfo->description . '</td></tr>' . '<tr ><td></td></tr>' . '</table> ]]> </description>'; if ($includeLookat) { $xml_text .= ' <LookAt> <longitude>' . -$wpInfo->lon . '</longitude> <latitude>' . $wpInfo->lat . '</latitude> <range>10000</range> <tilt>0</tilt> <heading>0</heading> </LookAt> '; } if ($includeStyle) { $xml_text .= ' <styleUrl>root://styleMaps#default+nicon=0x307+hicon=0x317</styleUrl> <Style> <IconStyle> <scale>0.8</scale> <Icon> <href>root://icons/palette-4.png</href> <x>160</x> <y>128</y> <w>32</w> <h>32</h> </Icon> </IconStyle> <LabelStyle> <scale>0.8</scale> </LabelStyle> </Style> '; } if ($styleUrl) { $xml_text .= "<styleUrl>{$styleUrl}</styleUrl>\n"; } $xml_text .= ' <Point> <coordinates>' . -$wpInfo->lon . ',' . $wpInfo->lat . ',0</coordinates> </Point> </Placemark>'; if ($returnCountryCode) { return array($xml_text, $wpInfo->countryCode); } else { return $xml_text; } }