1
<%@ page language="java" pageEncoding="GBK"%>
2
<%@page import="java.util.List"%>
3
<%@page import="com.cns.certservice.vo.PrivilegeInfoView"%>
4
<%@page import="com.cns.certservice.vo.UserPriInfoView"%>
5
<%@page import="java.util.HashMap"%>
6
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
7
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
8
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
10
<html xmlns="http://www.w3.org/1999/xhtml">
11
<head>
12
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
13
<title>iPASS解鎖</title>
14
<link href="<%=request.getContextPath()%>/styles/styles.css"
15
rel="stylesheet" type="text/css" />
16
<script src="<%=request.getContextPath()%>/js/CCITCertCtrl.js"></script>
17
<script src="<%=request.getContextPath()%>/js/ccitenrl.js"></script>
18
<script src="<%=request.getContextPath()%>/js/jquery.js"></script>
19
<script type="text/javascript"
20
src="<%=request.getContextPath()%>/js/validator.js" charset="gb2312"></script>
21
<style type="text/css">
22
<!--
23
.STYLE1 {
24
color: #FF0000
25
}
26
27
.STYLE2 {
28
color: #000033
29
}
30
-->
31
</style>
32
<script language="javaScript">
33
function checkAll(str,flag)
34
{
35
var n = flag; //獲取復(fù)選框的個(gè)數(shù)
36
for (var i=0; i<n; i++){
37
document.forms(1)(str)[i].checked = window.event.srcElement.checked;
38
}//通過單擊的按鈕判斷是選中還是未選
39
}
40
function queryCheck(){
41
var usercode = (document.forms(0).userCode.value).Trim();
42
if(usercode.length == 0){
43
alert('請(qǐng)輸入員工工號(hào)');
44
document.forms(0).userCode.focus();
45
return false;
46
}else{
47
if(!IsNum(usercode)){
48
alert('請(qǐng)輸入正確的員工工號(hào)\r格式如:12345678');
49
document.forms(0).userCode.focus();
50
return false;
51
}
52
if(usercode.length != 8){
53
alert('員工工號(hào)長度必須為8位');
54
document.forms(0).userCode.focus();
55
return false;
56
}
57
}
58
return true;
59
}
60
61
62
function submitForm1()
63
{
64
var usercode = (document.forms(0).userCode.value).Trim();
65
var agentcode = (document.forms(1).agentCode.value).Trim();
66
var agenttype = (document.forms(1).agentType.value);
67
if(usercode.length == 0){
68
alert('請(qǐng)輸入員工工號(hào)!');
69
document.forms(0).userCode.focus();
70
return false;
71
}else{
72
if(!IsNum(usercode)){
73
alert('請(qǐng)輸入正確的員工工號(hào)!\r格式如:12345678');
74
document.forms(0).userCode.focus();
75
return false;
76
}
77
if(usercode.length != 8){
78
alert('員工工號(hào)長度必須為8位!');
79
document.forms(0).userCode.focus();
80
return false;
81
}
82
}
83
if(agentcode.length == 0){
84
alert('請(qǐng)輸入渠道編號(hào)!');
85
document.forms(1).agentcode.focus();
86
return false;
87
}else{
88
if(!IsNum(agentcode)){
89
alert('請(qǐng)輸入正確的渠道編號(hào)!');
90
document.forms(1).agentcode.focus();
91
return false;
92
}
93
}
94
if(agenttype == "0"){
95
alert('請(qǐng)選擇渠道類型!');
96
document.forms(1).agentType.focus();
97
return false;
98
}
99
document.forms(1).action="<%=request.getContextPath()%>/PriInfoMgr.do?userCode="+usercode;
100
document.forms(1).submit();
101
}
102
</script>
103
</head>
104
<body>
105
<div class="c_content">
106
<div class="e_title">
107
權(quán)限管理
108
</div>
109
<div align="center">
110
<html:form action="/queryPriInfoList.do" method="post"
111
onsubmit="return queryCheck()">
112
<table align="center" width="100%">
113
<tr>
114
<td align="left">
115
116
員工工號(hào):
117
<html:text property="userCode" maxlength="8" />
118
<span class="STYLE1"> * </span>
119
<input type="submit" name="button3" value="查詢" />
120
121
<span class="STYLE1"> (請(qǐng)輸入要設(shè)置權(quán)限的員工工號(hào),點(diǎn)擊'查詢') </span>
122
</td>
123
</tr>
124
</table>
125
</html:form>
126
<logic:present name="priInfo">
127
<form action="" method="post">
128
<table align="center" width="100%">
129
<%
130
UserPriInfoView priView = (UserPriInfoView) request.getAttribute("priInfo");
131
@SuppressWarnings("unchecked")
132
List<PrivilegeInfoView> privilegeList = (List<PrivilegeInfoView>) request.getAttribute("privilegeList");
133
HashMap<String,String> map = (HashMap<String,String>) priView.getHashMap();
134
%>
135
<tr>
136
<td align="left">
137
138
渠道編號(hào):
139
<input name="agentCode" size="15" type="text" maxlength="8"
140
value="<%=priView.getAgentCode()%>" />
141
<span class="STYLE1"> * </span>
142
</td>
143
</tr>
144
<tr>
145
<td align="left">
146
147
渠道類型:
148
<select name="agentType" style="width: 75px">
149
<option value="0">
150
-請(qǐng)選擇-
151
</option>
152
<option value="1">
153
自有渠道
154
</option>
155
<option value="2">
156
社會(huì)渠道
157
</option>
158
</select>
159
<span class="STYLE1"> * </span>
160
</td>
161
</tr>
162
<tr>
163
<td align="left">
164
165
<%
166
if (map.size() == privilegeList.size()) {
167
%>
168
<input type="checkbox" id="selectAll" checked="checked"
169
onclick="checkAll('priItem',document.forms(1).prilength.value)" />
170
<%
171
} else {
172
%>
173
<input type="checkbox" id="selectAll"
174
onclick="checkAll('priItem',document.forms(1).prilength.value)" />
175
<%
176
}
177
%>
178
<label for="selectAll">
179
全選
180
</label>
181
</td>
182
</tr>
183
<tr>
184
<td align="left">
185
186
<%
187
int flag = 0; //記錄權(quán)限列表的個(gè)數(shù)
188
for (PrivilegeInfoView view : privilegeList) {
189
boolean check = false;//權(quán)限check標(biāo)識(shí)
190
if (map.containsKey(view.getPid())) {
191
check = true;
192
}
193
%>
194
<input type="checkbox" value="<%=view.getPid()%>"
195
<%if(check){ %> checked="checked" <%} %> name="priItem" />
196
<%=view.getPname()%>
197
<%
198
flag++;
199
}
200
%>
201
<input type="hidden" name="prilength" value="<%=flag%>" />
202
</td>
203
</tr>
204
<tr>
205
<td style="width: 600px">
206
207
<input type="button" name="update" value="確定"
208
onclick="return submitForm1()" />
209
</td>
210
</tr>
211
</table>
212
</form>
213
</logic:present>
214
</div>
215
</div>
216
<p>
217
218
</p>
219
</body>
220
</html>
221

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

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221
