-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
134 lines (118 loc) · 3.61 KB
/
home.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="=IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--以上几个是必须的-->
<meta name="description" content="hello">
<meta name="author" content="test">
<link rel="shortcut icon" href="images/favicon.ico" />
<title>账簿管理</title>
<!--inport bootstrap-->
<link href="./bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="signin.css" rel="stylesheet">
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<!-- import echarts -->
<script type="text/javascript" src="js/echarts.js"></script>
</head>
<body>
<!-- /container -->
<div class="container">
<div class="form-signin">
<div class="list-group">
<a href="add_host_follower.html" class="list-group-item">
<span class="glyphicon glyphicon-star">邀请人来</span>
</a>
<a href="#" class="list-group-item">
<span class="glyphicon glyphicon-star">自己来</span>
</a>
</div>
<button onclick="logout()" class="btn btn-sm btn-primary btn-block" type="submit">退出</button>
<button onclick="addressSummary()" class="btn btn-sm btn-primary btn-block" type="submit">汇总</button>
</div>
<div class="container">
<div id="echartsDiv" style="width:100%; height:50%;">
</div>
</div>
</div>
<script>
var tce = echarts.init(document.getElementById('echartsDiv'));
tce.setOption({
title:{
text: '各地来人情况图表',
x: 'center'
},
tooltip:{
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'vertical',
left: 'left',
data: []
},
series: [{
radius: '30%',
type: 'pie',
name: "礼金来源地",
data: []
}]
});
function logout(){
$.ajax({
async: false,
url: "logout.php",
success: function(data, status){
if('success' == status){
if('OK' == data){
window.open("index.html", '_self');
}
else{
alert("退出失败");
}
}
else{
alert("退出失败");
}
}
});
}
function addressSummary(){
$.ajax({
url: 'addressSummary.php',
type: 'post',
dataType: 'JSON',
async: false,
success: function(data, status){
if('success' == status && data.status ){
//alert(JSON.stringify(data));
var seriesData = new Array();
for(var i = 0; i < data.addrs.length; i++){
var per = {
value: data.cnts[i],
name: data.addrs[i]
};
seriesData.push(per);
}
tce.setOption({
legend: {
data: data.addrs
},
series: [{
data: seriesData
}]
});
}
else{
alert("加载数据失败");
}
},
error: function(){
alert("加载数据失败!===================");
}
});
}
</script>
</body>
</html>