<html>
<head>
<title>Web management</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<link rel="stylesheet" href="../styles.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="20">
<table width="700" border="0" cellspacing="0" cellpadding="0" class="webadmintext" align="center">
  <tr> 
    <td> 
      <?php 
	if  ($submit){
?>
    </td>
  </tr>
  <tr> 
    <td> 
      <div align="center"> 
        <?php 
        $uploadDir = '../photos/'; 
 

        if (isset($submit)){ 
            if ($upload != 'none'){ 
 
       $upload_name=$upload_name;
                $dest = $uploadDir . $upload_name; 
                if (@copy($upload, $dest)){ 
                    echo "File successfully uploaded \n"; 
                } 
                else{ 
                    echo "File upload failed<BR>\n"; 
                    $perms = @fileperms($uploadDir); 
                    $owner = @fileowner($uploadDir); 
                    if (!$perms){ 
                        echo "Directory does not exist: $uploadDir\n"; 
                    } 
                    else{ 
                        $myuid = getmyuid(); 
                        if (!($perms & 2) && !(($owner == $myuid) && ($perms & 128))){ 
                            echo get_current_user(), " doesn't have permission to write in $uploadDir\n"; 
                        } 
                    } 
                } 
            } 
            else{ 
                echo "File upload failed\n"; 
                echo "Filesize exceeds limit in FORM or php.ini<BR>\n"; 
            } 
?>
<meta http-equiv="refresh" content="0;URL=edit-photo.php?id=<?php echo $id ?>">
        <?php } 
    ?>
      </div>
    </td>
  </tr>
  <tr> 
    <td> 
      <?php			
	     }else{

	?>
    </td>
  </tr>
  <tr> 
    <td> 
      <div align="center">Ψάξτε την φωτογραφία που θέλετε να εισάγετε</div>
    </td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td> 
      <FORM ENCTYPE=multipart/form-data ACTION=gallery_image.php METHOD=POST>
        <div align="center"> 
          <input type="hidden" name="upload_name" value="<?php echo $id ?>.jpg">
          <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=200000>
          <INPUT TYPE=HIDDEN NAME=id VALUE=<?php echo $id ?>>
          εισαγωγή εικόνας: 
          <INPUT NAME=upload TYPE=FILE class="forms" size="50">
          <BR>
          <INPUT TYPE=SUBMIT NAME=submit VALUE="Καταχώρηση" class="button">
        </div>
      </FORM>
    </td>
  </tr>
  <tr>
    <td>
      <?php
	}
?>
    </td>
  </tr>
</table>
<table width="700" border="0" cellspacing="0" cellpadding="4" align="center">
  <tr>
    <td>
      <div align="center"> <a href="javascript:history.go(-1);"><img src="back.gif" alt="πίσω" border="0"></a> 
        &nbsp; <a href="#top"><img src="top.gif" border="0" alt="πάνω"></a> 
      </div>
    </td>
  </tr>
</table>
</body>
</html>
