forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpersonnel_top.jsp
More file actions
227 lines (215 loc) · 9.32 KB
/
personnel_top.jsp
File metadata and controls
227 lines (215 loc) · 9.32 KB
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
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
222
223
224
225
226
227
<%@ page language="java" pageEncoding="gb2312"%>
<%@ page import="java.util.List"%>
<%@page import="com.hiernate.persistence.*"%>
<jsp:directive.page import="com.hiernate.util.HibernateUtil"/>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<html:base />
<title>员工信息查询</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
.style10 {color: #669999}
.style11 {color: #C60001}
.STYLE13 {color: #000000; font-size: 9pt; }
.STYLE14 {
font-size: 9pt;
color: #000000;
}
.STYLE16 {font-size: 9pt}
-->
</style>
<script language="javascript">
function Mycheck()
{
if(form1.branch.value=="")
{alert("请输入员工所在部门名称??");form1.branch.focus();return;}
form1.submit();
}
</script>
<link href="../CSS/style.css" rel="stylesheet" type="text/css">
</head>
<body background="../Images/main_center.jpg">
<table width="801" height="505" border="0" cellpadding="0" cellspacing="0" background="../Images/main_center.JPG">
<tr>
<td height="488" valign="top"><table width="100%" height="84%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="100%" height="119" border="0" cellpadding="-2" cellspacing="-2" background="../images/bbs/bbs_01.gif">
<tr valign="top">
<td width="100%" height="45" background="../Images/main_top.JPG"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<tr>
<td width="5%"><br> <img src="../Images/isexists.gif" width="16" height="16"></td>
<td width="23%" align="left"><br> <b>员工维护</b></td>
<td width="72%" valign="bottom"> </td>
</tr>
</table></td>
</tr>
<tr valign="top">
</tr>
</table>
<table width="60%" height="21%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="69" valign="bottom"><br>
<table width="557" height="40" border="0" cellpadding="-2" cellspacing="-2">
<tr>
<td width="7%" height="24" align="center" valign="middle"> </td>
<td width="20%" height="24" align="center"></td>
<br>
<td width="4%" align="center"><img src="../Images/modify.gif" width="12" height="12"></td>
<td width="17%" align="center" class="style10"><div align="left">
<%
String currPage = request.getParameter("currPage");
int iCurrPage = 1 ;
int pages = 1 ;
int allRecCount = 0 ;
int recPerPage = 5 ;
allRecCount = HibernateUtil.findUserCount(); // 查询出总的记录数
pages = (allRecCount - 1)/recPerPage + 1 ; // 计算出总的页数
if(pages == 0){ // 对页数进行有效性处理,使页数的最小值是1
pages = 1;
}
if(currPage != null && !currPage.equalsIgnoreCase("")){
iCurrPage = Integer.parseInt(currPage);
}
List listUser = HibernateUtil.findUser((iCurrPage - 1) * recPerPage, recPerPage);
if(!listUser.isEmpty()&& listUser.size()>0){
for(int j=0;j<listUser.size();j++){
User user = (User)listUser.get(j);
%>
<a href="#" class="STYLE14" onClick="Javascrip:window.open('personnel_modifyPWD.jsp?ID=<%=user.getId()
%>','','width=460,height=380');return false;"><%}}%>修改个人信息</a>
</div></td>
<td width="5%" height="24"><div align="center" class="style10"></div></td>
<td width="30%" height="24"> </td>
<td width="17%" height="24"><div align="center"></div></td>
</tr>
<tr>
<td height="16" colspan="8"></td>
</tr>
</table>
<table width="556" border="0" cellspacing="-2" cellpadding="-2" align="center" >
<tr>
<td><form action="personnel_info1.jsp" method="post" name="form1">
<table width="100%" border="0" cellspacing="-2" cellpadding="-2" align="center">
<tr>
<td width="2%"> </td>
<td width="23%"> <span class="STYLE13">请输入员工所在部门:</span></td>
<td width="36%"><input name="branch" type="text" class="Sytle_text" id="branch">
<input name="Submit" type="button" class="btn_grey" value="搜索" onClick="Mycheck();"></td>
<td width="12%"> </td>
<td width="10%"> </td>
<td width="17%"><div align="right">
<input name="Submit3" type="button" class="btn_grey" value="优秀职员"
onclick="JScript:window.open('personnel_best.jsp','','width=417,height=259')">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
<table width="556" border="0" align="center" cellpadding="-2" cellspacing="-2">
<tr>
<td>
<%if(listUser.isEmpty()){%>
<table align="center" cellpadding="0" cellspacing="0">
<tr><td><span class="STYLE16">无员工信息!</span></td>
</tr></table>
<%}else{%>
<table width="97%" height="42" border="1" align="right" cellpadding="-2" cellspacing="-2">
<tr>
<td width="19%"><div align="center" class="STYLE16">用户名</div></td>
<td width="18%"><div align="center"><span class="STYLE16">姓名</span></div></td>
<td width="10%"><div align="center" class="STYLE16">权限</div></td>
<td width="14%"><div align="center" class="STYLE16">部门</div></td>
<td width="16%"><div align="center"><span class="STYLE16">职务</span></div></td>
<td width="11%"><div align="center" class="STYLE16">详细资料</div></td>
<td width="6%"><div align="center" class="STYLE16">修改</div></td>
<td width="6%"><div align="center" class="STYLE16">删除</div></td>
</tr>
<%
if(!listUser.isEmpty()&& listUser.size()>0){
for(int i=0;i<listUser.size();i++){
User users = (User)listUser.get(i);
session.setAttribute("user",users);
%>
<tr>
<td><div class="STYLE14"> <%=users.getUserName()%></div></td>
<td><div class="STYLE14"> <%=users.getName()%></div></td>
<td><div class="STYLE14"> <%=users.getPurview()%></div></td>
<td><div class="STYLE14"> <%=users.getBranch()%></div></td>
<td><div class="STYLE14"> <%=users.getJob()%></div></td>
<td><div align="center">
<a href="#" onClick="JScrip:window.open('personnel_detail.jsp?ID=<%=users.getId()
%>','','width=556,height=330');return false">
<img src="../Images/detail.gif" width="16" height="17" border="0"></A></div></td>
<td><div align="center">
<%
String purview = (String)application.getAttribute("Purview");
if(!purview.equalsIgnoreCase("系统")){
%>
<a href="personnel_nomodify.jsp">
<img src="../Images/modify.gif" width="12" height="12" border="0"></td>
<td>
<a href="personnel_nomodify.jsp">
<img src="../Images/del.gif" width="16" height="16" border="0"></td>
<%} %>
<%if(purview.equalsIgnoreCase("系统")){ %>
<a href="#" onClick="JScrip:window.open('personnel_modify.jsp?ID=<%=users.getId()%>','','width=460,height=380');return false">
<img src="../Images/modify.gif" width="12" height="12" border="0"></a>
<td><div align="center">
<a href="personnel_del.jsp?ID=<%=users.getId()%>&&currPage=<%=iCurrPage%>&link=<%=listUser.size()%>" onClick="return confirm('是否确认删除?')">
<img src="../Images/del.gif" width="16" height="16" border="0">
</a></div></td>
</div></td>
</tr>
<%}}}%>
</table></td>
</tr>
</table>
<table width="556" border="0" align="center" cellpadding="-2" cellspacing="-2">
<tr>
<td><div align="right">
<span class="STYLE16">
<%
if(recPerPage < allRecCount){
String href = " <a href='personnel_top.jsp?currPage=";
StringBuffer sbf = new StringBuffer(); //制作分页条
if(iCurrPage > 1){
sbf.append(href+(iCurrPage - 1)+"'>上一页</a>"); //构造上一页
}
for(int i = 1 ; i <= pages ; i ++){
if(i == iCurrPage){
sbf.append(href+i+"'>["+i+"]</a>"); //追加串
}
else{
sbf.append(href+i+"'>"+i+"</a>");
}
}
if(iCurrPage < pages){
sbf.append(href+(iCurrPage + 1)+"'>下一页</a>"); //构造下一页
}
%>
<%out.print("当前页数:["+iCurrPage+"/"+pages+"]");%>
<%=sbf.toString()%>
<%} }%>
</span></div></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</body>