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
| <?php
include 'connect.inc.php';
if(isset($_GET['code_para']))
$requete="SELECT donnees,code_para,date_creation FROM paragraphes WHERE code_para=".$_GET['code_para'] ;
else
$requete="SELECT donnees,code_para,date_creation FROM paragraphes ";
$resultat=mysql_query($requete);
//--------------requête du menu
$requete2="SELECT code_para FROM paragraphes ";
$resultat2=mysql_query($requete2);
?>
<!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>Document sans nom</title>
</head>
<body>
<form id="form1" name="form1" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<label>Sélectionnez un code paragraphe:
<select name="code_para" id="code_para">
<?php while($code_para=mysql_fetch_array($resultat2)) { ?>
<option <?php if(!isset($_GET['code_para'])) $_GET['code_para']=1; if($code_para['code_para']==$_GET['code_para']) echo "selected='selected'"; ?> value="<?php echo $code_para['code_para']; ?>"><?php echo $code_para['code_para']; ?></option>
<?php } ?>
</select>
</label>
<label>
<input type="submit" name="bouton" id="bouton" value="Envoyer" />
</label>
</form>
<table width="600" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>Référence</td>
<td>Prix</td>
<td>Voir la fiche</td>
</tr>
<?php while($paragraphe=mysql_fetch_array($resultat)) { ?>
<tr>
<td><?php echo $paragraphe['donnees']; ?></td>
<td><?php echo $paragraphe['code_para']; ?></td>
<td><?php echo $paragraphe['date_creation']; ?></td>
<td><a href="fiche5.php?code_para=<?php echo $paragraphe['code_para']; ?>" >Voir</a></td>
</tr>
<?php } ?>
</table>
</body>
</html> |
Partager