📄 list.jsp
字号:
<%@ include file="../checklogin.jsp" %>
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page language="java"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.admin.Admin" %><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<script language="javascript">
function sel(a){
o=document.getElementsByName(a)
for(i=0;i<o.length;i++)
o[i].checked=event.srcElement.checked
}
var ctimer;
function init(){
if (document.all){
tim2.style.left=tim1.style.posLeft;
tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
settimes();
}
}
function settimes(){
var time= new Date();
years=time.getYear();
months=time.getMonth();
days=time.getDay();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
if (hours<10)
hours="0"+hours;
if(mins<10)
mins="0"+mins;
if (secs<10)
secs="0"+secs;
tim1.innerHTML=years+"-"+months+"-"+days+" "+hours+":"+mins+":"+secs
tim2.innerHTML=years+"-"+months+"-"+days+" "+hours+":"+mins+":"+secs
ctimer=setTimeout('settimes()',960);}
</script>
<style type="text/css">
<!--
.STYLE6 {
font-size: 12px;
font-weight: bold;
}
.STYLE7 {font-size: 12px}
.STYLE8 {
color: #6666FF;
font-weight: bold;
}
.STYLE4 { color:#FF9900;
font-weight: bold;
font-size:12px;
}
body {
background-image: url(../images/aa.gif);
}
-->
</style>
</head>
<html>
<link href="../css/left.css" rel="stylesheet" type="text/css">
<body onLoad="init()">
<div align="center" Id="tim1" Style="position:absolute; width:102px; height:11px; top:19px; left:180px"
class="time"></div>
<div Id="tim2"
Style="position:absolute; filter:flipv() alpha(opacity=20); font-style:italic"
class="time"></div>
<form id="form1" name="form1" method="post" action="del.jsp">
<br />
<table width="731" border="0" align="center" >
<tr>
<td width="43"> </td>
<td width="559" class="STYLE7">当前时间:</td>
<td width="115"><a href="../../index.jsp" target="_blank" class="STYLE7">网站首页</a></td>
</tr>
</table>
<br />
<table width="73%" border="0" align="center" class="tableBorder">
<%
Admin admin=new Admin();
ArrayList result=admin.AllAdmin();
int pagesize=15;//每页显示记录数
int recordcount=0;//记录总数
int pagecount=0;//总页数
int pageid=1;//待显页码
int recordbegin;
int recordend;
if(request.getParameter("pageid")!=null){
pageid=Integer.parseInt(request.getParameter("pageid"));
}
recordcount=result.size();
pagecount=(recordcount%pagesize==0?(recordcount/pagesize):(recordcount/pagesize)+1);//取得总页数
recordbegin=pageid*pagesize-pagesize;
recordend=pageid*pagesize-1;
%>
<tr >
<td colspan="6"><span class="STYLE7">·</span><span class="STYLE6">管理员列表</span></td>
</tr>
<tr bgcolor="#EFEFEF">
<td width="7%"><div align="center" class="STYLE7">编号</div></td>
<td width="25%"><div align="center" class="STYLE7">管理员名称</div></td>
<td width="24%"><div align="center" class="STYLE7">管理员密码</div></td>
<td width="24%"><div align="center" class="STYLE7">最近登陆时间</div></td>
<td width="11%"><div align="center" class="STYLE7">登陆次数</div></td>
<td width="9%"><div align="center">
<input type="submit" name="Submit" value="删除" class="btn"/>
</div></td>
</tr>
<%if (result.size()==0){%>
<tr class="STYLE7"><td colspan="6"><div align="center" class="STYLE8">暂无管理员!</div></td></tr>
<%}else{%>
<%
for(int i=recordbegin;i<=recordend & i<recordcount;i++){
admin= (Admin)result.get(i);
%>
<tr class="STYLE7" onMouseOver="this.style.background='#eeeeee';" onMouseOut="this.style.background='#FFFFFF'">
<td><div align="center"><%=i+1%></div></td>
<td><div align="center"><%=admin.adminid%></div></td>
<td><div align="center"><%=admin.pwd%></div></td>
<td><div align="center"><%=admin.logintime%></div></td>
<td><div align="center"><%=admin.totle%></div></td>
<td ><div align="center">
<%if (admin.id!=1){%>
<input name="selAnnounce" type="checkbox" id="selAnnounce" value="<%=admin.id%>">
<%}%>
</div></td>
</tr>
<%
}
}
%>
<tr>
<td colspan="6" class="STYLE7">
共有<span class="STYLE4"><%=recordcount%></span>条记录, 每页显示<span class="STYLE4"><%=pagesize%></span>条, 第<span class="STYLE4"><%=pageid%></span>页/共<span class="STYLE4"><%=pagecount%></span>页
<% if (pageid==1){%>
首页
<%} else{ %>
<a href="../list.jsp?pageid=1">首页</a>
<%}%>
<% if (pageid==1){%>
前页
<%} else{ %>
<a href="../list.jsp?pageid=<%=pageid-1%>">前页</a>
<%}%>
<% if(pageid==pagecount){%>
后页
<%} else {%>
<a href="../list.jsp?pageid=<%=pageid+1%>">后页</a>
<%}%>
<% if (pageid==pagecount){%>
尾页
<%} else{ %>
<a href="../list.jsp?pageid=<%=pagecount%>">尾页</a>
<%}%>
<input type=checkbox onclick=sel('selAnnounce')>
全选</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -