commit 1f5db711290fe1280c4b1afdb14248659659215c
Author: root <root@pano.tetaneutral.net>
Date:   Tue Aug 20 10:11:59 2013 +0000

    maj suite au stage de Victor Pongnian

diff --git a/addParams.php b/addParams.php
new file mode 100644
index 0000000..e64d387
--- /dev/null
+++ b/addParams.php
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+<?php
+if(isset($_GET['dir']) && isset($_GET['panorama'])){
+	
+	$_GET['dir'] = htmlspecialchars($_GET['dir']);              //Protection des variables GET.
+	$_GET['panorama'] = htmlspecialchars($_GET['panorama']);    // ...
+	
+	if (isset($_POST['param_latitude']) && isset($_POST['param_longitude']) 
+	&& isset($_POST['param_altitude']) && isset($_POST['param_elevation']) 
+	&& isset($_POST['param_title']) && isset($_POST['param_loop'])) {
+		
+		foreach ($_POST as $value)                              //Protection des variables POST.
+		{	
+		    $value = htmlspecialchars($value);
+		}
+
+		/* --- Vérification des inputs avec des regex. ---*/
+	    // Pour la latitude : ( Le javascript bride entre -90 et 90)
+	    if (preg_match("#^(\-?[1-9]+[0-9]?[.,]{0,1}[0-9]{0,6}|\-?[0-9]{1}[.,]{0,1}[0-9]{0,6})$#", $_POST['param_latitude']))
+	    {
+	    	$lat = $_POST['param_latitude'];
+	        //echo 'Le ' . $_POST['param_latitude'] . ' est un numéro <strong>valide</strong> !';
+	    }
+	    else
+	    {
+	        echo 'Le ' . $_POST['param_latitude'] . ' n\'est pas valide, recommencez !';
+	        
+	    }
+	    
+	    // Pour la longitude : ( Le javascript bride entre -180 et 180)
+	    if (preg_match("#^(\-?[1-9]+[0-9]?[.,]{0,1}[0-9]{0,6}|\-?[0-9]{0,1}[.,]{1}[0-9]{0,6})$#", $_POST['param_longitude']))
+	    {
+	    	$lon = $_POST['param_longitude'];
+	        //echo 'Le ' . $_POST['param_longitude'] . ' est un numéro <strong>valide</strong> !';
+	    }
+	    else
+	    {
+	        echo 'Le ' . $_POST['param_longitude'] . ' n\'est pas valide, recommencez !';
+	        
+	    }
+	    
+	    // Pour l'altitude ( Le javascript bride entre 0 et 500)
+	    if (preg_match("#^([1-9]+[0-9]{0,4}|0)$#", $_POST['param_altitude']))
+	    {
+	    	$alt = $_POST['param_altitude'];
+	        //echo 'Le ' . $_POST['param_altitude'] . ' est un numéro <strong>valide</strong> !';
+	    }
+	    else
+	    {
+	        echo 'Le ' . $_POST['param_altitude'] . ' n\'est pas valide, recommencez !';
+	        
+	    }
+	    
+	    // Pour l'élévation  ( Le javascript bride entre -10 et 10)
+	    if (preg_match("#^(\-?[1-9]+[0-9]?|0)$#", $_POST['param_elevation']))
+	    {
+	    	$ele = $_POST['param_elevation'];
+	        //echo 'Le ' . $_POST['param_elevation'] . ' est un numéro <strong>valide</strong> !';
+	    }
+	    else
+	    {
+	        echo 'Le ' . $_POST['param_elevation'] . ' n\'est pas valide, recommencez !';
+	        
+	    }
+	    
+	    $loop = $_POST['param_loop'];   // Variable radio automatiquement présente
+	    if(isset($lat) && isset($lon) && isset($alt) && isset($ele) && isset($loop)) {
+ 	
+	    	// On recherche le dossier correspondant au panorama en question
+	    	$dir_file = "/var/www/data/tsf2/vpongnian/panorama/".$_GET['dir']."/".$_GET['panorama'];
+	    	$dir_open = opendir($dir_file);
+	    	while (false !== ($file = readdir($dir_open))) {
+    	               // Si on trouve bien des tuiles
+		       if (preg_match('/(.*)_[0-9]+_[0-9]+_[0-9]+\.jpg$/', $file, $reg)) {
+			 $prefix = $reg[1];
+			 $new_param_file = $prefix.".params";
+			 break;   // On sort à la première tuile trouvée
+		       }
+		    }
+		    closedir($dir_open);
+		    
+		    $retour = "\n"; 
+                    // On vérifie qu'on a bien crée un nouveau fichier .params et on écrit dedans.
+		    if(isset($new_param_file)){
+		    	$param_file = fopen($dir_file."/".$new_param_file,'a+');
+		    	fputs($param_file,"titre = \"" . $_POST['param_title'] . "\"");
+		    	fputs($param_file,$retour);
+		    	fputs($param_file,"latitude = " . $lat);
+		    	fputs($param_file,$retour);
+		    	fputs($param_file,"longitude = " . $lon);
+		    	fputs($param_file,$retour);
+		    	fputs($param_file,"altitude = " . $alt);
+		    	fputs($param_file,$retour);
+		    	fputs($param_file,"elevation = " . $alt);
+		    	fputs($param_file,$retour);
+		    	fputs($param_file,"image_loop =" . $loop);
+		    	fputs($param_file,$retour);
+		    	fclose($param_file);
+		    	
+		    	echo 'Paramétrage OK. Retour au panorama';
+		    	header("Refresh: 1; URL=index.php");  
+		    } else {
+		    	
+		    	echo "<script>alert(\"impossible d'écrire dans le fichier\")</script>";
+		    }
+	    }
+	} else {
+		echo '<script>alert(\'$_POST manquant\')</script>';
+		header("Refresh: 2; URL=javascript:history.back();"); 	
+	}
+} else {
+echo '<script>alert(\'La destinaton est manquante\')</script>';
+header("Refresh: 2; URL=javascript:history.back();");
+}
+
+?>
+</html>
diff --git a/creerPano.php b/creerPano.php
new file mode 100644
index 0000000..4313bb0
--- /dev/null
+++ b/creerPano.php
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
+	<head>
+		<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
+		<link rel="stylesheet" media="screen" href="css/ttn_style_1.css" />
+    	<title>creation d'un panoramique</title>
+    	<script type="text/javascript">
+    	
+		function showLoad(outgoingLink){
+ 
+		var link = document.getElementById(outgoingLink);
+		var loader = document.createElement('img');
+		loader.id = 'loader';
+		loader.src ='images/loader2.gif';
+		var li = link.parentNode;
+		li.appendChild(loader);
+		}
+    	</script>
+    </head>
+    <body>
+	    <img id="top" src="images/top.png" alt="">
+		<div id="page_container">
+		    <h1><img src="images/tetaneutral.png"></h1>
+		  	<h2>Listes des photos sur le serveur</h2> 
+		  	<p>Cliquez pour générer un panorama</p>  
+       		<div id="containerList">
+		    	<ul>
+		    	
+	       		<?php
+                        
+	       		$base_dir = "/var/www/data/tsf2/vpongnian/panorama/upload/"; // modifier selon l'arborescence.
+				    try
+					{
+                                            // On ouvre le dossier ou se trouve les images
+					    $dir_fd = opendir($base_dir); 
+					    
+					    $i=0;         // Garantir l'unicité du id des liens.
+					    while (false !== ($image_name = readdir($dir_fd))) {
+					    	$dir = $base_dir.$image_name;   
+					    	
+							if ($image_name != "." && $image_name != "..")   // N'affiche pas les répertoires parents et courant.
+							{
+							     printf('<li><a href="genererPano.php?name=%s" id="link_'.$i.'" onclick="showLoad(this.id);return true;">%s</a></li>'."\n",$image_name,$image_name);
+							     $i++; 
+							}  
+							      
+					        	
+					    }
+					}
+					catch(Exception $e)
+					{
+						die('Erreur : '.$e->getMessage());
+					} 
+	       		?>
+       			</ul>
+    		</div>
+    		<div id="footer"><a href="./index.php">Retour à l'index</a></div>
+			
+    	</div>
+    	<img id="bottom" src="images/bottom.png" alt="">
+    </body>
+</html>
diff --git a/css/index_style.css b/css/index_style.css
new file mode 100644
index 0000000..8964d95
--- /dev/null
+++ b/css/index_style.css
@@ -0,0 +1,137 @@
+	body
+	{
+		
+		background:#44F;
+		font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
+		font-size:small;
+		margin:8px 0 16px;
+		text-align:center;
+		overflow:auto;
+		
+	}
+	
+	#top
+	{
+		display:block;
+		height:10px;
+		margin:10px auto 0;
+		width:650px;
+	}
+	
+	div#index_container
+	{
+		background:#fff;
+		
+		margin: auto;
+		text-align:left;
+		width:640px;
+	}
+	
+	div#index_container h2 {
+		margin:1.05em;
+		text-shadow: 0.1em 0.1em 0.15em #44F; 
+	}
+	#bottom
+	{
+		display:block;
+		height:10px;
+		margin:0 auto;
+		width:650px;
+	}
+	
+	h1
+	{
+		background-color:#6699CC;
+		margin:0;
+		min-height:0;
+		padding:0;
+		text-decoration:none;
+		text-align: center;
+		
+	}
+	
+	h1 a
+	{
+		
+		display:block;
+		height:100%;
+		min-height:40px;
+		
+	}
+	
+	h1 img
+	{
+		margin-top: 8px;
+	}
+	
+	img
+	{
+		/*behavior:url(css/iepngfix.htc);*/
+		border:none;
+	}
+	
+	div#containerList
+	{
+		margin:20px 20px 0;
+		padding:0 0 20px;
+	}
+	
+	#containerList
+	{
+		font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif;
+		
+	}
+	
+	#containerList li
+	{
+		width:100%;
+		margin:1.05em;
+		font-size:14px;
+		
+	}
+	
+	div#containerList ul
+	{
+		font-size:100%;
+		list-style-type:circle;
+		margin:0;
+		padding:0;
+		width:100%;
+	}
+	
+	div#interaction {
+		background-color:#fff;
+		margin: auto;
+		width:640px;
+		border-top: 2px dotted #44F;
+	}
+	
+	div#interaction li{
+	
+		display:inline-block;
+		list-style-type:none;
+		margin:1.08em;
+	
+	}
+	
+	div#interaction li a{
+	
+	    color:#3F2DFF;
+	    text-decoration:none;
+	    font-size:16px;
+    }
+	 
+	div#interaction li a:hover {
+		color:#FF9900;
+		text-decoration:underline;
+	}
+	
+	
+	
+	p a {
+		background-color:#fff;
+		border-radius: 4px;
+		padding:3px;
+		text-shadow: 0.1em 0.05em 0.15em #444; 
+		font-size:11px;
+	}
\ No newline at end of file
diff --git a/css/ttn_style_1.css b/css/ttn_style_1.css
new file mode 100644
index 0000000..25ffd14
--- /dev/null
+++ b/css/ttn_style_1.css
@@ -0,0 +1,135 @@
+body
+	{
+		
+		background:#44F;
+		font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
+		font-size:small;
+		margin:8px 0 16px;
+		text-align:center;
+		overflow:auto;
+		
+	}
+	
+	#top
+	{
+		display:block;
+		height:10px;
+		margin:10px auto 0;
+		width:650px;
+	}
+	
+	div#page_container
+	{
+		background:#fff;
+		
+		margin: auto;
+		text-align:left;
+		width:640px;
+	}
+	
+	div#page_container h2 {
+		display:inline-block;
+		margin:1.05em;
+		text-shadow: 0.1em 0.1em 0.15em #44F; 
+	}
+	#bottom
+	{
+		display:block;
+		height:10px;
+		margin:0 auto;
+		width:650px;
+	}
+	
+	h1
+	{
+		background-color:#6699CC;
+		margin:0;
+		min-height:0;
+		padding:0;
+		text-decoration:none;
+		text-align: center;
+		
+	}
+	
+	h1 a
+	{
+		
+		display:block;
+		height:100%;
+		min-height:40px;
+		
+	}
+	
+	h1 img
+	{
+		margin-top: 8px;
+	}
+	
+	img
+	{
+		/*behavior:url(css/iepngfix.htc);*/
+		border:none;
+	}
+	
+	h2 + p {
+		display:inline-block;
+		
+	}
+	
+	div#containerList
+	{
+		margin:20px 20px 0;
+		padding:0 0 20px;
+	}
+	
+	#containerList
+	{
+		font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif;
+		
+	}
+	
+	#containerList li
+	{
+		width:100%;
+		margin:1.05em;
+		font-size:14px;
+		list-style-type:none;
+		
+	}
+	
+	div#containerList ul
+	{
+		font-size:100%;
+		list-style-type:circle;
+		margin:0;
+		padding:0;
+		width:100%;
+	}
+	
+	li a{
+	
+	    color:#3F2DFF;
+	    text-decoration:none;
+	    font-size:16px;
+    }
+	 
+	li a:hover {
+		color:#FF9900;
+		text-decoration:underline;
+	}
+	
+	li img {
+		margin-left:20px;
+	}
+	
+	#footer
+	{
+		width:640px;
+		clear:both;
+		color:#999999;
+		text-align:center;
+		width:640px;
+		padding-bottom: 15px;
+		font-size: 85%;
+	}
+	
\ No newline at end of file
diff --git a/css/view.css b/css/view.css
new file mode 100644
index 0000000..a4520bc
--- /dev/null
+++ b/css/view.css
@@ -0,0 +1,268 @@
+body
+{
+	
+	background:#44F;
+	font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
+	font-size:small;
+	margin:8px 0 16px;
+	text-align:center;
+}
+
+#form_container
+{
+	background:#fff;
+	
+	margin:0 auto;
+	text-align:left;
+	width:640px;
+}
+
+#top
+{
+	display:block;
+	height:10px;
+	margin:10px auto 0;
+	width:650px;
+}
+
+#footer
+{
+	width:640px;
+	clear:both;
+	color:#999999;
+	text-align:center;
+	width:640px;
+	padding-bottom: 15px;
+	font-size: 85%;
+}
+
+#footer a{
+	color:#999999;
+	text-decoration: none;
+	border-bottom: 1px dotted #999999;
+}
+
+#bottom
+{
+	display:block;
+	height:10px;
+	margin:0 auto;
+	width:650px;
+}
+
+form.appnitro
+{
+	margin:20px 20px 0;
+	padding:0 0 20px;
+}
+
+h1
+{
+	background-color:#6699CC;
+	margin:0;
+	min-height:0;
+	padding:0;
+	text-decoration:none;
+	text-align: center;
+	
+}
+
+h1 a
+{
+	
+	display:block;
+	height:100%;
+	min-height:40px;
+	overflow:hidden;
+}
+
+
+h1 img
+{
+	margin-top: 8px;
+	
+}
+
+img
+{
+	/*behavior:url(css/iepngfix.htc);*/
+	border:none;
+}
+
+div#form_container h2 
+{
+	margin:1.05em;
+	text-shadow: 0.1em 0.1em 0.15em #44F; 
+}
+/**** Form Section ****/
+.appnitro
+{
+	font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif;
+	font-size:small;
+}
+
+.appnitro li
+{
+	width:61%;
+}
+
+form ul
+{
+	font-size:100%;
+	list-style-type:none;
+	margin:0;
+	padding:0;
+	width:100%;
+}
+
+form li
+{
+	display:block;
+	margin:0;
+	padding:4px 5px 2px 9px;
+	position:relative;
+}
+
+form li:after
+{
+	clear:both;
+	content:".";
+	display:block;
+	height:0;
+	visibility:hidden;
+}
+
+.buttons:after
+{
+	clear:both;
+	content:".";
+	display:block;
+	height:0;
+	visibility:hidden;
+}
+
+.buttons
+{
+	clear:both;
+	display:block;
+	margin-top:10px;
+}
+
+* html form li
+{
+	height:1%;
+}
+
+* html .buttons
+{
+	height:1%;
+}
+
+* html form li div
+{
+	display:inline-block;
+}
+
+form li div
+{
+	color:#444;
+	margin:0 4px 0 0;
+	padding:0 0 8px;
+}
+
+.clear
+{
+	clear:both;
+}
+
+form li div label
+{
+	clear:both;
+	color:#444;
+	display:block;
+	font-size:9px;
+	line-height:9px;
+	margin:0;
+	padding-top:3px;
+}
+
+
+form li span
+{
+	color:#444;
+	float:left;
+	margin:0 4px 0 0;
+	padding:0 0 8px;
+}
+
+.form_description
+{
+	border-bottom:1px dotted #ccc;
+	clear:both;
+	display:inline-block;
+	margin:0 0 1em;
+}
+
+.form_description[class]
+{
+	display:block;
+}
+
+.form_description h2
+{
+	clear:left;
+	font-size:160%;
+	font-weight:400;
+	margin:0 0 3px;
+}
+
+.form_description p
+{
+	font-size:95%;
+	line-height:130%;
+	margin:0 0 12px;
+}
+
+div#infoSize #bulle,#txtInfo
+{
+	display:inline-block;
+}
+
+img#bulle
+{
+	margin-right:1.1em;
+}
+
+#pb_outer {
+	height: 20px;
+	border: 1px inset #000000;
+	width: 80%;
+	margin: 20px auto;
+	display: none;
+}
+#pb_inner {
+	font-weight: bold;
+	color: #FFFFFF;
+	background-color: #003399;
+	height: 20px;
+	width: 1px;
+	text-align: center;
+}
+
+div#genererPano 
+{
+	border:2px inset #FF0;
+	border-radius:4px;
+	width : 40%;
+	margin : auto;
+	margin-bottom: 10px; 
+	
+}
+
+label#l_generer
+{
+	background-color:#6699CC;
+	padding:2px;
+	border-radius:10px;
+}
+
diff --git a/envoyer.php b/envoyer.php
new file mode 100644
index 0000000..ba995b3
--- /dev/null
+++ b/envoyer.php
@@ -0,0 +1,168 @@
+<?php $uid = md5(uniqid(rand())); ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
+	<head>
+    	
+    	<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
+    	<link type="image/x-icon" rel="shortcut icon" href="images/tsf.png"/>
+  		<link rel="stylesheet" media="screen" href="css/view.css" />
+    	<title>Upload d'une image sur le serveur !</title>
+    	        <!-- suivi de l'upload par ajax. Peut être utile pour certains navigateurs qui ne renseigne pas l'avancement.
+		<script type="text/javascript">
+			var HttpRequestObject = false;
+			if(window.XMLHttpRequest) {
+			   HttpRequestObject = new XMLHttpRequest();
+			}
+			else if(window.ActiveXObject) {
+			   HttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
+			}
+			
+			function startProgress(uid) {
+			  
+				
+			   <!--document.getElementById('upload').style.display = 'none';-->
+			   document.getElementById('pb_outer').style.display = 'block';
+			   setTimeout('getProgress("' + uid + '")', 1000);
+			  
+			   
+			   
+			}
+			function getProgress(uid) {
+			   if(HttpRequestObject) {
+			      HttpRequestObject.open('GET', 'getprogress.php?uid=' + uid, true);
+			      HttpRequestObject.onreadystatechange = function() {
+			         if(HttpRequestObject.readyState == 4 && HttpRequestObject.status == 200) {
+			            var response = HttpRequestObject.responseText;
+			            var elem = response.split('#');
+			            var progress = elem[0];
+			            var url =elem[1];
+			            var message=elem[2];
+			            
+			            document.getElementById('pb_inner').style.width = progress + '%';
+			            document.getElementById('pb_inner').innerHTML = progress + '%';
+			           
+			            if(progress < 100) {
+			               
+			               setTimeout('getProgress("' + uid + '")', 100);
+			                
+			            } else {
+				            if(message !=='') {
+				            	document.getElementById('pb_outer').style.display = 'none';
+				            	document.getElementById('pb_inner').style.width = 'none';
+				           		alert(message);
+				            } else {
+					            document.getElementById('pb_inner').innerHTML = 'Upload Complete!';
+					            document.location.href= url; 
+				            }
+			            }
+			         }
+			      }
+			      
+			      HttpRequestObject.send(null);
+			   }
+			}
+			
+			function showLoader() {
+				document.getElementById('loader').innerHTML = "Veuillez patienter ...  ";
+				
+				
+			}
+			
+		</script>
+	</head>
+	<body id="main_body">
+  		<img id="top" src="images/top.png" alt="">
+		<div id="form_container">
+			<h1><img src="images/tetaneutral.png"></h1>
+		
+	    	<form onSubmit="startProgress('<?php echo $uid; ?>');" action="uploadTest.php" method="post" class="appnitro" enctype="multipart/form-data" name="upload" id="upload" target="upload_frame">
+				 <h2>Ajouter un nouveau panorama</h2>
+										
+			<ul>
+				<li id="li_1" >
+					<label for="file" class="description">Envoyer le fichier :</label>
+					<div>
+			        <input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="<?php echo $uid; ?>" />
+			        <input type="file" name="file" id="file" />
+			   	 	</div>  
+				</li>
+				
+				<li class="buttons">
+	        		<input type="submit" name="submit" id="submit" value="Submit" />
+	        	</li>
+			</ul>
+			</form>
+			<!-- Fin du formulaire -->
+			<div id="footer">
+				<a href="./index.php">Retour liste</a>
+			</div>
+		</div>
+		<div id="infoSize">
+		<img src="images/bulle.png" id="bulle"/>
+		<label id="txtInfo">Le fichier à envoyer doit etre une image de type .tif ou .jpeg<br />
+        Taille maximale : 300 Mo</label>
+    	</div>
+		<!-- Barre d'upload -->
+		<div id="pb_outer">
+  		<div id="pb_inner"></div>
+  		</div>
+  		<p id="info"></p>
+	  
+	  <iframe style="display: none" id="upload_frame" name="upload_frame"></iframe>
+	 
+    <?php 
+    
+    /*******************************************************************
+     * Permet d'afficher l'image uploadée sur le serveur
+     *******************************************************************/
+
+    if(isset($_GET['img']) && isset($_GET['dir'])){
+  
+    	apc_delete('link');   // Suppression de la variable cache.
+    	
+    	$image_name = htmlspecialchars($_GET['img']);
+    	$dir_image = htmlspecialchars($_GET['dir']);
+    	
+        $basename = basename($_GET['img']);
+    	$filePartArr = explode('.', $basename);  
+        $ext = $filePartArr[count($filePartArr) - 1];
+	if($ext=="tif"){
+		$basename = basename($_GET['img'],".tif");
+	}else if($ext=="jpeg"){
+	      $basename = basename($_GET['img'],".jpeg");
+       	} else {
+	      $basename = basename($_GET['img'],".jpg");
+	} 
+    	        //Permet d'afficher l'image après uptload ( Conversion des .tiff et .jpg pour affichage dans le navigateur )
+		$input = 'convert /var/www/data/tsf2/vpongnian/panorama/upload/'.$_GET['img'].' -resize 10% /var/www/data/tsf2/vpongnian/panorama/upload/'.$basename.'.jpg'; // Adapter les chemins absolus ou relatifs
+		$escaped_command = escapeshellcmd($input);
+		$output = shell_exec($escaped_command);
+		echo "<pre>$output</pre>\n";
+		
+    ?><div id="genererPano">
+		<form enctype="multipart/form-data" action="<?php echo "envoyer.php"/*htmlspecialchars($_SERVER['PHP_SELF'])*/; ?>" method="post" onSubmit="showLoader()">
+		  <p>
+		    <label id="l_generer" for="no" title="Génerer le panoramique">Generer le panoramique :</label>
+		    <input type="hidden" name="image_name" value="<?php echo $image_name; ?>" />
+		    <input type="submit" name="no" value="pas maintenant"/>
+		    <input type="submit" name="yes" value="oui" />
+		    <label id="loader"></label>
+		  </p>
+		</form>
+	  </div>
+    <?php 
+   
+    echo "<img src=/data/tsf2/vpongnian/panorama/upload/".$basename.".jpg id='imageUpload'/>";
+    }  
+    if (isset($_POST['no'])) {
+		header("Location: ./index.php"); /* Redirection du navigateur */
+		exit;
+	} 
+	if (isset($_POST['yes'])) {
+		header("Location: ./genererPano.php?name=".$_POST['image_name']);
+		exit;
+	}
+    ?>
+   
+  </body>
+</html>
\ No newline at end of file
diff --git a/genererPano.php b/genererPano.php
new file mode 100644
index 0000000..847ad22
--- /dev/null
+++ b/genererPano.php
@@ -0,0 +1,40 @@
+<?php
+	if (isset($_GET['name'])) {
+		// Protection de la variable GET
+		$pano_name = htmlspecialchars($_GET['name']);
+		$filePartArr = explode('.',$pano_name);  
+		$ext = $filePartArr[count($filePartArr) - 1];
+		if($ext=="tif"){
+			$pano_basename = basename($pano_name,".tif");
+		}else if($ext=="jpeg"){
+		      $pano_basename = basename($pano_name,".jpeg");
+		} else {
+			$pano_basename = basename($pano_name,".jpg");
+		} 
+
+		//Partie exécutante du script gen_tiles qui gènere les tuiles à partir d'une image.
+		$input = './to_tiles/gen_tiles.sh -p '.$pano_basename.' /var/www/data/tsf2/vpongnian/panorama/upload/'.$pano_name;
+		$escaped_command = escapeshellcmd($input);
+		$output = shell_exec($escaped_command);
+		$log_file = fopen('./log/'.$pano_basename.'.log','a+');
+		fputs($log_file, $output);   // verbose intégré dans un .log.
+		fclose($log_file);
+		
+                // Ouverture d'un nouveau dossier qui contiendra toutes les tuiles.
+		$dir = '/var/www/data/tsf2/tiles/'.$pano_basename;
+		
+		mkdir($dir,0777);
+		
+		$dir_fd = opendir('/var/www/data/tsf2/vpongnian/panorama');
+		
+		while (false !== ($image_name = readdir($dir_fd))) {
+	    	        // Déplacement des tuiles dans le nouveau dossier à partir de dir_fd.
+			if(preg_match('/(.*)_[0-9]+_[0-9]+_[0-9]+\.jpg$/', $image_name, $reg)) {
+	        	rename("./".$image_name, $dir."/".$image_name);
+	    	}
+	    	
+	    }
+	    closedir($dir_fd);
+	    header("Location: ./index.php?");
+	}
+?>
\ No newline at end of file
diff --git a/getprogress.php b/getprogress.php
new file mode 100644
index 0000000..51ecf89
--- /dev/null
+++ b/getprogress.php
@@ -0,0 +1,11 @@
+<?php
+header('Expires: Tue, 08 Oct 1991 00:00:00 GMT');
+header('Cache-Control: no-cache, must-revalidate');
+
+if(isset($_GET['uid'])){
+   $status = apc_fetch('upload_' . $_GET['uid']);
+   $url = apc_fetch('link');
+   $message = apc_fetch('info');
+   echo round($status['current']/$status['total']*100)."#".$url."#".$message;
+}
+?>
\ No newline at end of file
diff --git a/images/bottom.png b/images/bottom.png
new file mode 100644
index 0000000..7f46c80
Binary files /dev/null and b/images/bottom.png differ
diff --git a/images/bulle.png b/images/bulle.png
new file mode 100644
index 0000000..53724ea
Binary files /dev/null and b/images/bulle.png differ
diff --git a/images/loader2.gif b/images/loader2.gif
new file mode 100644
index 0000000..6bdc3b5
Binary files /dev/null and b/images/loader2.gif differ
diff --git a/images/locapoint.svg b/images/locapoint.svg
new file mode 100644
index 0000000..f439f5f
--- /dev/null
+++ b/images/locapoint.svg
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   width="34.368469"
+   height="63.25069"
+   id="svg2">
+  <metadata
+     id="metadata8">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs6" />
+  <path
+     d="M 17.22788,62.750691 C 16.126185,55.865098 17.254492,46.698747 6.4863542,33.14264 -4.2817838,19.586533 -0.41736984,0.86394177 17.22788,0.50492817 34.873129,0.14591457 38.539189,19.479763 27.969405,33.14264 17.399621,46.805517 17.503304,55.589674 17.22788,62.750691 z"
+     id="path2987"
+     style="fill:#fa7a6f;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+  <path
+     d="m 27.542374,21.069916 a 8.125,8.675848 0 1 1 -16.25,0 8.125,8.675848 0 1 1 16.25,0 z"
+     transform="translate(-2.2331398,-2.2493091)"
+     id="path2989"
+     style="fill:#000000;fill-opacity:1;stroke:none" />
+</svg>
diff --git a/images/tetaneutral.png b/images/tetaneutral.png
new file mode 100644
index 0000000..d1285a7
Binary files /dev/null and b/images/tetaneutral.png differ
diff --git a/images/top.png b/images/top.png
new file mode 100644
index 0000000..48749b7
Binary files /dev/null and b/images/top.png differ
diff --git a/images/tsf.png b/images/tsf.png
old mode 100644
new mode 100755
diff --git a/js/hide_n_showForm.js b/js/hide_n_showForm.js
new file mode 100644
index 0000000..9ae4f74
--- /dev/null
+++ b/js/hide_n_showForm.js
@@ -0,0 +1,31 @@
+function showForm() { 
+  
+    var displayAddParams = document.getElementById('addParams');
+    var displayAdding = document.getElementById ('adding');
+    displayAddParams.style.visibility = 'hidden';
+    displayAdding.style.visibility = 'visible'; 
+} 
+  
+function hideForm() { 
+      
+    var displayAddParams = document.getElementById('addParams');
+    var displayAdding = document.getElementById ('adding');
+    displayAddParams.style.visibility = 'visible';
+    displayAdding.style.visibility = 'hidden';
+} 
+  
+function showLoca() { 
+      
+    var displayloca = document.getElementById('loca');
+    var putDraw = document.getElementById ('locadraw');
+    displayloca.style.visibility = 'hidden';
+    putDraw.style.visibility = 'visible'; 
+} 
+  
+function hideLoca() { 
+      
+    var displayloca = document.getElementById('loca');
+    var putDraw = document.getElementById ('locadraw');
+    displayloca.style.visibility = 'visible';
+    putDraw.style.visibility = 'hidden';
+} 
\ No newline at end of file
diff --git a/js/pano_deroulant.js b/js/pano_deroulant.js
new file mode 100644
index 0000000..25d3d20
--- /dev/null
+++ b/js/pano_deroulant.js
@@ -0,0 +1,153 @@
+	
+	function getInfoBox(element) {
+	    
+        while (element = element.nextSibling) {
+            if (element.className === 'infobox') {
+                return element;
+            }
+        }
+         
+        return false;
+     
+    }
+	
+	 // Fonctions de vérification du formulaire, elles renvoient « true » si tout est OK
+    
+    var check = {}; // On met toutes nos fonctions dans un objet littéral
+     
+	check['param_title'] = function() {
+	        
+	        var title = document.getElementById('param_title');
+	        
+	        if (title.value.length >= 4) {
+	            title.className = 'correct';
+	            
+	            return true;
+	        } else {
+	            title.className = 'incorrect';
+	            
+	            return false;
+	        }
+	};
+        
+    check['param_latitude'] = function() {
+        
+        var latitude = document.getElementById('param_latitude');
+        var lat = parseFloat(latitude.value);
+       
+        if (!isNaN(lat) && lat >= -90 &&  lat <= 90) { 
+            latitude.className = 'correct';
+           
+            return true;
+        
+        } else {
+            latitude.className = 'incorrect';
+           
+            return false;
+        }
+     
+    };
+    
+    check['param_longitude'] = function() {
+        
+        var longitude = document.getElementById('param_longitude');
+        var lon = parseFloat(longitude.value);
+        	
+        if (!isNaN(lon) && lon >= -180 &&  lon <= 180) {
+            longitude.className = 'correct';
+            
+            return true;
+        
+        } else {
+            longitude.className = 'incorrect';
+            
+            return false;
+        }
+     
+    };
+    
+    check['param_altitude'] = function() {
+        
+        var altitude = document.getElementById('param_altitude');
+        var alt = parseInt(altitude.value);
+        
+        if (!isNaN(alt) && alt >= 0 && alt <= 10000) {
+            altitude.className = 'correct';
+            
+            return true;
+        
+        } else {
+            altitude.className = 'incorrect';
+            
+            return false;
+        }
+     
+    };
+    
+    check['param_elevation'] = function() {
+        
+    	
+        var elevation = document.getElementById('param_elevation');
+        var ele = parseFloat(elevation.value);
+        
+        if (!isNaN(ele) && ele >= -10 &&  ele <= 10) {
+            elevation.className = 'correct';
+           
+            return true;
+        
+        } else {
+            elevation.className = 'incorrect';
+            
+            return false;
+        }
+     
+    };
+    
+    (function() { // Utilisation d'une fonction anonyme pour éviter les variables globales.
+        
+        var form_param = document.getElementById('form_param'),
+            inputs = document.getElementsByTagName('input'),
+            inputsLength = inputs.length;
+    
+        for (var i = 0 ; i < inputsLength ; i++) {
+        	
+	            if (inputs[i].type == 'text') {
+	     		
+	                inputs[i].onkeyup = function() {
+	                    check[this.id](this.id); // « this » représente l'input actuellement modifié
+	                };
+	     
+	            }
+        	
+        }
+     
+        form_param.onsubmit = function() {
+     
+            var result = true;
+     
+            for (var i in check) {
+       		
+                result = check[i](i) && result;	
+            }
+     
+            if (result) {
+                alert('Le formulaire est bien rempli.');
+                return true;
+            } else {
+            	
+            return false;
+            }
+     
+        };
+     
+        form_param.onreset = function() {
+     
+            for (var i = 0 ; i < inputsLength ; i++) {
+                if (inputs[i].type == 'text' || inputs[i].type == 'number') {
+                    inputs[i].className = '';
+                }
+            }
+     
+        };
+     
+    })();
\ No newline at end of file
diff --git a/uploadTest.php b/uploadTest.php
new file mode 100644
index 0000000..057e533
--- /dev/null
+++ b/uploadTest.php
@@ -0,0 +1,92 @@
+<?php
+ 
+// Constantes
+define('TARGET', '/var/www/data/tsf2/vpongnian/panorama/upload/');    // Repertoire cible
+define('MAX_SIZE', 300000000);    // Taille max en octets du fichier
+define('WIDTH_MAX', 200000);    // Largeur max de l'image en pixels
+define('HEIGHT_MAX', 100000);    // Hauteur max de l'image en pixels
+
+
+// Creation du repertoire cible si inexistant
+
+/*if( !is_dir(TARGET) ) {
+  if( !mkdir(TARGET, 0755) ) {
+    exit('Erreur : le répertoire cible ne peut-être créé ! Vérifiez que vous diposiez des droits suffisants pour le faire ou créez le manuellement !');
+  }
+}
+*/
+
+// Script d'upload
+
+	// Variables
+	$extension = '';
+	$message = '';
+	$nomImage = '';
+	$url='';
+	$already=false;
+	
+	// Tableaux de donnees
+	$tabExt = array('jpeg','tif','jpg');    // Extensions autorisees
+	$infosImg = array();
+	$stats = array();
+	
+	
+	if(!empty($_POST))
+	{
+		
+	  // On verifie si le champ est rempli
+	  if( !empty($_FILES['file']['name']) )
+	  {
+	  	
+	    // Recuperation de l'extension du fichier
+	    $extension  = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
+	 
+	    // On verifie l'extension du fichier
+	    if(in_array(strtolower($extension),$tabExt))
+	    {
+	      // On recupere les dimensions du fichier
+	      $infosImg = getimagesize($_FILES['file']['tmp_name']);
+	 
+	      // On verifie les dimensions et taille de l'image
+	      if(($infosImg[0] <= WIDTH_MAX) && ($infosImg[1] <= HEIGHT_MAX) && (filesize($_FILES['file']['tmp_name']) <= MAX_SIZE))
+	      {
+	        // Parcours du tableau d'erreurs
+	        if(isset($_FILES['file']['error']) 
+	          && UPLOAD_ERR_OK === $_FILES['file']['error'])
+	        {
+	          // On bouge le fichier uploadé dans un répertoire a son nom
+	          // on garde en cache la variable $url qui permettra de passer sur une page envoyer.php plus avancée.
+	 	
+	          $err = $_FILES['file']['error'];
+		    echo "<script>alert(\"$err\");</script>";
+	            $url ="envoyer.php?dir=upload/".$_FILES['file']['name']."&img=".$_FILES['file']['name'];
+	            move_uploaded_file($_FILES['file']['tmp_name'],TARGET.basename($_FILES['file']['name']));
+				apc_store('link', $url);
+				
+	        }
+	        else
+	        {
+	        	$message = 'Une erreur interne a empêché l\'uplaod de l\'image : '. $_FILES['file']['error'];
+	        }
+	      }
+	      else
+	      {
+	        // Sinon erreur sur les dimensions et taille de l'image
+	        $message = 'Erreur dans les dimensions de l\'image !';  
+	      }
+	    }
+	    else
+	    {
+	      // Sinon on affiche une erreur pour l'extension
+	      $message = 'L\'extension du fichier est incorrecte !';
+	    }
+	  }
+	  else
+	  {
+	    // Sinon on affiche une erreur pour le champ vide
+	 	$message = 'Veuillez remplir le formulaire svp !';
+	  }
+	  // On met en cache un message d'erreur.
+	  apc_store('info', $message);
+	}
+?>
\ No newline at end of file
