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
|
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Modification</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
function showUF(str) {
if (str == "") {
document.getElementById("txtHint").innerHTML = "";
return;
} else {
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("txtHint").innerHTML = this.responseText;
}
};
xmlhttp.open("GET","getUF.php?q="+str,true);
xmlhttp.send();
}
}
</script>
<style type="text/css">
.button{
visibility: hidden;
}
</style>
</head>
<body>
<?php
$link = mysqli_connect('localhost', 'root', '', 'etiquettes');
if (!$link) {
die('Could not connect: ' . mysqli_error($link));
}
$sql = "SELECT UF, id FROM table_etiquettes ORDER BY IF(UF RLIKE '^[a-z]', 1, 2), UF";
$result = mysqli_query($link, $sql);
?>
<div id='align'>
<form action='modifOK.php' method='post'>
UF :
<select style="height: 35px; font-size:18px" name="UFModif" onchange="showUF(this.value)">
<?php
while($row=mysqli_fetch_array($result)){
echo "<option value='" . $row['id'] . "'>" . $row['UF'] . "</option>";
}
?>
</select>
Libelle :
<input style="height: 35px; font-size:18px" type='text' name='LibelleModif'/>
Livraison :
<input style="height: 35px; font-size:18px" type='text' name='LivraisonModif'/>
</div>
<br>
<div id="preview">Preview de l'UF à modifier : </div>
<br><br>
<div id="txtHint"></div>
<br>
<input type='submit' class='button-3' value='Modifier'>
</form>
<br>
<br><br>
<div id='index'><a href='index.php'>Retour à l'index</a></div>
</body>
</html> |
Partager