1
<%@ page language="java" contentType="text/html; charset=GB18030"
2
pageEncoding="GB18030"%>
3
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %>
4
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>
5
<html>
6
<head>
7
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
8
<title>用戶維護</title>
9
<link rel="stylesheet" href="../style/drp.css">
10
<script type="text/javascript">
11
12
function addUser() {
13
window.self.location = "user_input.jsp";
14
}
15
16
function modifyUser() {
17
var count = 0;
18
var j = 0;
19
for (var i = 0; i < document.getElementsByName("selectFlag").length; i++) {
20
if (document.getElementsByName("selectFlag")[i].checked) {
21
j = i;
22
count++;
23
}
24
}
25
if (count == 0) {
26
alert("請選擇需要修改的用戶!");
27
return;
28
}
29
if (count > 1) {
30
alert("一次只能修改一個用戶!");
31
return;
32
}
33
if (count == 1) {
34
window.self.location = "find.do?userId=" + document.getElementsByName("selectFlag")[j].value;
35
}
36
}
37
38
function deleteUser() {
39
var flag = false;
40
for (var i = 0; i < document.getElementsByName("selectFlag").length; i++) {
41
if (document.getElementsByName("selectFlag")[i].checked) {
42
flag = true;
43
}
44
}
45
if (!flag) {
46
alert("請選擇需要刪除的用戶!");
47
return;
48
}
49
if (window.confirm("確認刪除嗎?")) {
50
with (document.getElementById("userForm")) {
51
method = "post";
52
action = "del.do";
53
submit();
54
}
55
}
56
}
57
58
function checkAll() {
59
for (var i = 0; i < document.getElementsByName("selectFlag").length; i++) {
60
document.getElementsByName("selectFlag")[i].checked = document.getElementById("ifAll").checked;
61
}
62
}
63
64
</script>
65
</head>
66
67
<body class="body1">
68
<form name="userform" id="userform">
69
<div align="center">
70
<table width="95%" border="0" cellspacing="0" cellpadding="0"
71
height="35">
72
<tr>
73
<td class="p1" height="18" nowrap>
74
75
</td>
76
</tr>
77
<tr>
78
<td width="522" class="p1" height="17" nowrap>
79
<img src="../images/mark_arrow_02.gif" width="14" height="14">
80
81
<b>系統管理>>用戶維護</b>
82
</td>
83
</tr>
84
</table>
85
<hr width="100%" align="center" size=0>
86
</div>
87
<table width="95%" height="20" border="0" align="center"
88
cellspacing="0" class="rd1" id="toolbar">
89
<tr>
90
<td width="49%" class="rd19">
91
<font color="#FFFFFF">查詢列表</font>
92
</td>
93
<td width="27%" nowrap class="rd16">
94
<div align="right"></div>
95
</td>
96
</tr>
97
</table>
98
<table width="95%" border="1" cellspacing="0" cellpadding="0"
99
align="center" class="table1">
100
<tr>
101
<td width="55" class="rd6">
102
<input type="checkbox" name="ifAll" onClick="checkAll()">
103
</td>
104
<td width="119" class="rd6">
105
用戶代碼
106
</td>
107
<td width="152" class="rd6">
108
用戶名稱
109
</td>
110
<td width="166" class="rd6">
111
聯系電話
112
</td>
113
<td width="150" class="rd6">
114
email
115
</td>
116
<td width="153" class="rd6">
117
創建日期
118
</td>
119
</tr>
120
<logic:empty name="userlist">
121
<tr>
122
<td class="rd8" colspan="6">
123
<font color="red">沒有符合條件的數據</font>
124
</td>
125
</tr>
126
</logic:empty>
127
<logic:notEmpty name="userlist">
128
<logic:iterate id="user" name="userlist">
129
<tr>
130
<td class="rd8">
131
<input type="checkbox" name="selectFlag" class="checkbox1"
132
value="<bean:write name="user" property="userId"/>">
133
</td>
134
<td class="rd8">
135
<bean:write name="user" property="userId" />
136
</td>
137
<td class="rd8">
138
<bean:write name="user" property="userName" />
139
</td>
140
<td class="rd8">
141
<bean:write name="user" property="contactTel" />
142
</td>
143
<td class="rd8">
144
<bean:write name="user" property="email" />
145
</td>
146
<td class="rd8">
147
<bean:write name="user" property="createDate" format="yyyy-MM-dd HH:mm:ss" />
148
</td>
149
</tr>
150
</logic:iterate>
151
</logic:notEmpty>
152
</table>
153
<table width="95%" height="30" border="0" align="center"
154
cellpadding="0" cellspacing="0" class="rd1">
155
<tr>
156
<td nowrap class="rd19" height="2">
157
<div align="left">
158
<font color="#FFFFFF"> 共 xx 頁</font>
159
<font color="#FFFFFF">當前第</font> 
160
<font color="#FF0000">x</font> 
161
<font color="#FFFFFF">頁</font>
162
</div>
163
</td>
164
<td nowrap class="rd19">
165
<div align="right">
166
<input name="btnAdd" type="button" class="button1" id="btnAdd"
167
value="添加" onClick="addUser()">
168
<input name="btnDelete" class="button1" type="button"
169
id="btnDelete" value="刪除" onClick="deleteUser()">
170
<input name="btnModify" class="button1" type="button"
171
id="btnModify" value="修改" onClick="modifyUser()">
172
</div>
173
</td>
174
</tr>
175
</table>
176
<p>
177
178
</p>
179
</form>
180
</body>
181
</html>
182

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

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182
