1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function creat_menu(champ)
{
for(i=0;i<document.getElementById('menu_2').length;i++)
{
document.getElementById('menu_2').options[i] =null;
}
form1.submit();
}
function creat_menu_2(champ)
{
form1.submit();
}
</SCRIPT>
</head>
<BODY onresize="">
<FORM Method=POST NAME="form1">
<?
Define("MYSQL_HOST", "localhost");
Define("MYSQL_USER", "root");
Define("MYSQL_PWD", "");
Define("MYSQL_BDD", "db_mag");
$connect = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PWD);
mysql_select_db(MYSQL_BDD, $connect); //On sélectionne la base de données
$tables = mysql_query("Select ID_Unit from t_unit;");
echo "<SELECT NAME='menu' width='30px' onChange='creat_menu(this)'>\n";
while($tables_array = mysql_fetch_row($tables))
{
echo $tables_array[0];
if($tables_array[0]==$_POST["menu"])
{
echo '<option value="'.$tables_array[0].'" selected>'.$tables_array[0].'</option>';
}
else
{
echo '<option value="'.$tables_array[0].'">'.$tables_array[0].'</option>';
}
}
echo "</SELECT>";
if(!empty($_POST["menu"]))
{
echo $_POST["menu"];
//$connect = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PWD);
mysql_select_db(MYSQL_BDD, $connect); //On sélectionne la base de données
$sql="Select ID_Essai from t_essai where ID_Unit='".$_POST["menu"]."'";
$tables_2 = mysql_query($sql);
echo "<SELECT name='menu_2' width='30px' onChange='creat_menu_2(this)'>\n";
while($tables_array_2 = mysql_fetch_row($tables_2))
{
echo $tables_array_2[0];
if($tables_array_2[0]==$_POST["menu_2"])
{
echo '<option value="'.$tables_array_2[0].'" selected>'.$tables_array_2[0].'</option>';
}
else
{
echo '<option value="'.$tables_array_2[0].'">'.$tables_array_2[0].'</option>';
}
}
echo "</SELECT>";
}
else
{
echo "<SELECT name='menu_2' width='30px' onChange='creat_menu_2(this)'>\n";
echo "</SELECT>";
}
if(!empty($_POST["menu_2"]))
{
echo $_POST["menu_2"];
mysql_select_db(MYSQL_BDD, $connect); //On sélectionne la base de données
$sql="Select Chemin_Video from t_video where ID_Essai='".$_POST["menu_2"]."'";
$tables_3 = mysql_query($sql);
echo "<SELECT name='menu_3' width='30px' onChange=''>\n";
while($tables_array_3 = mysql_fetch_row($tables_3))
{
echo $tables_array_3[0];
echo '<option value="'.$tables_array_3[0].'">'.$tables_array_3[0].'</option>';
}
echo "</SELECT>";
}
else
{
echo "<SELECT name='menu_3' width='30px' onChange=''>\n";
echo "</SELECT>";
}
mysql_close($connect);
?>
<input type="submit" class="submit" value="ok" />
</FORM>
</BODY>
</html> |
Partager