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
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> <!--obligatoire sur chaque page-->
<link rel="stylesheet" href="design.css"/>
<title>titre</title>
<script type="text/javascript">
function myfunction()
{
choice = document.getElementById("list_imm").selectedIndex;
$valueChoice = document.getElementById("list_imm").options[choice].value;
if (choice!=0) {
<?php
$base = new PDO('mysql:host=localhost;dbname=GPi_WEB;charset=utf8','root','');
$sql2 = $base->query("SELECT societe FROM 0tbl_imm WHERE imm_id ='".$valueChoice."'");
$donnees2 = $sql2->fetch();
$sql2->closecursor();
?>
document.getElementById("sit_sté").value=$donnees2['societe'];
}
}
</script>
</head>
<body>
<label site for="list_imm">Site</label>
<select id="list_imm" style="width:80%" onChange="myfunction()">
<option value="vide">- - - Choisissez une région - - -</option>
<?php foreach ($data as $row): ?>
<option value="<?php echo($row['imm_id']);?>"><?php echo($row['nomsite']); ?></option>
<?php endforeach ?>
</select><br/><br/>
<label>Société </label><input type="text" name="sit_sté" id='sit_sté' value="" disabled style="width:80%"><br/><br/>
<input type="submit" name="ope_valid" id='ope_valid' value="Demande validation..." style="width:20%">
<input type="submit" name="ope_annul" id='ope_annul' value="Annuler demande" style="width:20%" onclick="location.href = 'Pg00_TableauBoard.php'">
</body>
</html> |