$flight->private = 1;
 } else {
     $flight->private = 0;
 }
 for ($i = 1; $i <= $CONF_photosPerFlight; $i++) {
     $var_name = "photo" . $i . "Filename";
     if ($_REQUEST["photo" . $i . "Delete"] == "1") {
         // DELETE photo
         $flight->deletePhoto($i);
     } else {
         if ($_FILES[$var_name]['name']) {
             // upload new
             $flight->deletePhoto($i);
             //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();