<?php
	require("§lib_inc.php");
?>
<HTML>
<BODY BGCOLOR=#FFFFFF FGCOLOR=0 background='fond.png'>
<form method="post" action="§save_param.php">
<?php
	echo "<CENTER><H1>";	
	display_lng_text("ADM_PARAM");
	echo "</H1>";

	echo "<table border=1 cellspacing=0><tr><th>";
	display_lng_text("ADM_PARAM_TYPE");
	echo "</th><th>";
	display_lng_text("ADM_PARAM_VALUE");
	echo "</th></tr>";
	$sql_query = "SELECT DISTINCT name FROM oxg_ref_param";
	$result = mysql_query($sql_query) or mysql_die();
	while($row = mysql_fetch_array($result))
	{
		echo "<tr><td>$row[name]</td>";
		echo "<td><select name='$row[name]'>";
		$sql_query = "SELECT oxg_ref_param.value ref_val, oxg_param.value FROM oxg_param RIGHT JOIN oxg_ref_param ON oxg_ref_param.name=oxg_param.name WHERE oxg_ref_param.name='$row[name]'";
		$result_val = mysql_query($sql_query) or mysql_die();
		while($row_val = mysql_fetch_array($result_val))
		{
			if($row_val[ref_val]==$row_val[value])
			{
				echo "<OPTION selected>";
			}
			else
			{
				echo "<OPTION>";
			}
			echo "$row_val[ref_val]</OPTION>";
		}
		echo "</select>";
		echo "</td></tr>";
	}
?>
</TABLE><br>
<input type="submit" value="OK">
</form>
</CENTER>
<br><br>
<?php
	affiche_pied_page_admin(true);
?>
</BODY>
</HTML>