function flights_find($arg) { global $db, $flightsTable; global $takeoffRadious, $CONF; require_once "FN_pilot.php"; $sitePass = $arg[0]; $lat = $arg[1]; $lon = -$arg[2]; $limit = $arg[3]; if (!securityCheck($sitePass)) { return new IXR_Error(4000, 'Access Denied'); } $firstPoint = new gpsPoint(); $firstPoint->lat = $lat; $firstPoint->lon = $lon; // calc TAKEOFF - LANDING PLACES if (count($waypoints) == 0) { $waypoints = getWaypoints(0, 1); } $takeoffIDTmp = 0; $minTakeoffDistance = 10000000; $i = 0; foreach ($waypoints as $waypoint) { $takeoff_distance = $firstPoint->calcDistance($waypoint); if ($takeoff_distance < $minTakeoffDistance) { $minTakeoffDistance = $takeoff_distance; $takeoffIDTmp = $waypoint->waypointID; } $i++; } $nearestWaypoint = new waypoint($takeoffIDTmp); $nearestWaypoint->getFromDB(); //$nearestWaypoint; //$minTakeoffDistance; if ($limit > 0) { $lim = "LIMIT {$limit}"; } else { $lim = ""; } $where_clause = "AND takeoffID={$nearestWaypoint->waypointID}"; $query = "SELECT * FROM {$flightsTable} WHERE private=0 {$where_clause} ORDER BY FLIGHT_POINTS DESC {$lim} "; //echo $query; $res = $db->sql_query($query); if ($res <= 0) { return new IXR_Error(4000, 'Error in query! ' . $query); } $flights = array(); $i = 0; while ($row = mysql_fetch_assoc($res)) { $name = getPilotRealName($row["userID"], $row["serverID"]); $link = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['ID']))); $this_year = substr($row['DATE'], 0, 4); $linkIGC = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . getRelMainDir() . str_replace("%PILOTID%", getPilotID($row["userServerID"], $row["userID"]), str_replace("%YEAR%", $this_year, $CONF['paths']['igc'])) . '/' . $row['filename']); //$flightsRelPath."/".$row[userID]."/flights/".$this_year."/".$row[filename] ); if ($row['takeoffVinicity'] > $takeoffRadious) { $location = getWaypointName($row['takeoffID']) . " [~" . sprintf("%.1f", $row['takeoffVinicity'] / 1000) . " km]"; } else { $location = getWaypointName($row['takeoffID']); } $flights[$i]['pilot'] = htmlspecialchars($name); $flights[$i]['takeoff'] = htmlspecialchars($location); $flights[$i]['date'] = $row['DATE']; $flights[$i]['duration'] = $row['DURATION']; $flights[$i]['openDistance'] = $row['MAX_LINEAR_DISTANCE']; $flights[$i]['OLCkm'] = $row['FLIGHT_KM']; $flights[$i]['OLCScore'] = $row['FLIGHT_POINTS']; $flights[$i]['OLCtype'] = $row['BEST_FLIGHT_TYPE']; $flights[$i]['displayLink'] = $link; $i++; } return array($i, $flights); //return array($i,0); }
"></p></form></td> </tr> </table> <?php } else { ?> <p align="center"><span class="style111"><font face="Verdana, Arial, Helvetica, sans-serif"><?php echo _YOUR_FLIGHT_HAS_BEEN_SUBMITTED; ?> </font></span> <br> <br> <a href="<?php echo getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)); ?> "><?php echo _PRESS_HERE_TO_VIEW_IT; ?> </a><br> <em><?php echo _WILL_BE_ACTIVATED_SOON; ?> </em> <hr> <?php } } } closeMain();
if (!strpos($filter_clause, $pilotsTable) === false) { $extra_tbl .= " LEFT JOIN {$pilotsTable} ON \n\t\t\t\t\t\t({$flightsTable}.userID={$pilotsTable}.pilotID AND \n\t\t\t\t\t\t{$flightsTable}.userServerID={$pilotsTable}.serverID) "; } } $query = "SELECT * FROM {$flightsTable} {$extra_tbl} WHERE \n\t\t\t\t firstLat>={$south} && firstLat<={$north} && \n\t\t\t\t firstLon>={$west} && firstLon<={$east} {$filter_clause}\n\t\t\t\t ORDER BY FLIGHT_POINTS DESC LIMIT 100 "; //echo $query; $res = $db->sql_query($query); if ($res <= 0) { echo "<H3> Error in query! {$query} </H3>\n"; exit; } $i = 0; $str = ''; while ($row = mysql_fetch_assoc($res)) { $name = getPilotRealName($row["userID"], $row["userServerID"], 0, 0, 0); $link = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['ID']))); $this_year = substr($row[DATE], 0, 4); $linkIGC = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . getRelMainDir() . str_replace("%PILOTID%", getPilotID($row["userServerID"], $row["userID"]), str_replace("%YEAR%", $this_year, $CONF['paths']['igc'])) . '/' . $row['filename']); //$flightsRelPath."/".$row[userID]."/flights/".$this_year."/".$row[filename] ); if ($row['takeoffVinicity'] > $takeoffRadious) { $location = getWaypointName($row['takeoffID']) . " [~" . sprintf("%.1f", $row['takeoffVinicity'] / 1000) . " km]"; } else { $location = getWaypointName($row['takeoffID']); } $flight = new flight(); $flight->getFlightFromDB($row['ID'], 0, $row); $extendedInfo = 0; $lineColor = "ff0000"; $exaggeration = 1; $lineWidth = 2; $getFlightKML = $flight->getFlightKML() . "&c={$lineColor}&w={$lineWidth}&an={$extendedInfo}";
map.enableScrollWheelZoom(); map.setCenter (new GLatLng(lat,lon), 8, <?php echo $GMapType; ?> ); //---------------------------------------------------------------------- // Dynamic load of flight tracks //---------------------------------------------------------------------- var flightLinkTemplate="<a href='<?php echo htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => 'xxx'))); ?> ' target='_top'><?php echo _See_more_details; ?> </a>"; function createFlightMarker(point, id , pilotName) { var marker = new GMarker(point,flightTakeoffIcon); var flightLink=flightLinkTemplate.replace("xxx",id); GEvent.addListener(marker, "click", function() { loadFlightTrack(id,point); flightMarkers[id].openInfoWindowHtml("<img src='img/ajax-loader.gif'>"); $.ajax({ url: 'GUI_EXT_flight_info.php?op=info_short&flightID='+id, dataType: 'html', success: function(data) {
function listFlights($res, $legend, $queryExtraArray = array(), $sortOrder = "DATE") { global $db, $Theme; global $takeoffRadious; global $userID, $serverID; global $NACclubID; global $clubID, $clubFlights, $clubsList, $add_remove_mode; global $moduleRelPath; global $PREFS, $CONF; global $page_num, $pagesNum, $startNum, $itemsNum; global $currentlang, $nativeLanguage, $opMode; global $CONF_photosPerFlight, $CONF_use_validation, $CONF_airspaceChecks; global $CONF_new_flights_days_threshold; global $gliderCatList; $clubIcon = "<img src='" . $moduleRelPath . "/img/icon_club_small.gif' width=12 height=12 border=0 align='absmiddle' >"; $removeFromClubIcon = "<img src='" . $moduleRelPath . "/img/icon_club_remove.gif' width=22 height=12 border=0 align='absmiddle' title='Remove flight from this league'>"; $addToClubIcon = "<img src='" . $moduleRelPath . "/img/icon_club_add.gif' width=12 height=12 border=0 align='absmiddle' title='Add flight to this league'>"; if ($clubID && (L_auth::isClubAdmin($userID, $clubID) || L_auth::isAdmin($userID))) { ?> <script language="javascript"> function addClubFlight(clubID,flightID) { $("#updateDiv").load('<?php echo $moduleRelPath; ?> /EXT_club_functions.php?op=add&clubID='+clubID+'&flightID='+flightID); $('#fl_'+flightID).html("<a href=\"#\" onclick=\"removeClubFlight("+clubID+","+flightID+");return false;\"><?php echo $removeFromClubIcon; ?> </a>"); } function removeClubFlight(clubID,flightID) { $("#updateDiv").load('<?php echo $moduleRelPath; ?> /EXT_club_functions.php?op=remove&clubID='+clubID+'&flightID='+flightID); $('#fl_'+flightID).html("<a href=\"#\" onclick=\"addClubFlight("+clubID+","+flightID+");return false;\"><?php echo $addToClubIcon; ?> </a>"); } </script> <?php echo "<div class='tableInfo shadowBox'>You can administer this club "; if ($clubsList[$clubID]['addManual']) { if ($add_remove_mode) { $queryExtraArray['admClub'] = '0'; echo "<a href='" . getLeonardoLink(array('op' => 'list_flights', 'sortOrder' => $sortOrder) + $queryExtraArray) . "'>Return to normal view</a>"; } else { $queryExtraArray['admClub'] = '1'; echo "<a href='" . getLeonardoLink(array('op' => 'list_flights', 'sortOrder' => $sortOrder) + $queryExtraArray) . "'>Add / remove flights</a>"; } } echo "<div id='updateDiv' style='display:block'></div>"; echo "</div>"; } ?> <table class='listTable' style='clear:both' width="100%" cellpadding="2" cellspacing="0"> <tr> <td class='SortHeader indexCell' width="25"><?php echo _NUM; ?> </td> <?php printHeader(60, $sortOrder, "DATE", _DATE_SORT, $queryExtraArray); printHeader(160, $sortOrder, "pilotName", _PILOT, $queryExtraArray); printHeader(0, $sortOrder, "takeoffID", _TAKEOFF, $queryExtraArray); printHeader(40, $sortOrder, "DURATION", _DURATION_HOURS_MIN, $queryExtraArray); if ($CONF['list_flights']['fields']['scoring'][0] == 'LINEAR_DISTANCE') { printHeader(60, $sortOrder, "LINEAR_DISTANCE", _LINEAR_DISTANCE, $queryExtraArray); } else { printHeader(60, $sortOrder, "SCORE_SPEED", _MEAN_SPEED1, $queryExtraArray); } printHeader(60, $sortOrder, "FLIGHT_KM", _OLC_KM, $queryExtraArray); printHeader(65, $sortOrder, "FLIGHT_POINTS", _OLC_SCORE, $queryExtraArray); ?> <td width="18" class='SortHeader'> </td> <td width="50" class='SortHeader'> </td> <td width="70" class='SortHeader displayCell alLeft'><?php echo _SHOW; ?> </td> </tr> <?php $i = 1; $currDate = ""; while ($row = $db->sql_fetchrow($res)) { $is_private = $row["private"]; $flightID = $row['ID']; if ($pilotNames[$row["userServerID"] . '_' . $row["userID"]]) { $name = $pilotNames[$row["userServerID"] . '_' . $row["userID"]]; } else { $name = getPilotRealName($row["userID"], $row["userServerID"], 1); $pilotNames[$row["userServerID"] . '_' . $row["userID"]] = $name; } $name = prepare_for_js($name); if ($takeoffNames[$row["flight_takeoffID"]]) { $takeoffName = $takeoffNames[$row["flight_takeoffID"]]; } else { $takeoffName = prepare_for_js(getWaypointName($row["flight_takeoffID"], -1, 0, 20)); $takeoffNames[$row["flight_takeoffID"]] = $takeoffName; } $takeoffVinicity = $row["takeoffVinicity"]; $takeoffNameFrm = formatLocation($takeoffName, $takeoffVinicity, $takeoffRadious); $sortRowClass = $i % 2 ? "l_row1" : "l_row2"; $i++; $days_from_submission = floor((mktime() - datetime2UnixTimestamp($row["dateAdded"])) / 86400); // 60*60*24 sec per day if (!$is_private) { $privateIcon = ' '; } else { $privateIcon = ''; if ($is_private & 0x1) { $privateIcon .= "<img src='" . $moduleRelPath . "/img/icon_private.gif' align='absmiddle' width='13' height='13'>"; } if ($is_private & 0x2) { $privateIcon .= "<img src='" . $moduleRelPath . "/img/icon_disabled.gif' align='absmiddle' width='13' height='13'>"; } if ($is_private & 0x4) { $privateIcon .= "<img src='" . $moduleRelPath . "/img/locked.gif' align='absmiddle' width='13' height='13'>"; } } if ($row["DATE"] != $currDate || $sortOrder != 'DATE') { $currDate = $row["DATE"]; $dateStr = formatDate($row["DATE"]); $rowStr = " newDate "; } else { $dateStr = "<span class='dateHidden'>" . formatDate($row["DATE"]) . "</span>"; $rowStr = ""; } $date2row = ""; if ($days_from_submission <= $CONF_new_flights_days_threshold) { $newSubmissionStr = _SUBMIT_FLIGHT . ': ' . $row["dateAdded"] . ' GMT'; $date2row .= leoHtml::img("icon_new.png", 25, 12, 'absmiddle', $newSubmissionStr, 'icons1'); } if ($row['excludeFrom'] & 0x1) { $date2row .= "*"; } //$extLinkImgStr=getExternalLinkIconStr($row["serverID"],$row["originalURL"],3); //if ($extLinkImgStr) $extLinkImgStr="<a href='".$row["originalURL"]."' target='_blank'>$extLinkImgStr</a>"; $date2row .= $extLinkImgStr; if ($date2row == '') { $date2row .= ' '; } echo "\n\n<tr class='{$sortRowClass} {$rowStr}' id='row_{$flightID}'>\n"; $duration = sec2Time($row['DURATION'], 1); $linearDistance = formatDistanceOpen($row["LINEAR_DISTANCE"]); $olcDistance = formatDistanceOpen($row["FLIGHT_KM"]); $olcScore = formatOLCScore($row["FLIGHT_POINTS"]); $gliderType = $row["cat"]; // 1=pg 2=hg flex 4=hg rigid 8=glider # Martin Jursa 20.05.2007 $scoreSpeed = formatSpeed($row["SCORE_SPEED"]); // get the OLC score type $olcScoreType = $row['BEST_FLIGHT_TYPE']; if ($olcScoreType == "FREE_FLIGHT") { $olcScoreTypeImg = "icon_turnpoints.gif"; } else { if ($olcScoreType == "FREE_TRIANGLE") { $olcScoreTypeImg = "icon_triangle_free.gif"; } else { if ($olcScoreType == "FAI_TRIANGLE") { $olcScoreTypeImg = "icon_triangle_fai.gif"; } else { $olcScoreTypeImg = "photo_icon_blank.gif"; } } } $gliderBrandImg = brands::getBrandImg($row["gliderBrandID"], $row['flight_glider'], $gliderType); echo "\n<TD {$first_col_back_color} class='indexCell'><div>" . ($i - 1 + $startNum) . "</div>{$privateIcon}</TD>"; echo "<TD class='dateString' valign='top'><div>{$dateStr}</div>{$date2row}"; if ((L_auth::isClubAdmin($userID, $clubID) || L_auth::isAdmin($userID)) && $add_remove_mode) { // echo "<BR>"; if (in_array($flightID, $clubFlights)) { echo "<div id='fl_{$flightID}' style='display:inline;margin:0px;padding:0px'><a href=\"#\" onclick=\"removeClubFlight({$clubID},{$flightID});return false;\">{$removeFromClubIcon}</a></div>"; } else { echo "<div id='fl_{$flightID}' style='display:inline'><a href=\"#\" onclick=\"addClubFlight({$clubID},{$flightID});return false;\">{$addToClubIcon}</a></div>"; } } echo "</TD>"; echo "<TD class='pilotTakeoffCell' colspan=2 " . $sortArrayStr["pilotName"] . $sortArrayStr["takeoffID"] . ">" . "<div id='p_{$i}' class='pilotLink'>"; //echo "<span class='fl sprite-gr'></span>"; //echo getNationalityDescription($row["pilotCountryCode"],1,0); $thisPilot = new pilot($row["userServerID"], $row["userID"]); if ($thisPilot->isPilotLocal() || L_auth::isAdmin($userID)) { echo " <a href=\"javascript:pilotTip.newTip('inline', 0, 13, 'p_{$i}', 250, '" . $row["userServerID"] . "_" . $row["userID"] . "','" . addslashes($name) . "' )\" onmouseout=\"pilotTip.hide()\">{$name}</a>\n"; } else { echo " <a href=\"javascript:pilotTipExt.newTip('inline', 0, 13, 'p_{$i}', 200, '" . $row["userServerID"] . "_" . $row["userID"] . "','" . addslashes($name) . "' )\" onmouseout=\"pilotTip.hide()\">{$name}</a>\n"; } echo "</div>"; echo "<div id='at_{$i}' class='takeoffLink'>"; echo "<a id='t_{$i}' href=\"javascript:takeoffTip.newTip('inline',-25, 13,'t_{$i}', 250, '" . $row["takeoffID"] . "','" . addslashes($takeoffName) . "')\" onmouseout=\"takeoffTip.hide()\">{$takeoffNameFrm}</a>\n"; echo "</div></TD>" . "<TD>{$duration}</TD>"; if ($CONF['list_flights']['fields']['scoring'][0] == 'LINEAR_DISTANCE') { echo "<TD class='distance'>{$linearDistance}</TD>"; } else { echo "<TD class='speed'>{$scoreSpeed}</TD>"; } echo "<TD class='distance'>{$olcDistance}</TD>"; //P. Wild 22.03.2011 - Deutschland Flüge Fett hervorheben, Admin Farbkennzeichnung Luftraum $tmpairspaceName = $row['airspaceCheckMsg']; if (strrchr($tmpairspaceName, "Punkte")) { echo "<TD nowrap class='OLCScore'><b>{$olcScore}</b> " . leoHtml::img($olcScoreTypeImg, 16, 16, 'top', formatOLCScoreType($olcScoreType, 0), 'icons1'); } else { echo "<TD nowrap class='OLCScore'>{$olcScore} " . leoHtml::img($olcScoreTypeImg, 16, 16, 'top', formatOLCScoreType($olcScoreType, 0), 'icons1'); } if ($CONF_use_validation) { $isValidated = $row['validated']; if ($isValidated == -1) { $vImg = "icon_valid_nok.gif"; } else { if ($isValidated == 0) { $vImg = "icon_valid_unknown.gif"; } else { if ($isValidated == 1) { $vImg = "icon_valid_ok.gif"; } } } $valStr = leoHtml::img($vImg, 12, 12, '', '', 'icons1 listIcons'); echo $valStr; } echo "</TD>"; echo "<TD><div class='catInfo'>"; $gliderTypeDesc = $gliderCatList[$row["cat"]]; if ($row["category"]) { $gliderTypeDesc .= " - " . $CONF['gliderClasses'][$row["cat"]]['classes'][$row["category"]]; $categoryImg = "<div class='categoryListIconDiv'>" . leoHtml::img("icon_class_" . $row["category"] . ".png", 0, 0, 'top', $gliderTypeDesc, 'icons1', '') . "</div>"; } else { $categoryImg = ''; } echo leoHtml::img("icon_cat_" . $row["cat"] . ".png", 0, 0, 'top', $gliderTypeDesc, 'icons1 catListIcon') . $categoryImg; echo "</div></td>\n\t<TD><div align='center'>{$gliderBrandImg}</div></td>"; if (L_auth::airspaceVisible($userID, $row["userID"], $row["userServerID"])) { /* $CONF_airspaceChecks && ( L_auth::isAdmin($userID) || $CONF['airspace']['view']=='public' || ( $CONF['airspace']['view']=='registered' && $userID >0 ) || ( $CONF['airspace']['view']=='own' && $userID == $row["userID"] && $row["userServerID"]==$serverID ) ) ) {*/ if ($row['airspaceCheckFinal'] == -1) { //original: $airspaceProblem=' bgcolor=#F7E5C9 '; # peter Wild hack taking into account the deutschlandpokal-hack $tmpairspaceName = $row['airspaceCheckMsg']; if (strrchr($tmpairspaceName, "Punkte")) { $airspaceProblem = ' bgcolor=#009cff '; //Blue if (strpos($tmpairspaceName, "HorDist")) { $airspaceProblem = ' bgcolor=#FFFF00 '; //Yellow } //mod.31.12.08 different colours for bad infringements. P. Wild if (strpos($tmpairspaceName, 'CLASSC') !== false) { $airspaceProblem = ' bgcolor=#FF0008 '; //Red } if (strpos($tmpairspaceName, 'CLASSD') !== false) { $airspaceProblem = ' bgcolor=#FF0008 '; } } else { $airspaceColor = ''; foreach ($CONF['aispace']['list']['colors'] as $className => $classColor) { if (strpos($tmpairspaceName, $className) !== false) { $airspaceColor = $classColor; break; } } if (!$airspaceColor) { $airspaceColor = $CONF['aispace']['list']['colors']['ALLOTHER']; } $airspaceProblem = " bgcolor=#{$airspaceColor} "; } # end hack } else { $airspaceProblem = ''; } } $isExternalFlight = $row['externalFlightType']; echo "<TD {$airspaceProblem} align=left valign='top'>"; echo "<div class='smallInfo'>"; if ($isExternalFlight == 0 || $isExternalFlight == 2 || $CONF['servers']['list'][$row['serverID']]['treat_flights_as_local']) { // add class='betterTip' for tooltip $flightLinkUrl = getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row["ID"])); global $deletedFlights; if ($deletedFlights) { $flightLinkUrl .= "&deleted=1"; } echo "<a class='flightLink' id='tpa3_{$flightID}' href='" . $flightLinkUrl . "'>" . leoHtml::img("icon_look.gif", 0, 0, 'top', _SHOW, 'icons1 flightIcon', '', 1) . "</a>"; echo "<a href='javascript:nop()' onclick=\"geTip.newTip('inline', -315, -5, 'ge_{$i}', 300, '" . $row["ID"] . "' , '{$currentlang}')\" onmouseout=\"geTip.hide()\">" . leoHtml::img("geicon.gif", 0, 0, 'top', _Navigate_with_Google_Earth, 'icons1 geIcon', 'ge_' . $i) . "</a>"; } else { echo "<a class='flightLink' href='" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row["ID"])) . "'>" . leoHtml::img("icon_look.gif", 0, 0, 'top', _SHOW, 'icons1 flightIcon') . "</a>"; $originalKML = $row["originalKML"]; global $CONF; if ($CONF['servers']['list'][$row["serverID"]]['isLeo'] == 1) { if ($row["original_ID"]) { $originalKML = 'http://' . $CONF['servers']['list'][$row["serverID"]]['url_base'] . '/download.php?type=kml_trk&flightID=' . $row["original_ID"]; } } if ($originalKML) { echo "<a href='" . $originalKML . "'>" . leoHtml::img("geicon.gif", 0, 0, 'top', _Navigate_with_Google_Earth, 'icons1 geIcon') . "</a>"; } else { echo leoHtml::img("photo_icon_blank.gif", 16, 16, '', '', 'icons1 geIcon'); } } $photosNum = $row["hasPhotos"]; if ($photosNum) { echo "<span><a class='betterTip2' id='tpa1_{$flightID}' href='javascript:nop();'>" . leoHtml::img("icon_camera.gif", 0, 0, '', $photosNum . ' ' . _PHOTOS, 'icons1 photoIcon2') . "</a></span>"; } if ($row["commentsNum"] > 0) { $hasComments = 1; if ($row["commentsNum"] > 1) { $commentsImgName = "icon_comments_many.gif"; } else { $commentsImgName = "icon_comments.gif"; } } else { $hasComments = 0; } if ($hasComments) { echo "<a class='betterTip' id='tpa2_{$flightID}' href='javascript:nop();'>" . leoHtml::img($commentsImgName, 0, 0, '', $row["commentsNum"] . ' ' . _COMMENTS, 'icons1 commentDiv', '', 1) . "</a>"; } if (1) { echo "<span class='preview'><a class='betterTip' id='tpa0_{$flightID}' href='javascript:nop()'>" . leoHtml::img("icon_info.gif", 0, 0, 'top', _SHOW, 'icons1 previewDiv', '', 1) . "</a></span>"; } if ($isExternalFlight && !$CONF['servers']['list'][$row['serverID']]['treat_flights_as_local']) { $extServerStr = $CONF['servers']['list'][$row['serverID']]['name']; $extServerStrShort = $CONF['servers']['list'][$row['serverID']]['short_name']; if ($isExternalFlight == 2) { echo leoHtml::img("icon_link_dark.gif", 0, 0, '', _External_Entry . ": {$extServerStr}", 'icons1 extLink'); echo "<div class='extLinkName'>{$extServerStrShort}</div>"; } else { if ($CONF['servers']['list'][$row['serverID']]['isLeo']) { $url_flight = $CONF['servers']['list'][$row['serverID']]['url_flight']; if ($url_flight) { $extFlightLink = 'http://' . str_replace("%FLIGHT_ID%", $row['original_ID'], $url_flight) . "&lng={$currentlang}"; } else { $extFlightLink = 'http://' . $CONF['servers']['list'][$row['serverID']]['url'] . '&op=show_flight&flightID=' . $row['original_ID'] . "&lng={$currentlang}"; } } else { $extFlightLink = $row['originalURL']; } echo "<a href='{$extFlightLink}' target='_blank' class='extLinkDiv' title='{$extServerStr}: " . _Ext_text2 . "' >"; // also put the direct link in the place of the photo echo "<img class='extServerLogo' src='" . $moduleRelPath . "/img/servers/" . sprintf("%03d", $row['serverID']) . ".gif' width='16' height='16' border='0'/>"; echo leoHtml::img("icon_link_dark.gif", 0, 0, '', '', 'icons1 extLinkIcon'); echo "<div class='extLinkDescr'>{$extServerStrShort}</div>"; //echo "<span class='extLinkDescr'>$extServerStrShort</span>"; echo "</a>"; } } # P.Wild, martin jursa: considering $CONF_new_flights_days_threshold global $CONF_new_flights_submit_window; //P. Wild - edited to submit window (old version false) $inWindow = empty($CONF_new_flights_submit_window) ? true : $days_from_submission <= $CONF_new_flights_submit_window; if ($row["userID"] == $userID && $inWindow || L_auth::isAdmin($userID)) { echo "<div id='ac_{$i}' class='actionLink'>"; echo "<a href=\"javascript:flightActionTip.newTip('inline', -100, 13, 'ac_{$i}', 120, " . $row["ID"] . " )\" onmouseout=\"flightActionTip.hide()\">" . leoHtml::img("icon_action_select.gif", 0, 0, 'bottom', '', 'icons1') . "</a>"; echo "</div>"; } $checkedByStr = ''; if ($row['checkedBy'] && L_auth::isAdmin($userID)) { $checkedByArray = explode(" ", $row['checkedBy']); $checkedByStr = "<div class='checkedBy' align=right>" . $checkedByArray[0] . "</div>"; echo $checkedByStr; } echo "</div>"; echo "</TD>\n"; echo "</TR>"; } echo "</table>\n\n"; $db->sql_freeresult($res); }
</select> <input type="button" name="SubmitButton" id="SubmitButton" onclick='addTakeoffToArea()' value="Add takeoff to Area" /> <input type="hidden" name="addTakeoffForm" value="1" /></td> </tr> <tr> <td colspan="2" bgcolor="#E3F2F1"><div id ='resDiv'><BR /><BR /></div></td> </tr> </table> </form> <h3>List of takeoffs that belong to this area</h3><BR /> <table class='stripeMe' id='takeoffList'> <?php list($takeoffs, $takeoffsID) = area::getTakeoffs($areaID); $i = 0; foreach ($takeoffs as $name) { $takeoffID = $takeoffsID[$i]; echo "<tr id='row_{$takeoffID}'><td>{$name}</td><td><div class='removeTakeoff' id='{$takeoffID}'>Remove Takeoff from area</div></td></tr>"; $i++; } ?> </table> <?php echo "<div align=center><a href='" . getLeonardoLink(array('op' => 'area_admin', 'areaAction' => 'none', 'areaID' => 0)) . "'>RETURN TO LIST</a> </div><BR>"; closeMain(); } } }
echo getLeonardoLink(array('op' => 'useCurrent', 'brandID' => '0')); ?> '><?php echo _Display_ALL; ?> </a> </div> </td> </tr> </table> <?php } else { echo "<ul>\n<li><a href='" . ($catLink = getLeonardoLink(array('op' => 'useCurrent', 'brandID' => '0')) . "'>" . _All_Brands . "</a></li>"); foreach ($brandsListFilter as $brandNameFilter => $brandIDfilter) { echo "<li><a href='" . ($catLink = getLeonardoLink(array('op' => 'useCurrent', 'brandID' => $brandIDfilter)) . "'>{$brandNameFilter}</a></li>"); } echo "</ul>\n"; } ?> </div> </div> <div id="newsDropDownID" class="secondMenuDropLayer" > <div class='closeButton closeLayerButton'></div> <div class='content' style='padding:5px;'> <a href='<?php echo $thisURL; ?> '><?php echo leoHtml::img("icon_bookmark.gif", 0, 0, 'absmiddle', _This_is_the_URL_of_this_page, 'icons1');
// //************************************************************************ require_once dirname(__FILE__) . '/CL_area.php'; $areaID = makeSane($_GET['areaID'], 1); openMain(_Flying_Areas, 0, 'icon_takeoff.gif'); ?> <table class=main_text width="564" border="0" align="center" cellpadding="3" cellspacing="1"> <tr> <td><?php echo _Name_of_Area; ?> </td> <td> </td> </tr> <?php $query = "SELECT * FROM {$areasTable} WHERE areaType=0 ORDER BY name"; // $query="SELECT * FROM $areasTable ORDER BY name"; // echo $query; $res = $db->sql_query($query); if ($res <= 0) { echo "No areas found <BR>"; } while ($row = $db->sql_fetchrow($res)) { echo "<tr> \n <td>" . $row['name'] . "</td>\n\t <td> "; echo "<a href='" . getLeonardoLink(array('op' => 'area_show', 'areaID' => $row['ID'])) . "'>" . _See_area_details . "</a>"; echo "</td></tr> \n"; } echo "</table>"; closeMain(); return;
function exportXML($forceProtocol = '') { global $CONF_server_id, $CONF_photosPerFlight, $CONF; if ($forceProtocol == '') { if ($CONF['sync']['protocol']['format'] == 'JSON') { $useJSON = 1; require_once dirname(__FILE__) . '/lib/json/CL_json.php'; } else { $useJSON = 0; } } else { if ($forceProtocol == 'XML') { $useJSON = 0; } else { $useJSON = 1; } } $link = htmlspecialchars("http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_waypoint', 'waypointIDview' => $this->waypointID))); if (!$useJSON) { return "<waypoint>\n<id>" . htmlspecialchars($this->waypointID) . "</id>\n<name>" . htmlspecialchars($this->name) . "</name>\n<intName>" . htmlspecialchars($this->intName) . "</intName>\n<location>" . htmlspecialchars($this->location) . "</location>\n<intLocation>" . htmlspecialchars($this->intLocation) . "</intLocation>\n<countryCode>" . htmlspecialchars($this->countryCode) . "</countryCode>\n<type>" . htmlspecialchars($this->type) . "</type>\n<lat>" . htmlspecialchars($this->lat()) . "</lat>\n<lon>" . htmlspecialchars($this->lon()) . "</lon>\n<link>" . htmlspecialchars($this->link) . "</link>\n<displayLink>" . $link . "</displayLink>\n<description>" . htmlspecialchars($this->description) . "</description>\n<modifyDate>" . htmlspecialchars($this->modifyDate) . "</modifyDate>\n</waypoint>"; } else { return '{ "waypoint": { "id" : ' . ($this->waypointID + 0) . ', "name" : "' . json::prepStr($this->name) . '", "intName" : "' . json::prepStr($this->intName) . '", "location" : "' . json::prepStr($this->location) . '", "intLocation" : "' . json::prepStr($this->intLocation) . '", "countryCode" : "' . json::prepStr($this->countryCode) . '", "type" : ' . ($this->type + 0) . ', "lat" : ' . $this->lat() . ', "lon" : ' . $this->lon() . ', "link" : "' . json::prepStr($this->link) . '", "displayLink" : "' . json::prepStr($link) . '", "description" : "' . json::prepStr($this->description) . '", "modifyDate" : "' . json::prepStr($this->modifyDate) . '" } }'; } }
</td> </tr> <tr> <td colspan=<?php echo $num_of_cols; ?> height=8 class="datesColumn" > <ul class='simpleList'> <?php foreach ($clubsList as $clubsItem) { if ($clubsItem['id'] == $clubID) { $a_class = "class='boldFont'"; } else { $a_class = ""; } echo "<li {$a_class}><a href='#' onclick='showClubDetails(" . $clubsItem['id'] . ")'>\n\t\t\t" . leoHtml::img("icon_info.png", 0, 0, 'absmiddle', _Club . " " . $clubsItem['desc'], 'icons1') . "</a>\n\t\t\t<a {$a_class} href='" . getLeonardoLink(array('op' => 'useCurrent', 'clubID' => $clubsItem['id'], 'nacclubid' => '0', 'nacid' => '0')) . "'>" . $clubsItem['desc'] . "</a></li>\n"; } ?> </ul> </td> </tr> </TABLE> <?php } ?> </td></tr></table> <div id='filterResultDiv'></div> </div>
// // $Id: GUI_user_prefs.php,v 1.9 2010/03/14 20:56:11 manolis Exp $ // //************************************************************************ if (isset($_REQUEST['updatePrefs'])) { // submit form $PREFS->themeName = makeSane($_POST['PREFS_themeName'], 0); $PREFS->itemsPerPage = makeSane($_POST['PREFS_itemsPerPage'], 1); $PREFS->metricSystem = makeSane($_POST['PREFS_metricSystem']); $PREFS->language = makeSane($_POST['PREFS_language']); $_SESSION["lng"] = $PREFS->language; $PREFS->viewCat = makeSane($_POST['PREFS_viewCat'], 1); $_SESSION["cat"] = $PREFS->viewCat; $PREFS->viewCountry = makeSane($_POST['PREFS_viewCountry']); $_SESSION["country"] = $PREFS->viewCountry; echo "<div align=center>" . _Your_settings_have_been_updated . "<br><br><a href='" . getLeonardoLink(array('op' => 'list_flights')) . "'>" . _RETURN_TO_FLIGHTS . "</a><br><br></div>"; } ?> <form name=userPrefs method="POST" > <?php openMain(_MENU_MY_SETTINGS, 0, "icon_profile.png"); ?> <table width="100%" border="0" bgcolor="#F4F3F1" cellpadding="3" align="left" class="box main_text" style="background-color:#F4F3F1"> <tr> <td colspan="3" > </td> </tr> <tr> <td width="284" bgcolor="#E0E2F0"><div align="right"><?php echo _THEME; ?>
function hideSameFlights() { // now is a good time to disable duplicate flights we have found from other servers // AND are from the same user (using pilot's mapping table to find that out) // addition: 2008/07/21 we search for all flight no only from same user/server global $db, $flightsTable; $query = "SELECT serverID,ID,externalFlightType, FROM {$flightsTable}\n\t\t\t\t\tWHERE hash='" . $this->hash . "' AND userID=" . $this->userID . " AND userServerID=" . $this->userServerID . " ORDER BY serverID ASC, ID ASC"; $query = "SELECT serverID,ID,externalFlightType,userID,userServerID FROM {$flightsTable}\n\t\t\tWHERE hash='" . $this->hash . "' ORDER BY serverID ASC, ID ASC"; // echo $query; $res = $db->sql_query($query); if ($res <= 0) { DEBUG("FLIGHT", 1, "flightData: Error in query: {$query}<br>"); return array(); // no duplicate found } // we must disable all flights BUT one // rules: // 1. locally submitted flights have priority // 2. between external flights , the full synced have priority over simple links // 3. between equal cases the first submitted has priority. $i = 0; while ($row = $db->sql_fetchrow($res)) { $fList[$i] = $row; $i++; } if ($i == 0) { return array(); // no duplicate found } usort($fList, "sameFlightsCmp"); $i = 0; $msg = ''; foreach ($fList as $i => $fEntry) { if (0) { echo "<pre>"; echo "-------------------------<BR>"; print_r($fEntry); echo "-------------------------<BR>"; echo "</pre>"; } if ($i == 0) { // enable $msg .= " Enabling "; $query = "UPDATE {$flightsTable} SET private = private & (~0x02 & 0xff ) WHERE ID=" . $fEntry['ID']; } else { // disable $msg .= " Disabling "; $query = "UPDATE {$flightsTable} SET private = private | 0x02 WHERE ID=" . $fEntry['ID']; } $msg .= " <a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $fEntry['ID'])) . "'>Flight " . $fEntry['ID'] . "</a> from <a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'pilot_profile', 'pilotIDview' => $fEntry['userServerID'] . '_' . $fEntry['userID'])) . "'>PILOT " . $fEntry['userServerID'] . '_' . $fEntry['userID'] . "</a><BR>\n"; $res = $db->sql_query($query); # Error checking if ($res <= 0) { echo "<H3> Error in query: {$query}</H3>\n"; } $i++; } // now also make a test to see if all flights are from same user (alien mapped to local) // if not , send a mail to admin to warn him and suggest a new mapping $pList = array(); foreach ($fList as $i => $fEntry) { $pList[$fEntry['userServerID'] . '_' . $fEntry['userID']]++; } if (count($pList) > 1) { // more than one pilot involved in this sendMailToAdmin("Duplicate flights", $msg); //echo "Duplicate flights".$msg; } /* foreach ($disableFlightsList as $dFlightID=>$num) { $query="UPDATE $flightsTable SET private = private | 0x02 WHERE ID=$dFlightID "; $res= $db->sql_query($query); # Error checking if($res <= 0){ echo("<H3> Error in query: $query</H3>\n"); } } foreach ($enableFlightsList as $dFlightID=>$num) { $query="UPDATE $flightsTable SET private = private & (~0x02 & 0xff ) WHERE ID=$dFlightID "; $res= $db->sql_query($query); # Error checking if($res <= 0){ echo("<H3> Error in query: $query</H3>\n"); } }*/ }
function getAddFlightErrMsg($result, $flightID) { $callingURL = "http://" . $_SERVER['SERVER_NAME']; if (is_array($flightID)) { $flightID = $flightID[0]['ID']; } switch ($result) { case ADD_FLIGHT_ERR_YOU_HAVENT_SUPPLIED_A_FLIGHT_FILE: $errMsg = _YOU_HAVENT_SUPPLIED_A_FLIGHT_FILE; break; case ADD_FLIGHT_ERR_NO_SUCH_FILE: $errMsg = _NO_SUCH_FILE; break; case ADD_FLIGHT_ERR_FILE_DOESNT_END_IN_IGC: $errMsg = _FILE_DOESNT_END_IN_IGC; break; case ADD_FLIGHT_ERR_THIS_ISNT_A_VALID_IGC_FILE: $errMsg = _THIS_ISNT_A_VALID_IGC_FILE; break; case ADD_FLIGHT_ERR_SAME_DATE_FLIGHT: $errMsg = _THERE_IS_SAME_DATE_FLIGHT . "<br><br>" . _IF_YOU_WANT_TO_SUBSTITUTE_IT . " " . "<a href='{$callingURL}" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)) . "'>" . _DELETE_THE_OLD_ONE . "</a>"; break; case ADD_FLIGHT_ERR_SAME_FILENAME_FLIGHT: $errMsg = _THERE_IS_SAME_FILENAME_FLIGHT . "<br><br>" . _IF_YOU_WANT_TO_SUBSTITUTE_IT . " " . "<a href='{$callingURL}" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)) . "'>" . _DELETE_THE_OLD_ONE . "</a><br><br>" . _CHANGE_THE_FILENAME; break; case ADD_FLIGHT_ERR_SAME_HASH_FLIGHT: $errMsg = _THERE_IS_SAME_DATE_FLIGHT . " (HASH) <br><br>" . _IF_YOU_WANT_TO_SUBSTITUTE_IT . " " . "<a href='{$callingURL}" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)) . "'>" . _DELETE_THE_OLD_ONE . "</a>"; break; case ADD_FLIGHT_ERR_DATE_IN_THE_FUTURE: $errMsg = "The date of the flight is in the future<BR>Please use the Year-month-day not the US Year-day-month format"; break; case ADD_FLIGHT_ERR_OUTSIDE_SUBMIT_WINDOW: $errMsg = _OUTSIDE_SUBMIT_WINDOW; break; } return $errMsg; }
</div>'; $tkStr .= ' </ul> </div>'; $sel_years = ""; for ($i = date("Y"); $i >= 2000; $i--) { if ($i == date("Y")) { $sel = " selected"; } else { $sel = ""; } $sel_years .= "<option value='{$i}' {$sel}>{$i}</option>\n"; } $sel_cat = ""; foreach ($CONF_glider_types as $gl_id => $gl_type) { if ($gl_id == $CONF_default_cat_view) { $is_type_sel = "selected"; } else { $is_type_sel = ""; } $sel_cat .= "<option {$is_type_sel} value={$gl_id}>" . $gliderCatList[$gl_id] . "</option>\n"; } if (!$CONF_use_htc_ie_hack) { $Ltemplate->assign_block_vars('ieHoverJS', array()); } if ($userID > 0) { $Ltemplate->assign_block_vars('myMenu', array('LINK_MY_FLIGHTS' => getLeonardoLink(array('op' => 'list_flights', 'pilotID' => $userID, 'takeoffID' => '0', 'country' => '0', 'year' => '0', 'month' => '0', 'season' => '0')), 'LINK_MY_PROFILE' => getLeonardoLink(array('op' => 'pilot_profile', 'pilotIDview' => $userID)), 'LINK_MY_STATS' => getLeonardoLink(array('op' => 'pilot_profile_stats', 'pilotIDview' => $userID)), 'LINK_MY_SETTINGS' => getLeonardoLink(array('op' => 'user_prefs')))); } $Ltemplate->assign_vars(array('lgStr' => $lgStr, 'ctStr' => $ctStr, 'tkStr' => $tkStr, 'YEARS_OPTION' => $sel_years, 'CATS_OPTION' => $sel_cat, 'LINK_SITES_GUIDE' => getLeonardoLink(array('op' => 'sites')), 'LINK_SHOW_LAST_ADDED' => getLeonardoLink(array('op' => 'list_flights', 'sortOrder' => 'dateAdded', 'year' => '0', 'month' => '0', 'season' => '0', 'country' => '0', 'takeoffID' => '0', 'pilotID' => '0')), 'LINK_SHOW_PILOTS' => getLeonardoLink(array('op' => 'list_pilots', 'comp' => '0')), 'LINK_SUBMIT_FLIGHT' => getLeonardoLink(array('op' => 'add_flight')), 'SHOW_LEAGUE_URL' => getLeonardoLink(array('op' => 'competition', 'country' => '%country%', 'year' => '%year%', 'month' => '0', 'cat' => '%cat%')), 'SHOW_FLIGHTS_URL' => getLeonardoLink(array('op' => 'list_flights', 'country' => '%country%', 'year' => '%year%', 'month' => '0', 'cat' => '%cat%', 'takeoffID' => '0', 'pilotID' => '0')), 'SHOW_TAKEOFFS_URL' => getLeonardoLink(array('op' => 'list_takeoffs', 'country' => '%country%', 'takeoffID' => '0', 'pilotID' => '0', 'year' => '0', 'month' => '0', 'cat' => '0')))); $Ltemplate->pparse('body'); $noFooterMenu = 1;
echo _SITE_RECORD; ?> </b>: <?php $query = "SELECT MAX(MAX_LINEAR_DISTANCE) as record_km, ID FROM {$flightsTable} WHERE takeoffID =" . $waypointIDview . " GROUP BY ID ORDER BY record_km DESC "; $flightNum = 0; $res = $db->sql_query($query); if ($res > 0) { $flightNum = mysql_num_rows($res); $row = mysql_fetch_assoc($res); echo "<a href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['ID'])) . "'>" . formatDistance($row['record_km'], 1) . "</a>"; } ?> <p> <strong><?php echo "<a href='" . getLeonardoLink(array('op' => 'list_flights', 'takeoffID' => $waypointIDview)) . "'>" . _See_flights_near_this_point . " [ " . $flightNum . " ]</a>"; ?> </strong> </td> <td rowspan="3" class="col2_in"><p><strong>lat/lon (WGS84):</strong><br> <?php echo $wpInfo->lat . " , " . -$wpInfo->lon; echo "<br>" . $wpInfo->getLatMinDec() . " , " . $wpInfo->getLonMinDec(); echo "<br>" . $wpInfo->getLatDMS() . " , " . $wpInfo->getLonDMS(); echo "<p>"; list($UTM_X, $UTM_Y, $UTMzone, $UTMlatZone) = $wpInfo->getUTM(); echo "<b>UTM:</b> {$UTMzone}{$UTMlatZone} X: " . floor($UTM_X) . " Y: " . floor($UTM_Y); ?> </td> <td class="col3_in"><div align="center"><strong><?php echo "<a href='" . getDownloadLink(array('type' => 'kml_wpt', 'wptID' => $waypointIDview)) . "'>" . _Navigate_with_Google_Earth . "</a>";
} //echo '<td class="datesColumn" valign="top">'; echo $seasonStr; //echo '</td>'; } else { if ($CONF['years']['use_calendar_years']) { for ($i = $CONF['years']['end_year']; $i >= $CONF['years']['start_year']; $i--) { echo '<tr><td class="datesColumn" valign="top">'; echo "<a href='" . getLeonardoLink(array('op' => 'useCurrent', 'season' => 0, 'year' => $i, 'month' => '0', 'day' => '0')) . "'>{$i}</a>"; echo '</td></tr>'; } if (!$CONF['years']['dont_show_all_years']) { echo '<tr><td class="datesColumn" valign="top">'; ?> <a style='text-decoration:underline;' href='<?php echo getLeonardoLink(array('op' => 'useCurrent', 'season' => '0', 'year' => '0', 'month' => '0', 'day' => '0')); ?> '><?php echo _ALL_YEARS; ?> </a> <?php echo '</td></tr>'; } } } ?> </TABLE> <?php
// disable any private/disabled and airspace invalid flight from WXC score if ($row['private'] > 0) { $row['NacStatus'] = "d"; } //in case of detected airspace violation, pilot might still have approval for that airspace... so we allow sync when word "approved" is set at comment first if ($row['airspaceCheckFinal'] == "-1" && strtolower(substr($row['airspaceCheckMsg'], 0, 8) != "approved")) { $row['NacStatus'] = "d"; } $row['GliderCat'] = convertCat($row['cat'], $row['category']); if ($row['serverID'] == 0 || $row['serverID'] == $CONF_server_id) { $isLocal = 1; } else { $isLocal = 0; } if ($isLocal) { $row['FlightUrl'] = "http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['NacFlightId'])); } else { if ($row['serverID'] != 0 && !$row['originalURL']) { if ($CONF['servers']['list'][$row['serverID']]['isLeo'] == 1) { if (!$row['originalURL']) { $row['originalURL'] = 'http://' . $CONF['servers']['list'][$row['serverID']]['url'] . '&op=show_flight&flightID=' . $row['original_ID']; } } } $row['FlightUrl'] = $row['originalURL']; } $row['FlightUrl'] = htmlspecialchars($row['FlightUrl']); $trackPath = getRelMainDir() . str_replace("%PILOTID%", getPilotID($row["userServerID"], $row["userID"]), str_replace("%YEAR%", substr($row['DATE'], 0, 4), $CONF['paths']['igc'])) . '/' . rawurlencode($row['filename']); $row['IgcUrl'] = "http://" . $_SERVER['SERVER_NAME'] . $trackPath; // the pilot id is serverid_pilotid to be able to distinguish ids across servers //0_12345
if ($countriesNum && 0) { $percent = floor(100 / $num_of_cols); for ($r = 0; $r < $num_of_rows; $r++) { $sortRowClass = $ii % 2 ? "l_row1" : "l_row2"; $ii++; echo "\n\n<tr class='{$sortRowClass}'>"; for ($c = 0; $c < $num_of_cols; $c++) { // echo "<td style='width:".$countriesDivWidth."px'>"; echo "<td class='countryList' width='{$percent}%'>"; //compute which to show //echo "c=$c r=$r i=$i<br>"; $i = $c * $num_of_rows + $r % $num_of_rows; if ($i < $countriesNum) { $countryName = $countriesNames[$i]; $countryName = trimText($countryName, 20); $linkTmp = getLeonardoLink(array('op' => 'useCurrent', 'country' => $countriesCodes[$i])); echo "<a href='{$linkTmp}'>{$countryName}</a>\n"; /* if ($currentlang=='hebrew') echo "<a href='$linkTmp'>(".$countriesFlightsNum[$i].") $countryName</a>\n"; else echo "<a href='$linkTmp'>$countryName (".$countriesFlightsNum[$i].")</a>\n"; */ } else { echo " "; } echo "</td>"; } echo '</tr>'; } }
<?php //************************************************************************ // Leonardo XC Server, http://www.leonardoxc.net // // Copyright (c) 2004-2010 by Andreadakis Manolis // // This program is free software. You can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License. // // $Id: GUI_flight_delete.php,v 1.12 2010/03/14 20:56:11 manolis Exp $ // //************************************************************************ $flightID = makeSane($_REQUEST["flightID"], 1); $confirmed = makeSane($_REQUEST["confirmed"]); $flight = new flight(); $flight->getFlightFromDB($flightID); if ($confirmed && ($flight->belongsToUser($userID) || L_auth::isAdmin($userID))) { $flight->deleteFlight(); echo "<br><span class='ok'>" . _THE_FLIGHT_HAS_BEEN_DELETED . "</span><br><br>"; echo "<a href='" . getLeonardoLink(array('op' => 'list_flights')) . "'>" . _RETURN . "</a><br></div>"; } else { $location = formatLocation(getWaypointName($flight->takeoffID), $flight->takeoffVinicity, $takeoffRadious); openMain(_CAUTION_THE_FLIGHT_WILL_BE_DELETED, 0, "delete_icon.png"); echo "<div align=center><br><b>" . _PILOT . ": " . $flight->userName . " " . _THE_DATE . ": " . formatDate($flight->DATE) . " " . _TAKEOFF_LOCATION . ": " . $location . "</b> "; echo "<br><br><a href='" . getLeonardoLink(array('op' => 'delete_flight', 'flightID' => $flightID, 'confirmed' => '1')) . "'>" . _YES . "</a> | <a href='javascript:history.go(-1)'>" . _NO . "</a>"; echo "<br></div>"; closeMain(); }
//first delete old $flight->{$var_name} = $_FILES[$var_name]['name']; if (move_uploaded_file($_FILES[$var_name]['tmp_name'], $flight->getPhotoFilename($i))) { CLimage::resizeJPG($CONF['photos']['thumbs']['max_width'], $CONF['photos']['thumbs']['max_height'], $flight->getPhotoFilename($i), $flight->getPhotoFilename($i) . ".icon.jpg", $CONF['photos']['compression']); CLimage::resizeJPG($CONF['photos']['normal']['max_width'], $CONF['photos']['normal']['max_height'], $flight->getPhotoFilename($i), $flight->getPhotoFilename($i), $CONF['photos']['compression']); } else { //upload not successfull $flight->{$var_name} = ""; } } } } $flight->putFlightToDB(1); open_inner_table(_CHANGE_FLIGHT_DATA, 650); echo "<center> <br><br>" . _THE_CHANGES_HAVE_BEEN_APPLIED . "<br><br><br>"; echo "<a href='" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)) . "'>" . _RETURN_TO_FLIGHT . "</a><br><br><br>"; echo "</center>"; close_inner_table(); } else { // show the form ?> <form action="" enctype="multipart/form-data" method="post"> <input type="hidden" name="changeFlight" value=1> <input type="hidden" name="flightID" value="<?php echo $flightID; ?> "> <?php open_inner_table("Review Validation Status", 650, "change_icon.png"); echo "<tr><td>"; ?>
} // put back original text $("#commentText"+translatecommentID).html(originalTexts[translatecommentID]); //find the target lang var targetLang=$(this).attr('id').substring(4); //$("#replyText").html(targetLang+"###"+translatecommentID+"$$"); $(".media_embed").css({visibility:'visible'}); // translate! $("#commentText"+translatecommentID).translate(translateSrcLang,targetLang); }); $("#BookmarkButton").bookmark({ url: 'http://<?php echo $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)); ?> ', title: 'Flying', description:'Look at this flight', popup: true, popupText:'<img src="<?php echo $moduleRelPath; ?> /img/share.gif" border="0">', addEmail: true, compact: false, sites: ['facebook','delicious', 'digg','reddit','twitter','bookmarkit','myspace','stumbleupon'] }); $("#rssButton").click(function() {
<td><u> <?php echo _PILOT_NAME; ?> </u> </td> <td><?php echo $user['user_lastname'] . ' ' . $user['user_firstname']; ?> </td> </tr> </table> <div align="center"> <br><br> <a href="<?php echo getLeonardoLink(array('op' => 'login')); ?> "><?php echo _MENU_LOGIN; ?> </a> <br><br> </div> </td> </tr> </table> <? closeMain();return; } // $_GET['rkey'];
<td bgcolor="#EBE1C5" valign="top"><b><?php echo _SITE_RECORD; ?> </b>: <?php $query = "SELECT MAX(MAX_LINEAR_DISTANCE) as record_km, ID FROM {$flightsTable} WHERE takeoffID =" . $waypointIDview . " GROUP BY ID ORDER BY record_km DESC "; $flightNum = 0; $res = $db->sql_query($query); if ($res > 0) { $flightNum = mysql_num_rows($res); $row = mysql_fetch_assoc($res); echo "<a target='_blank' href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['ID'])) . "'>" . formatDistance($row['record_km'], 1) . "</a>"; } ?> <p> <strong><?php echo "<a target='_blank' href='http://" . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'list_flights', 'takeoffID' => $waypointIDview, 'year' => '0', 'month' => '0', 'season' => '0', 'pilotID' => '0', 'country' => '0', 'cat' => '0')) . "'>" . _See_flights_near_this_point . " [ " . $flightNum . " ]</a>"; ?> </strong></td> </tr> <tr bgcolor="#49766D"> <td><div align="left" ></div> <div align="left" class="titleWhite"><b><?php echo _COORDINATES; ?> </b></div></td> </tr> <tr bgcolor="#EBE1C5"> <td width="271" bgcolor="#EBE1C5"><p><strong>lat/lon (WGS84):</strong><br> <?php echo $wpInfo->lat . " , " . -$wpInfo->lon; echo "<br>" . $wpInfo->getLatMinDec() . " , " . $wpInfo->getLonMinDec();
$("#intName").attr("checked","checked"); <?php } ?> $("#ActionDiv").click(function() { var methodID=$("#compareMethod").val(); var countryCode=$("#countryCode").val(); var intName=$("#intName").val(); var cStr=''; if (countryCode) cStr='&countryCode='+countryCode; if (intName) cStr+='&intName=1'; var linkStr='<?php echo getLeonardoLink(array('op' => 'admin_takeoff_resolve')); ?> &admin_op='+methodID+cStr; document.location=linkStr; }); }); </script> <?php $workTable = "temp_leonardo_gliders"; // $workTable=$flightsTable; open_inner_table("ADMIN AREA :: Resolve Duplicate takeoffs", 850); open_tr(); echo "<td align=left>"; if (!L_auth::isAdmin($userID)) { echo "<br><br>You dont have access to this page<BR>";
$adminPanel.="<div style='display:inline'><a href='javascript:toggleVisibility(\"xmlOutput\")';>See XML</a></div>"; } $adminPanel.="<div style='display:inline'> :: <a href='javascript:toggleVisibility(\"adminPanel\")';>Admin options</a></div>"; if ($CONF_show_DBG_XML) { $adminPanel.="<div id=xmlOutput style='display:none; text-align:left;'><hr>"; $adminPanel.="XML from paraglidingEarth.com<br>"; $adminPanel.="<pre>$xmlSites1</pre><hr>XML from paragliding365.com<br><pre>$xmlSites2</pre></div>"; } $adminPanel.="<div id='adminPanel' style='display:none; text-align:center;'><hr>"; $adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateData'=>'1'))."'>"._UPDATE_DATA."</a> | "; $adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateMap'=>'1'))."'>"._UPDATE_MAP."</a> | "; $adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateCharts'=>'1'))."'>"._UPDATE_GRAPHS."</a> | "; $adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateScore'=>'1'))."'>"._UPDATE_SCORE."</a> "; $adminPanel.=get_include_contents(dirname(__FILE__)."/site/admin_takeoff_info.php"); } $images=""; for ( $photoNum=1;$photoNum<=$CONF_photosPerFlight;$photoNum++){ $photoFilename="photo".$photoNum."Filename"; if ($flight->$photoFilename) { $images.="<a class='shadowBox imgBox' href='".$flight->getPhotoRelPath($photoNum). "' target=_blank><img src='".$flight->getPhotoRelPath($photoNum).".icon.jpg' border=0></a>"; } } // add support for google maps // see the config options
// it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License. // // $Id: MENU_fav.php,v 1.2 2012/09/17 22:33:49 manolis Exp $ // //************************************************************************ ?> <div id="dbg" style="position:absolute;top:0;left:0;width:100px;height:20px;display:none;"></div> <script type="text/javascript"> var favList=[]; var favVisible=0; var favSelectInit=0; var compareUrlBase='<?php echo getLeonardoLink(array('op' => 'compare', 'flightID' => '%FLIGHTS%')); ?> '; var compareUrl=''; function toogleFav() { if (favVisible) { deactivateFavorites(); favVisible=0; } else { activateFavorites(); favVisible=1; } toogleMenu('fav'); }
echo _OR; ?> </strong> </div> </td> </tr> <tr> <td colspan=<?php echo $num_of_cols; ?> class="dropDownBoxH2"> <div class="dropDownBoxH2"><?php echo $js; ?> <a style='text-align:center; text-decoration:underline;' href='<?php echo getLeonardoLink(array('op' => 'useCurrent', 'nacid' => !empty($forceNacId) ? $forceNacId : '0', 'nacclubid' => '0')); ?> '><?php echo _Display_ALL; ?> </a> </div> </td> </tr> <?php /* not needed currently if (!$useNacClubPopUp) { require_once(dirname(__FILE__)."/CL_NACclub.php"); $nacClubs=NACclub::getClubs($nacid, true); $nacClubNum=count($nacClubs);
} else { $dateStr = ''; } echo "<span>{$dateStr}<a {$linkStr}>" . $newsItem['text'] . "</a></span>\n"; } } } if ($CONF['news']['config']['showBestFlights']) { global $prefix, $db, $sitename, $user, $cookie, $flightsTable; global $CONF_glider_types, $gliderCatList, $module_name; $count = 1; $content .= "<span><b>Best scores for " . date("Y") . "</b> </span>"; foreach ($CONF_glider_types as $gl_id => $gl_type) { $query = "SELECT * FROM {$flightsTable}\n\t\t\t\t\tWHERE DATE_FORMAT( DATE, '%Y' ) =" . date("Y") . " AND cat =" . $gl_id . "\n\t\t\t\t\tORDER BY flight_points DESC\n\t\t\t\t\tLIMIT 1 "; $result1 = $db->sql_query($query); // Listing Topics while ($row = $db->sql_fetchrow($result1)) { $flightID = $row["ID"]; $name = getPilotRealName($row["userID"], $row["serverID"], 0, 0, 0); $takeoffName = getWaypointName($row["takeoffID"]); $takeoffVinicity = $row["takeoffVinicity"]; $takeoffNameFrm = formatLocation($takeoffName, $takeoffVinicity, $takeoffRadious); $flightDurationFrm = sec2Time($row['DURATION'], 1); $content .= "<span>:: <span>" . $gliderCatList[$gl_id] . "</span>"; $content .= "<a href='" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)) . "'>"; $content .= "{$name}</a> [ {$takeoffName} ] " . formatDate($row["DATE"]) . " <a href='" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)) . "'>" . _OLC_SCORING . ":" . formatOLCScore($row['FLIGHT_POINTS']) . "</a> </span>"; $count = $count + 1; } } echo $content; }
if ($inPageLink) { echo "<b>" . $description . "</b><br><img src=\\'img/icon_pin.png\\' align=\\'absmiddle\\' border=0> <a href=\\'javascript:show_waypoint({$wpID});\\' >" . _SITE_INFO . "</a><br>"; // echo "<b>".$description."</b><br><img src='img/icon_pin.png' align='absmiddle' border=0> <a href='GUI_EXT_waypoint_info.php?wID=$wpID' rel='facebox'>"._SITE_INFO."</a><br>"; } else { echo "<b>" . $description . "</b><br><img src=\\'img/icon_pin.png\\' align=\\'absmiddle\\' border=0> <a target=\\'_top\\' href=\\'" . getLeonardoLink(array('op' => 'show_waypoint', 'waypointIDview' => $wpID)) . "\\'>" . _SITE_INFO . "</a><br>"; } $query = "SELECT MAX(MAX_LINEAR_DISTANCE) as record_km, ID FROM {$flightsTable} WHERE takeoffID =" . $wpID . " GROUP BY ID ORDER BY record_km DESC "; $flightNum = 0; $res = $db->sql_query($query); if ($res > 0) { $flightNum = mysql_num_rows($res); if ($flightNum > 0) { echo "<img src=\\'img/icon_magnify_small.gif\\' align=\\'absmiddle\\' border=0> <a href=\\'" . getLeonardoLink(array('op' => 'list_flights', 'takeoffID' => $wpID, 'year' => '0', 'month' => '0', 'season' => '0', 'pilotID' => '0', 'country' => '0', 'cat' => '0')) . "\\' target=\\'_top\\'>" . _See_flights_near_this_point . " [ " . $flightNum . " ]</a><br>"; echo "<img src=\\'img/icon_trophy.gif\\' align=\\'absmiddle\\' border=0> <b>" . _SITE_RECORD . "</b>:"; $row = mysql_fetch_assoc($res); echo '<a target=\'_top\' href=\'http://' . $_SERVER['SERVER_NAME'] . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $row['ID'])) . '\'>' . formatDistance($row['record_km'], 1) . '</a>'; } else { echo " No flights from this location"; } } echo ' " } '; } else { if ($op == "getTakeoffsForArea") { $areaID = $_GET['areaID'] + 0; $sql = "SELECT * FROM {$waypointsTable},{$areasTakeoffsTable}\t\n\t\t\tWHERE {$areasTakeoffsTable}.takeoffID = {$waypointsTable}.ID AND {$areasTakeoffsTable}.areaID={$areaID}"; $dbres = $db->sql_query($sql); if ($dbres <= 0) { echo '{ "waypoints": [ ] }'; return; } $res = '{ "waypoints": [ ';
$FileText = Charset::convert($FileText, 'gb2312', 'utf-8'); } else { $FileText = str_replace("charset={$encFrom}", "charset=utf-8", $FileText); $FileText = $NewEncoding->Convert($FileText, $encFrom, $encTo, $Entities); } writeFile(LANG_ABS_PATH . "/utf8/countries-{$lang}.php", $FileText); } echo "<strong>Converted {$lang}</strong><hr><BR>"; //break; } } // end if admin_op echo "<ul>"; echo "<li><a href='" . getLeonardoLink(array('op' => 'admin_languages', 'admin_op' => 'update')) . "'>Process ALL language files and create/update files in 'utf8'/'iso' dirs</a></li>"; foreach ($availableLanguages as $lang) { echo "<li><a href='" . getLeonardoLink(array('op' => 'admin_languages', 'admin_op' => 'update', 'update_lang' => $lang)) . "'>Process only " . strtoupper($lang) . " language files</a></li>"; } echo "</ul><br>"; closeMain(); /** * Get associative array of language constants, array key being the constant name * function modified by martin jursa 13.05.2009 to handle multiline defines too * * @param string $file * @return array */ function getDefinesAsArray($file) { if (!($lines = @file(dirname(__FILE__) . '/language/' . $file))) { echo "No defines found<br>"; return array();