📄 admin_history.asp
字号:
<!--#include file="../Conn.asp"-->
<!--#include file="Admin_Session.asp"-->
<%
Dim Action
Action=Trim(Request("Action"))
HX33_WishID=Trim(Request("HX33_WishID"))
IF Action="DelWish" Then
Conn.Execute("Delete From HX33_Admin_Detail Where ID In ("&HX33_WishID&")")
Response.Write "<script language='javascript'>alert('删除成功!');location='Admin_History.asp';</script>"
Response.End()
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center">
<table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
<tr>
<th height=50 colspan="5" class="tableHeaderText">管理员登陆信息</th>
</tr>
<form action="" name="form1" method="post">
<tr>
<td width="10%" align="center" class="forumRowHighlight"> 选择</td>
<td width="30%" align="center" class="forumRowHighlight">管理员</td>
<td width="30%" align="center" class="forumRowHighlight">登陆IP</td>
<td width="30%" align="center" class="forumRowHighlight">登陆时间</td>
</tr>
<%
Set Rs= Server.CreateObject("ADodb.recordset")
sqlstr="Select * From HX33_Admin_Detail"
Rs.Open Sqlstr ,conn,1,1
IF Not Rs.Eof Then
maxperpage=20
dim currentpage '定义当前页的变量
rs.pagesize=maxperpage
currentpage=request("page")
if currentpage="" or not Isnumeric(currentpage) then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
'如果变量currentpage的数据类型不是数值型
'就1赋给变量currentpage
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
%>
<%
do while i< maxperpage and not rs.eof'
%>
<tr>
<td align="center" class="forumRowHighlight"><input name="HX33_WishID" type="checkbox" id="HX33_WishID" value="<%=Rs("ID")%>"></td>
<td align="center" class="forumRowHighlight"><%=Rs("AdminName")%></td>
<td align="center" class="forumRowHighlight"><%=Rs("Login_IP")%></td>
<td align="center" class="forumRowHighlight"><%=Rs("Login_Time")%></td>
</tr>
<%
i=i+1
rs.movenext
loop
Else
%>
<tr>
<td colspan="4" align="center" class="forumRowHighlight">没有任何记录!</td>
</tr>
<%End IF%>
<tr>
<td colspan="4" align="center" class="forumRowHighlight"><input name="chkAll" type="checkbox" id="chkAll2" onClick="CheckAll(form1)" value="checkbox">
全选
<input name="DelWish" type="button" class="button" id="DelWish" onClick="return SubmitForm();" value="删除记录"></td>
</tr>
</form>
<tr>
<td colspan="4" align="center" class="forumRowHighlight">
页数:<font color="red"><%=currentpage%></font>/
<% =n%>
<% k=currentpage
if k<>1 then%>
[<a class="link" href="Admin_History.asp?page=1">首页</a>]
[<a class="link" href="Admin_History.asp?page=<%=k-1%>">上一页</a>]
<%else%>
[首页] [上一页]
<%end if%>
<%if k<>n then%>
[<a class="link" href="Admin_History.asp?page=<%=k+1%>">下一页</a>]
[<a class="link" href="Admin_History.asp?page=<%=n%>">尾页</a>]
<%else%>
[下一页] [尾页]
<%end if%>
共有<font color="red"><%=totalput%></font>条记录 <font color="red"><%=maxperpage%></font>个/页
共有<font color="red"><%=n%></font>页 </td>
</tr>
</table>
</div>
</body>
</html>
<%
Rs.CLose
Set Rs=Nothing
Call ConnClose()
%>
<script language="javascript">
function count_checked_items()
{
var number_checked=0;
var box_count=document.form1.HX33_WishID.length;
if ( box_count==null )
{
if ( document.form1.HX33_WishID.checked==true )
{
number_checked=1;}
else {
number_checked=0;}
}
else {
for ( var i=0; i < (box_count); i++ ) {
if ( document.form1.HX33_WishID[i].checked==true ) {
number_checked++;}}}
return number_checked;
}
function SubmitForm() {
if (count_checked_items()>0){
if(confirm("您真的要删除所选的登陆信息吗?")){
document.form1.action="Admin_History.asp?Action=DelWish";
document.form1.submit();
}
}
else
alert('请您先选择要删除的登陆信息!');
return false;
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -