forked from fx408/lottery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
119 lines (104 loc) · 4 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>抽奖</title>
<link rel="stylesheet" href="./css/style.css" />
<script type="text/javascript" src="./js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function clickkey()
{
document.getElementById('stop_button').accessKey="w"
}
</script>
</head>
<body onload="clickkey()">
<body>
<div id="user_list" class="user_list">
<canvas id="tutorial"></canvas>
<div id="stop_button"><a href="javascript:;">STOP</a></div>
</div>
<div id="winner_list">
<div class="winner_title">获奖名单</div>
<div class="winner_table">
<table>
<thead>
<th>姓名</th>
<th>获奖等级</th>
<th>工号</th>
<th>操作</th>
</thead>
<tbody class="list">
</tbody>
</table>
<div><a href="javascript:;" id="clear">清空</a></div>
<div>当前抽取奖项
<select name="prize" class="prize">
</select>
</div>
</div>
</div>
<div id="staff_list">
<div class="staff_title">员工名单</div>
<div class="staff_table">
<table>
<thead>
<th>姓名</th>
<th>工号</th>
<th>加入奖池</th>
</thead>
<tbody class="list">
</tbody>
</table>
<div><a href="javascript:;" id="staff_load">加载名单</a></div>
<div><a href="javascript:;" id="staff_refresh">更新名单</a></div>
<input id="staff_load_csv" type="file" name="staff_load_csvfile" style="display: none;"/>
<input id="staff_load_csv2db" type="button" onclick="csv()" style="display: none;"/>
</div>
</div>
<div id="cover_up">
<div id="start_button_up">开始抽奖</div>
</div>
<div id="cover_bottom">
<div id="start_button_bottom">开始抽奖</div>
</div>
<!-- <input type="file" name="csvfile" />
<input type="button" onclick="csv()" value="JS转换"/>
<br /><br /><br />
<div id="resTbl"></div> -->
<div id="resTbl"></div>
<script type="text/javascript" src="./js/jQuery.publicBox.js"></script>
<script type="text/javascript" src="./js/users.js"></script>
<script type="text/javascript" src="./js/lottery.js"></script>
<script type="text/javascript" src="./js/staff.js"></script>
<script type="text/javascript" src="./js/index.js"></script>
<!-- <script type="text/javascript" src="./lib/jquery.js"></script> -->
<script type="text/javascript" src="./lib/papaparse.js"></script>
<script type="text/javascript" src="./lib/jschardet.js"></script>
<script type="text/javascript" src="./js/csv2arr.js"></script>
<script>
function csv(){
$("input[name=staff_load_csvfile]").csv2arr(function(arr){
console.log( arr );
for(var i in arr) {
arr[i][0].replace('\t', '')
arr[i][1].replace('\t', '')
arr[i][2].replace('\t', '')
staff.staffListAdd({name:arr[i][0], number:arr[i][1], enable:arr[i][2]}, true)
}
//something to do here
// var tblStr = "<table border='1'>";
// $.each( arr, function(i, line){
// tblStr += "<tr>";
// $.each( line, function(i, cell){
// tblStr += "<td>"+cell+"</td>";
// });
// tblStr += "</tr>";
// });
// $("#resTbl").html( tblStr );
lottery.refreshUser()
});
}
</script>
</body>
</html>