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
| <?php
$table_ref = array (
1 => 'un' ,
2 => 'deux' ,
3 => 'trois' ,
4 => 'quatre' ,
5 => 'cinq' ,
6 => 'six' ,
7 => 'sept Sécurité' ,
8 => 'huit' ,
9 => 'neuf' ,
10 => 'dix',
11 => 'onze'
) ;
function listbox ( $name , $array_value = array() , $array_selected , $multiple = 0 , $size = 1 )
{
$select = '<select' . ( ( $multiple == 1 ) ? ' multiple name="' . $name . '[]"' : ' name="' . $name . '"' ) .
' size="' . $size . '">' . "n" ;
foreach ( $array_value as $key => $value )
{
$select .= '<option value="' . $key . '"' .
( ( $multiple == 1 ) ? ( in_array ( $key , $array_selected ) ? ' selected="selected"' : '' ) :
( $key == $array_selected ? ' selected="selected"' : '' ) ) .
'>' . $value . '</option>' . "n" ;
}
$select .= '</select>' ;
return $select ;
}
print("
<!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=\"en\">
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />
<meta name=\"description\" content=\"description\" />
<meta name=\"keywords\" content=\"keywords\" />
<meta name=\"author\" content=\"your-name / test /\" />
<title></title>
</head>
<body>
<form>
");
//echo listbox ( 'table_ref' , $table_ref , ( isset ( $_POST['table_ref'] ) ? $_POST['table_ref'] : 1 ) ) ;
echo listbox ( 'table_ref' , $table_ref , 1 ) ;
echo '<a href="upd_gen_reef.php?tb_ref='.$table_ref[0].'">Valider</a>';
print("
</form>
</body>
</html> ");
?> |
Partager