-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage.html
75 lines (66 loc) · 3.12 KB
/
message.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/easyui/bootstrap/easyui.css">
<link rel="stylesheet" href="css/easyui/icon.css">
<script src="js/jquery-3.3.1.js"></script>
<script src="css/easyui/jquery.easyui.min.js"></script>
<script src="css/easyui/easyui-lang-zh_CN.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/admin.css">
<title>Document</title>
</head>
<body>
<div class="page-header">
<h1>后台管理</h1>
</div>
<div class="content">
<div class="aside">
<ul class="nav nav-pills nav-stacked">
<li role="presentation"><a href="admin.html">信息管理</a></li>
<li role="presentation"><a href="history.html">销售记录</a></li>
<li role="presentation" class="active"><a href="message.html">留言管理</a></li>
<li role="presentation"><a href="addproduct.html">添加货物</a></li>
</ul>
</div>
<div class="list">
<table id="dg" class="easyui-datagrid" style="width:100%;" title="客户信息" data-options="height:300,url:'php/showassess.php',pagination:true,fitColumns:true,singleSelect:true" toolbar="#tb">
<thead>
<tr>
<th data-options="field:'id',width:'15%'">编号</th>
<th data-options="field:'company',width:'15%'">公司名称</th>
<th data-options="field:'content',width:'20%'">评价内容</th>
<th data-options="field:'grade',width:'20%'">评论分类</th>
<th data-options="field:'isshow',width:'10%'">是否显示</th>
</tr>
</thead>
</table>
<div id="tb">
<div class="easyui-linkbutton" data-options="plain:true">更改显示状态</a>
</div>
</div>
<script>
var x = document.querySelector('#tb div');
x.addEventListener("click", function() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
// console.log(xhr.response);
// alert(xhr.response);
if (xhr.response == "success") {
$.messager.alert('提示', '展示状态修改成功!');
$("#dg").datagrid('reload');
} else {
$.messager.alert('提示', '修改提交失败!');
}
}
}
xhr.open("GET", `php/changeshow.php?key=${$('#dg').datagrid('getSelected')['id']}&state=${$('#dg').datagrid('getSelected')['isshow']}`, true);
xhr.send();
}, false);
</script>
</div>
</body>
</html>