📄 showuser.jsp
字号:
<%@page contentType="text/html; charset=gb2312"%>
<%@ page language="java" import="java.util.*,
com.tongtu.util.UserInfo,
com.tongtu.util.Page;" %>
<%@ include file="/WEB-INF/jsp/includes.jsp"%>
<%@ taglib uri="/WEB-INF/tags/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tags/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tags/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tags/struts-tiles.tld" prefix="tiles" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Page pages=(Page)request.getAttribute("page");
int pagenum=0;
String pagen=(String)request.getAttribute("pagenum");
String rows=(String)request.getAttribute("rowCount");
if (pagen!=null) pagenum=Integer.parseInt(pagen);
int userInt = 0; //当前页记录数
int posInt = 1; //开始位置
int rowCount = 0;
if (rows!= null) rowCount = Integer.parseInt(rows);
if (page != null){
List userList=pages.getList();
userInt = userList.size();
}
UserInfo qs = (UserInfo)session.getAttribute("showUser");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script language="JavaScript" type="text/JavaScript">
function del(){
var len=<%=userInt%>;
var n=0;
for(i=0;i<len;i++)
{
if (len==1)
if ( document.userForm.checkbox.checked==true)
{
n++;}
if (len!=1)
{
if (document.userForm.checkbox[i].checked==true)
{
n++;
}}
}
if (n<1)
alert("请选择要删除的用户!");
if (n>=1)
{
if(confirm('您确定要删除用户吗?'))
{
document.userForm.submit();
return true;
}
}
}
function selectAllCheck(a)
{
var len=<%=userInt%>;
document.userForm.selectAll.checked=a.checked;
for(i=0;i<len;i++)
{
if (len==1) document.userForm.checkbox.checked=a.checked;
else document.userForm.checkbox[i].checked=a.checked;
}
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="<%=path%>/css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style></head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="6" height="11" background="pic/beijing.jpg"><img src="pic/tupian.jpg" width="6" height="11" /></td>
<td background="pic/beijing.jpg"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="userForm" action="deluser.do">
<tr>
<td height="5" ></td>
</tr>
<tr>
<td height="18" ><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="96"><img src="pic/6.jpg" width="96" height="26" /></td>
<td width="2"><img src="pic/8.jpg" width="2" height="26" /></td>
<td width="93"><a href="showRole.do"><img src="pic/7.jpg" width="93" height="26" border="0" alt="角色管理"/></a></td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="25" bgcolor="#73CCF7">
<img src="pic/addMail.gif" width="16" height="16" align="absmiddle" /><a href="addUser.do">添加用户</a>
<img src="pic/del.gif" width="18" height="18" align="absmiddle" /><a href="javascript:del()">删除用户</a> </td>
</tr>
<tr>
<td height="1" bgcolor="#666666"></td>
</tr>
<tr>
<td height="164" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5" colspan="19"></td>
</tr>
<tr class="z">
<td width="40" height="20" align="center" bgcolor="#F2F4F6" class="bk">
<input type="checkbox" name="selectAll" onClick="selectAllCheck(this);" />
</td>
<td width="2" align="center" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td width="80" align="left" bgcolor="#F2F4F6" class="bk">用户名
<a href="showuser.do?typeId=1">
<img src="<%if (qs.getLoginName() == 1){ %>pic/jiantou.gif <%}else {%>pic/jiantou1.gif <%} %>" width="12" height="7" border="0"/></a></td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td width="80" align="left" bgcolor="#F2F4F6" class="bk">联系人姓名</td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td align="left" bgcolor="#F2F4F6" class="bk">负责人姓名</td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td align="left" bgcolor="#F2F4F6" class="bk">所在单位</td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td align="left" bgcolor="#F2F4F6" class="bk">所属市
<a href="showuser.do?typeId=2">
<img src="<%if (qs.getLoginCity() == 1){ %>pic/jiantou.gif <%}else {%>pic/jiantou1.gif <%} %>" width="12" height="7" border="0"/></a></td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td align="left" bgcolor="#F2F4F6" class="bk">所属县
<a href="showuser.do?typeId=3">
<img src="<%if (qs.getLoginCounty() == 1){ %>pic/jiantou.gif <%}else {%>pic/jiantou1.gif <%} %>" width="12" height="7" border="0"/></a></td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td align="left" bgcolor="#F2F4F6" class="bk">联系电话</td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td width="80" align="left" bgcolor="#F2F4F6" class="bk">传真号码</td>
<td width="2" bgcolor="#F2F4F6" class="bk"><img src="pic/sep_title.gif" width="2" height="21" /></td>
<td align="left" bgcolor="#F2F4F6" class="bk">创建时间
<a href="showuser.do?typeId=4">
<img src="<%if (qs.getLoginBegin() == 1){ %>pic/jiantou.gif <%}else {%>pic/jiantou1.gif <%} %>" width="12" height="7" border="0"/></a></td>
</tr>
<%
UserInfo user = new UserInfo();
if (page != null){
List userList=pages.getList();
userInt = userList.size();
String fax = "";
for (int i = 0; i < userList.size();i++){
user = (UserInfo)userList.get(i);
if (user.getFax() != null)
fax = user.getFax();
%>
<tr class="z">
<td height="25" align="center" class="bk"><input type="checkbox" name="checkbox" value="<%=user.getUserId()%>"/></td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><a href="editUserInfo.do?userId=<%=user.getUserId()%>"><%=user.getUserName() %></a></td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=user.getPersonName() %> </td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=user.getHeadShip() %> </td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=user.getDepartment() %> </td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=user.getCityName() %> </td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=user.getCountyName() %> </td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=user.getTelephone() %> </td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=fax %> </td>
<td height="25" class="bk"> </td>
<td height="25" class="bk"><%=user.getCreateTime() %> </td>
</tr>
<%} }%>
</table>
<!--列表结束-->
</td>
</tr>
<td height="25" bgcolor="#73CCF7"><table width="100%" height="26" border="0" cellpadding="0" cellspacing="0">
<tr>
<%
int nextPageStart = 0;
if (pages!=null) nextPageStart=pages.getStartOfNextPage();
int previousPage=0;
if (pages!=null) previousPage=pages.getStartOfPreviousPage();
int start = 0;
String startnum=(String)request.getAttribute("start");
if (startnum!=null) start=Integer.parseInt(startnum);
if (start != 0 )
{
posInt = start;
userInt = start + userInt;
}else {
userInt = posInt + userInt - 1;
}
int currentPage = (start/rowCount)+1;
int numPages = (int)Math.ceil((double)pagenum/(double)rowCount);
if(numPages==0){
currentPage=0;
}
%>
<td height="25" align="left" bgcolor="#73CCF7">
<div align="left"> 共 <%=pagenum %> 条,列出第 <%=posInt %> 至 <%=userInt %> 条 </div></td>
<td align="right" bgcolor="#73CCF7">
第<font color="blue"><%=currentPage%></font>页/共<font color="blue"><%=numPages%></font>页 |
<%
if(currentPage>1){
%>
<a href="showuser.do?start=0" title="第一页">首页</a>
|
<%}else{%>
首页
|
<%}%>
<%
if(pages!=null&&pages.isPreviousPageAvailable()){
%>
<a href="showuser.do?start=<%=previousPage%>" title="上一页">上一页</a>
|
<%}
if(nextPageStart<pagenum){
%>
<a href="showuser.do?start=<%=nextPageStart%>" title="下一页">下一页</a>
|
<%}
int lastStart = rowCount*(numPages-1);
if(currentPage<numPages&&lastStart>0){
%>
<a href="showuser.do?start=<%=lastStart%>" title="最后一页">末页</a>
<%}else{%>
末页
<%}%>
转到 第
<select name="pageselect" onchange="javascrpt:pagesubmit();" >
<%for(int n=1;n<numPages+1;n++){%>
<% if(n==currentPage){%>
<option value="<%=(n-1)*rowCount%>" selected><%=n%></option>
<%}else{%>
<option value="<%=((n-1)*rowCount)%>"><%=n%></option>
<%}}%>
</select>
页</td>
</tr>
</table></td>
</tr>
</table>
</tr>
</table>
<br>
<br>
<br>
<table width="100%" height="55" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="44"><div align="center">主办:安徽省交通厅 ©2005-2006版权所有 维护单位:安徽省通途信息技术有限公司
<br><br>联系电话:<span class="font"><SPAN class=A1>0551--5397484 5397494 </SPAN></span> <br></div></td>
</tr>
</table>
</body>
<script language="JavaScript">
function pagesubmit()
{
var start=document.all.pageselect.value;
//alert(start);
window.location.href="showuser.do?start="+start;
}
</script>
</form>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -