<?php

	session_start();
	
	$_SESSION['database']="local";
	
	if($_SESSION['database']=="local")
	  {
	     $db_host    = "localhost";
	     $db_user   = "root";
	     $db_pass   = "";
     	     $db_name   = "boutique";

	 }
	
	if($_SESSION['database']=="public")
	  {
  	     $db_host    = "sql2";
   	     $db_user   = "analogde";
 	     $db_pass   = "rainbow";
    	     //$db_type   = "mysql";
	     $db_name   = "analogde";
	 }


	if(isset($_GET['action'])) 
          {
            if($_GET['action'] == "charger")
              { echo "choix";
              }		
          }	


	 if( isset($_POST['selection_fichier']) && !empty($_POST['selection_fichier']) ) 
	   {    $nom = $_POST['selection_fichier'];
	   	 echo $nom ." boite";
	   	 echo "<script>initialize($nom)</script>";
	   }	

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Administration :: Patrice Delpy</title>

<link rel="stylesheet" href="../default.css" type="text/css">

<style type="text/css">

body
{
	margin:24px;
}

</style>

<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript" src="dynamic-select.js"></script>

</head>

<body>

<div id="header"><h1>Administration</h1>
<div class="membre">Vous Ãªtes connectÃ© en tant que <b><?php echo $_SESSION['admin_identifiant']; ?> </b></div>
</div>

<?php include('../menu.php'); ?>





		<div class="heading">Liste des fichiers</div>
		<div id="list">
		<table class="list">
	        <tr>
	        <th align="center" width="1%">&nbsp;</th>
	        <th align="center" width="1%">&nbsp;</th>
	        <th align="center" width="1%">&nbsp;</th>
		<th width="*%" align="left">Nom du fichier</th>
		</tr>


<?php

		$folder = "./";
		$dossier = opendir($folder);
	
		while($fichier = readdir($dossier))
	     	{
  	      		if($fichier != "." && $fichier != "..")
  	       		  {
    		 		//$nomFichier = $folder."/".$Fichier;
    		 		//echo $nomFichier."<BR>";
		 		//echo $fichier."<BR>";
		 		
		 		echo "	
		       		<tr class=\"row2\" onmouseover=\"this.className='highlight'\" onmouseout=\"this.className='row2'\">
		       		
				<td align=\"center\">
				<a href=\"#\" onclick=\"initialize('$fichier')\">
				<img src=\"charger.png\" border=\"0\" alt=\"Charger\" title=\"Charger\" />
				</a>
				</td>

				<td align=\"center\">
				<a href=\"edition.php\">
				<img src=\"../update.png\" border=\"0\" alt=\"Editer\" title=\"Editer\" />
				</a>
				</td>
		
				<td align=\"center\">
				<a href=\"envoi_email.php\">
				<img src=\"../email_send.png\" border=\"0\" alt=\"Effacer\" title=\"Effacer\" />
				</a>
				</td>

		 		<td align=\"left\" nowrap=\"nowrap\">$fichier</td> " ;
		 		
  	       		  }
            	}
		
		//<select name="selection_fichier" size="1" onChange="submit()">
		
		
?>


<?php	
/*		<FORM ACTION="test.php" name="formulaire">
		
		<SELECT size=1 onchange="passage()"> name=select_ville > 
		<option value="X">--[ SELECTION ]--</option>
		*/
?>


<?php

		//<SELECT size=1 onchange="passage(this.options[this.selectedIndex].text)"> name=select_ville > 
		
/*		$folder = "./";
		$dossier = opendir($folder);
		
		while($fichier = readdir($dossier))
	     	{
  	      		if($fichier != "." && $fichier != "..")
  	       		  {
		 		 echo "<option value=$fichier >$fichier</option>";
  	       		  }
            	}
		
		echo "			
		        </select>
			</form></div> ";
		
		closedir($dossier);*/


?>


		<form id="dynsel" name="dynsel" method="post" action="test.php">

  		<table width="743" border="0" cellspacing="0" cellpadding="8">
    		<tr>
      		<td width="223">
        	<div align="center">
          	<select name="select1" if="toolist"   size="10"  style="width:380px" style="height:250px"multiple onchange="selectoption();" >
            	<option>Empty</option>
          	</select>
        	</div></td>
		<td width="488">

         
		<input name="title" type="text" id="title"  value="" size="24"  />
		<input type="button" name="clear" value="X"  onclick='document.dynsel.title.value="";'  />
		<input type="button" name="add"  style="width:140px" value="Ajouter au select" onclick="addoption()"  />
		<br /><br  />
 
		<input type="button" name="del"  style="width:120px" value="Supprimer" onclick="deloption()"  />
		<span  style="margin-left:16px" >Supprimer l'option s&eacute;lectionn&eacute;e </span>

		<br />
		<br />

		<input type="button" name="del2"  style="width:120px" value="Remonter" onclick="moveup()"  />
		<span  style="margin-left:16px" >Remonter l'option dans la liste </span>
            
            	<br />
		<br />
            
		<input name="changer_nom" type="text" id="changer_nom"  value="" size="24"  />
		<input type="button" name="add"  style="width:140px" value="Nouveau nom"  onclick="sauver_sous(this)"  />
		<br /><br  />

		</td>
		</tr>
		
		
		</table>

  		<p>
  		<div align="center">
    		<input type="button" name="SubmitSave" value="Sauver la liste d'options"
    		title="Save the list in a file to be used by the tabpanel" onclick="savelist(this)" />
    		</div>
  		</p>



</form>

<br />
<hr />


<?php
/*<FORM>
<P>Selectionner une option différente dans cette
   cartouche à liste de choix déroulante pour déclencher 
   l'événement <B><FONT COLOR="#FF0000">onchange
   </FONT></B>.<P>
   
  <SELECT NAME=selTest 
  onchange="alert('Index: ' + this.selectedIndex + '\nValeur: ' + 
  this.options[this.selectedIndex].value)">
    <OPTION VALUE="Lapins">Lapins
    <OPTION VALUE="Poulets">Poulets
    <OPTION VALUE="Canards">Canards
  </SELECT>
</FORM>*/

?>




</html>
