<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="600" border="0" cellspacing="0" cellpadding="0" class="webadmintext" align="center">
  <tr> 
    <td> 
      <?php 
         $uploadDir = '../panoramas/scene/'; 


        if (isset($submit)){ 
            if ($upload != 'none'){ 
	
			    $upload_name=$ID;
                $dest = $uploadDir . $upload_name; 
                if (@copy($upload, $dest)){ 
                    echo "Successfully uploaded $dest\n"; 
                } 
                else{ 
                    echo "File Upload Failed\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\n"; 
            } 
?>

<meta http-equiv="refresh" content="0;URL=edit-panorama.php?id=<?php echo $ID1 ?>">

      <?php echo $upload_name ?>
      <?php
 	$stringData= "<";
	$stringData=$stringData."?xml version=\"1.0\" encoding=\"UTF-8\"";
		$stringData=$stringData."?";
			$stringData=$stringData.">";
	$stringData=$stringData."
	<Root>
  <MainWindow>
    <className>TWMainWindow</className>
     <name>MainWindow</name>
    <bgColor>255,255,255</bgColor>
    <Image>
      <className>TWStillImage</className>
      <name>Image1</name>
      <zOrder>0</zOrder>
      <bounds>0,306,424,18</bounds>
      <sizeMode>fill Size</sizeMode>
      <image />
    </Image>
    <Button>
      <className>TWButton</className>
      <name>Button1</name>
      <zOrder>2</zOrder>
      <bounds>0,306,18,18</bounds>
      <normalImg>images/autoleft1.gif</normalImg>
      <overImg>images/autoleft2.gif</overImg>
      <pressImg>images/autoleft3.gif</pressImg>
      <hint>images/hint_left.jpg</hint>
      <type>normal</type>
      <action>left(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button2</name>
      <zOrder>3</zOrder>
      <bounds>18,306,18,18</bounds>
      <normalImg>images/autoright1.gif</normalImg>
      <overImg>images/autoright2.gif</overImg>
      <pressImg>images/autoright3.gif</pressImg>
      <hint>images/hint_right.jpg</hint>
      <type>normal</type>
      <action>right(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button3</name>
      <zOrder>4</zOrder>
      <bounds>36,306,18,18</bounds>
      <normalImg>images/autoup1.gif</normalImg>
      <overImg>images/autoup2.gif</overImg>
      <pressImg>images/autoup3.gif</pressImg>
      <hint>images/hint_up.jpg</hint>
      <type>normal</type>
      <action>up(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button4</name>
      <zOrder>5</zOrder>
      <bounds>54,306,18,18</bounds>
      <normalImg>images/autodown1.gif</normalImg>
      <overImg>images/autodown2.gif</overImg>
      <pressImg>images/autodown3.gif</pressImg>
      <hint>images/hint_down.jpg</hint>
      <type>normal</type>
      <action>down(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button5</name>
      <zOrder>6</zOrder>
      <bounds>72,306,18,18</bounds>
      <normalImg>images/zoomin1.gif</normalImg>
      <overImg>images/zoomin2.gif</overImg>
      <pressImg>images/zoomin3.gif</pressImg>
      <hint>images/hint_zoomin.jpg</hint>
      <type>normal</type>
      <action>zoomin(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button6</name>
      <zOrder>7</zOrder>
      <bounds>90,306,18,18</bounds>
      <normalImg>images/zoomout1.gif</normalImg>
      <overImg>images/zoomout2.gif</overImg>
      <pressImg>images/zoomout3.gif</pressImg>
      <hint>images/hint_zoomout.jpg</hint>
      <type>normal</type>
      <action>zoomout(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button7</name>
      <zOrder>8</zOrder>
      <bounds>108,306,18,18</bounds>
      <normalImg>images/stop1.gif</normalImg>
      <overImg>images/stop2.gif</overImg>
      <pressImg>images/stop3.gif</pressImg>
      <hint>images/hint_st.jpg</hint>
      <type>normal</type>
      <action>stop()</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button8</name>
      <zOrder>9</zOrder>
      <bounds>126,306,18,18</bounds>
      <normalImg>images/reset1.gif</normalImg>
      <overImg>images/reset2.gif</overImg>
      <pressImg>images/reset3.gif</pressImg>
      <hint>images/hint_reset.jpg</hint>
      <type>normal</type>
      <action>reset()</action>
    </Button>
    <SceneViewer>
      <className>TWSceneViewer</className>
      <name>SceneViewer</name>
      <zOrder>1</zOrder>
      <bgColor>255,255,255</bgColor>
      <bounds>0,0,424,324</bounds>
    </SceneViewer>
  </MainWindow>
  <FullScreenbar>
    <className>TWFullScreenbar</className>
    <name>FSbar</name>
    <bgImg1>images/toolbar.gif</bgImg1>
    <Button>
      <className>TWButton</className>
      <name>Button1</name>
      <zOrder>2</zOrder>
      <bounds>0,0,18,18</bounds>
      <normalImg>images/autoleft1.gif</normalImg>
      <overImg>images/autoleft2.gif</overImg>
      <pressImg>images/autoleft3.gif</pressImg>
      <hint>images/hint_left.jpg</hint>
      <type>normal</type>
      <action>left(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button2</name>
      <zOrder>3</zOrder>
      <bounds>18,0,18,18</bounds>
      <normalImg>images/autoright1.gif</normalImg>
      <overImg>images/autoright2.gif</overImg>
      <pressImg>images/autoright3.gif</pressImg>
      <hint>images/hint_right.jpg</hint>
      <type>normal</type>
      <action>right(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button3</name>
      <zOrder>4</zOrder>
      <bounds>36,0,18,18</bounds>
      <normalImg>images/autoup1.gif</normalImg>
      <overImg>images/autoup2.gif</overImg>
      <pressImg>images/autoup3.gif</pressImg>
      <hint>images/hint_up.jpg</hint>
      <type>normal</type>
      <action>up(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button4</name>
      <zOrder>5</zOrder>
      <bounds>54,0,18,18</bounds>
      <normalImg>images/autodown1.gif</normalImg>
      <overImg>images/autodown2.gif</overImg>
      <pressImg>images/autodown3.gif</pressImg>
      <hint>images/hint_down.jpg</hint>
      <type>normal</type>
      <action>down(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button5</name>
      <zOrder>6</zOrder>
      <bounds>72,0,18,18</bounds>
      <normalImg>images/zoomin1.gif</normalImg>
      <overImg>images/zoomin2.gif</overImg>
      <pressImg>images/zoomin3.gif</pressImg>
      <hint>images/hint_zoomin.jpg</hint>
      <type>normal</type>
      <action>zoomin(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button6</name>
      <zOrder>7</zOrder>
      <bounds>90,0,18,18</bounds>
      <normalImg>images/zoomout1.gif</normalImg>
      <overImg>images/zoomout2.gif</overImg>
      <pressImg>images/zoomout3.gif</pressImg>
      <hint>images/hint_zoomout.jpg</hint>
      <type>normal</type>
      <action>zoomout(String SceneViewer, int 20)</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button7</name>
      <zOrder>8</zOrder>
      <bounds>108,0,18,18</bounds>
      <normalImg>images/stop1.gif</normalImg>
      <overImg>images/stop2.gif</overImg>
      <pressImg>images/stop3.gif</pressImg>
      <hint>images/hint_st.jpg</hint>
      <type>normal</type>
      <action>stop()</action>
    </Button>
    <Button>
      <className>TWButton</className>
      <name>Button8</name>
      <zOrder>9</zOrder>
      <bounds>126,0,18,18</bounds>
      <normalImg>images/reset1.gif</normalImg>
      <overImg>images/reset2.gif</overImg>
      <pressImg>images/reset3.gif</pressImg>
      <hint>images/hint_reset.jpg</hint>
      <type>normal</type>
      <action>reset()</action>
    </Button>
  </FullScreenbar>
  <Scene>
    <className>SceneNode</className>
    <name>".$ID1."</name>
    <type>Spherical</type>
    <effectType>FadeInFadeOut</effectType>
    <effectTime>2</effectTime>
    <pan>0</pan>
    <tilt>0</tilt>
    <fov>75</fov>
    <panMax>180</panMax>
    <panMin>-180</panMin>
    <tiltMax>90</tiltMax>
    <tiltMin>-90</tiltMin>
    <fovMax>150</fovMax>
    <fovMin>30</fovMin>
    <speed>20</speed>
    <hfov>360</hfov>
    <aboveFov>90</aboveFov>
    <path>/panoramas/scene/".$ID1.".jpe</path>
  </Scene>
</Root>  ";
  ?>
      <?php
  $ourFileName = "../panoramas/".$ID1.".txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fwrite($ourFileHandle, $stringData);
fclose($ourFileHandle);


?>

      <?php } 
    ?>
	
    </td>
  </tr>
  <tr> 
    <td> 
      <div align="center">Ψάξτε το αρχείο .jpe που θέλετε να εισάγετε</div>
    </td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td> 
       <FORM ENCTYPE=multipart/form-data ACTION=panorama_file.php METHOD=POST name="form1">
        <div align="center"> 
          <input type="hidden" name="upload_name" value="<?php echo $id ?>">
          <input type=HIDDEN name=MAX_FILE_SIZE value=7000000>
          <input type=HIDDEN name=ID value=<?php echo $id ?>.jpe>
          <input type=HIDDEN name=ID1 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>&nbsp; </td>
  </tr>
</table>
<table width="600" 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>
