return;
    }
    // fill in values that the user left out.
    if (!$waypt->name) {
        $waypt->name = $waypt->intName;
    }
    if (!$waypt->intName) {
        $waypt->intName = $waypt->name;
    }
    if (!$waypt->location) {
        $waypt->location = $waypt->intLocation;
    }
    if (!$waypt->intLocation) {
        $waypt->intLocation = $waypt->location;
    }
    if ($waypt->putToDB(0)) {
        ?>
		  <script language="javascript">
			  function refreshParent() {
				  topWinRef=top.location.href;
				  top.window.location.href=topWinRef;
			  }
		  </script>
		<?php 
        echo "<div align=center><BR><BR>" . _WAYPOINT_ADDED . "<BR><BR>";
        echo "<a href='javascript:refreshParent();'>Update flight takeoff and RETURN </a>";
        echo "<br></div>";
    } else {
        echo "<H3> Error in inserting waypoint info query! </H3>\n";
    }
    return;
Esempio n. 2
0
 function checkLocation($serverID, $locationArray, $bounds)
 {
     //  print_r($locationArray);
     // find nearest waypoint in local db
     list($nearestTakeoffID, $nearestDistance) = findNearestWaypoint($bounds['firstLat'], $bounds['firstLon']);
     // echo "nearest takeoff :  $nearestTakeoffID,$nearestDistance <BR>";
     if ($nearestDistance < $locationArray['takeoffVinicity'] + 500) {
         // we will use our waypoint if our local waypoint is nearest  ( + 500m margin )
         return array($nearestTakeoffID, $nearestDistance);
     } else {
         // we will import this takeoff and use that instead
         $newWaypoint = new waypoint();
         $newWaypoint->setLat($locationArray['takeoffLat']);
         $newWaypoint->setLon($locationArray['takeoffLon']);
         $newWaypoint->name = $locationArray['takeoffName'];
         $newWaypoint->type = 1000;
         // takeoff
         $newWaypoint->intName = $locationArray['takeoffNameInt'];
         $newWaypoint->location = $locationArray['takeoffLocation'];
         $newWaypoint->intLocation = $locationArray['takeoffLocationInt'];
         $newWaypoint->countryCode = $locationArray['takeoffCountry'];
         $newWaypoint->link = '';
         $newWaypoint->description = '';
         $newWaypoint->putToDB(0);
         // also add it up to $waypoints because we use this array for subsequent queries
         global $waypoints;
         array_push($waypoints, $newWaypoint);
         return array($newWaypoint->waypointID, $locationArray['takeoffVinicity']);
     }
 }
Esempio n. 3
0
}
$waypointIDedit = makeSane($_REQUEST['waypointIDedit'], 1);
if ($_POST['editWaypoint'] == 1) {
    // CHANGE waypoint
    $waypt = new waypoint($waypointIDedit);
    $waypt->name = $_POST['wname'];
    $waypt->intName = $_POST['intName'];
    $waypt->type = $_POST['type'];
    $waypt->lat = $_POST['lat'];
    $waypt->lon = $_POST['lon'];
    $waypt->location = $_POST['location'];
    $waypt->intLocation = $_POST['intLocation'];
    $waypt->countryCode = $_POST['countryCode'];
    $waypt->link = $_POST['link'];
    $waypt->description = $_POST['description'];
    if ($waypt->putToDB(1)) {
        echo "<center>" . _THE_CHANGES_HAVE_BEEN_APPLIED . "<br>";
        echo "<a href='" . getLeonardoLink(array('op' => 'show_waypoint', 'waypointIDedit' => $waypointIDedit)) . "'>RETURN to view mode</a> or ";
        echo "<a href='" . getLeonardoLink(array('op' => 'list_flights')) . "'>RETURN to flights</a>";
        echo "<br></center>";
    } else {
        echo "<H3> Error in puting waypoint info into DB! </H3>\n";
    }
}
$waypt = new waypoint($waypointIDedit);
$waypt->getFromDB();
require_once dirname(__FILE__) . '/FN_editor.php';
openMain("Edit waypoint", 760, "icon_pin.png");
?>