// 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_add.php,v 1.45 2012/01/16 07:21:22 manolis Exp $
//
//************************************************************************
# modification martin jursa 02.06.2009: keep user==-1 from uploading flights and place a message
if (!$userID || $userID == -1) {
    echo _You_are_not_login;
    return;
}
require_once dirname(__FILE__) . "/CL_NACclub.php";
require_once dirname(__FILE__) . "/CL_pilot.php";
$thisPilot = new pilot(0, $userID);
$thisPilot->getFromDB();
/*
	new defines
define("_GLIDER_CERT","Glider Certification");
define("_PLEASE_SELECT_YOUR_GLIDER_CERTIFICATION","Please select the certification of your glider");

AirTime
*/
?>
<style type="text/css">
<!--

.addGlider {
    font-style: italic;
}
    $res = $db->sql_query($query);
    if ($res <= 0) {
        echo "<H3> Error in mapping pilots: {$query}</H3>\n";
    } else {
        echo "Pilot Mapping successfull";
    }
} else {
    if ($op == 'copyRemoteToLocalInfo') {
        $pilotID1 = makeSane($_GET['pilotID1'], 0);
        $pilotID2 = makeSane($_GET['pilotID2'], 0);
        $serverID1 = makeSane($_GET['serverID1'], 0);
        $serverID2 = makeSane($_GET['serverID2'], 0);
        require_once "CL_pilot.php";
        echo "Copying Pilot Info from {$serverID1}  {$pilotID1} -> {$serverID2} {$pilotID2}<br>";
        $pilot1 = new pilot($serverID1, $pilotID1);
        $pilot1->getFromDB();
        $pilot1->pilotID = $pilotID2;
        $pilot1->serverID = $serverID2;
        $res = $pilot1->putToDB1(1);
        echo "Res:{$res}<BR>";
    } else {
        if ($op == 'movePilotFlights') {
            $pilotID1 = makeSane($_GET['pilotID1'], 0);
            $pilotID2 = makeSane($_GET['pilotID2'], 0);
            $serverID1 = makeSane($_GET['serverID1'], 0);
            $serverID2 = makeSane($_GET['serverID2'], 0);
            echo "moving flights from {$serverID1}  {$pilotID1} -> {$serverID2} {$pilotID2} ";
            require_once "CL_pilot.php";
            $pilot = new pilot($serverID1, $pilotID1);
            $res = $pilot->movePilotFlights($serverID2, $pilotID2);
            echo "Res:{$res}<BR>";