You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.9 KiB
58 lines
1.9 KiB
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Настройка</title>
|
|
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
|
|
<link rel="manifest" href="imajes/site.webmanifest">
|
|
<link rel="mask-icon" href="imajes/safari-pinned-tab.svg" color="#5bbad5">
|
|
<meta name="msapplication-TileColor" content="#da532c">
|
|
<meta name="theme-color" content="#ffffff">
|
|
<link href="style.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
|
|
<body id="body">
|
|
<h2 id="h2">ESP32 управляет освещением комнаты</h2>
|
|
<nav id="navigation3"><a href="index.html" title="главное меню">Главное меню</a></nav>
|
|
|
|
|
|
<select id="myselect" onchange="change_myselect(this.value)">
|
|
<option value="">Выберите значение:</option>
|
|
<option value="customers">Покупатели</option>
|
|
<option value="products">Товары</option>
|
|
<option value="suppliers">Поставщики</option>
|
|
</select>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function change_myselect(sel) {
|
|
var obj, dbParam, xmlhttp, myObj, x, txt = "";
|
|
obj = { "table":sel, "limit":20 };
|
|
dbParam = JSON.stringify(obj);
|
|
xmlhttp = new XMLHttpRequest();
|
|
xmlhttp.onreadystatechange = function() {
|
|
if (this.readyState == 4 && this.status == 200) {
|
|
myObj = JSON.parse(this.responseText);
|
|
txt += "<table border='1'>"
|
|
for (x in myObj) {
|
|
txt += "<tr><td>" + myObj[x].name + "</td></tr>";
|
|
}
|
|
txt += "</table>"
|
|
document.getElementById("demo").innerHTML = txt;
|
|
}
|
|
};
|
|
xmlhttp.open("POST", "json_demo_db_post.php", true);
|
|
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
xmlhttp.send("x=" + dbParam);
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|
|
|