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
|
<?php
$host='****';
$user='***';
$pass='';
$dbase='*****';
?>
<script type='text/javascript'>
function verifier()
{var a=document.getElementById('local');
var b=document.getElementById('client');
if(a.options[a.selectedIndex].value=='-1' || b.options[b.selectedIndex].value=='-1')
{
alert('Selection incorrecte');
return false;
}
return true;
}
</script>
<form action="tableau.php" method="post">
<fieldset>
<tr>
<td>
<label><strong><font color="blue">Localisation :</font></strong></label>
<select name="Loc" id="local">
<option value='-1'>choisir localisation</option>
<?php
mysql_connect('localhost' , 'root' , '');
mysql_select_db('command');
$resultat1 = mysql_query ("SELECT Distinct Localisation FROM client");
while ($row=mysql_fetch_array($resultat1))
{
echo '<option value="'.$row['Localisation'].'">' .$row['Localisation'].'</option>';
}
?>
</select> </td> </tr>
<tr><td>
<label><strong><font color="blue">Client :</font></strong></label>
<select name="clt" id="client">
<option value='-1'>choisir client</option>
<?php
$resultat2 = mysql_query("SELECT Distinct SortClt FROM client");
while ( $row = mysql_fetch_array($resultat2))
{
echo '<option value="' . $row['SortClt'] . '">' . $row['SortClt'] . '</option>';
}
?>
</select> </td> </tr>
<br/>
<br/>Lister les clients.
<input type="hidden" name="btok" />
<input type="submit" value="Valider" onsubmit="verifier()">
<input type='reset' value='Retablir'/>
</fieldset>
</form> |