📄 list.asp
字号:
<!--#include file="qx.asp"-->
<!--#include file="nocache.asp"-->
<!--#include file="conn.asp"-->
<html>
<head>
<title>管理页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #006699}
.STYLE2 {color: #003399}
-->
</style>
</head>
<body>
<table width="855" border="0" cellspacing="0" cellpadding="0" class="t1">
<tr bgcolor="#ffcccc">
<td width="75" height="20" class="main">选择</td>
<td width="66" height="20" class="main"></td>
<td width="136" height="20" class="main">姓名</td>
<td width="130" height="20" class="main">身份证号码</td>
<td width="152" class="main">月份</td>
<td width="174" class="main">实发工资</td>
<td width="117" class="main">操作</td>
</tr>
<script>
function del () //用于判断记录有没有选中的函数
{
var flag=true;
var temp="";
var tmp;
if((document.form1.answer.length+"")=="undefined") {tmp=1}else{tmp=document.form1.answer.length}
if (tmp==1){
if (document.form1.answer.checked){
flag=false;
temp=document.form1.answer.value
}
}else{
for (i=0;i<document.form1.answer.length;i++) {
if (document.form1.answer[i].checked){
if (temp==""){
flag=false;
temp=document.form1.answer[i].value
}else{
flag=false;
temp = temp +","+ document.form1.answer[i].value
}
}
}
}
if (flag){ alert("对不起,你还没有选择!")}
else{ name=document.form1.name.value
//alert(name)
if (confirm("确实,确定,要删除选中的记录?此举不可恢复,请三思而后点!^_^")){
window.location="delnews.asp?id=" + temp;
}
}
return !flag;
}
</script>
</table>
<script language=Javascript>
function checkall(all)//用于判断全选记录的函数
{
var a = document.getElementsByName("answer");
for (var i=0; i<a.length; i++) a[i].checked = all.checked;
}
</script>
<%
dim i,intPage,page,pre,last,filepath
set rs = server.CreateObject("adodb.recordset")
sql="select * from sa order by id desc"
rs.PageSize = 20 '这里设定每页显示的记录数
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
<%
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>
<table width="855" height="19"><form method="POST" id=form1 name=form1>
<td height="1" class="main" width="73"><input type="checkbox" name="answer" value="<%=rs("id")%>" ID="Checkbox1"></td>
<td height="1" class="main" width="56"></td>
<td height="1" class="main" width="134"><%=trim(rs("name"))%></td>
<td height="1" align="left" class="main" width="124"><%=trim(rs("ic"))%></td>
<td class="main" width="147" height="1"><%=trim(rs("ym"))%></td>
<td height="1" class="main" width="165"><%=trim(rs("fec_z"))%></td>
<td height="1" class="main" width="112"><input type="button" value="删除" onClick="if (confirm('确实要删除(<%=rs("Name")%>)在(<%=rs("ym")%> )的工资记录吗?不可恢复!')) window.location='del.asp?id=<%=rs("id")%>'" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height: 20px; background-color: #D4D0C8; color: #FF0000" onMouseOver="this.style.backgroundColor='#FFC864'" onMouseOut="this.style.backgroundColor='#D4D0C8'"> <a href="xg.asp?id=<%=trim(rs("id"))%>">修改</a></td>
<%
rs.movenext
next
%>
<tr><td colspan="7" width="847" height="37"><table width="99%" border="1" cellpadding="2" bgcolor="#ffcccc" cellspacing="2" borderColorLight="#808080" borderColorDark="#ffffff" height="18">
<tr>
<%if rs.pagecount > 0 then%>
<td width="23%" align="left" class="main" height="10">当前页<font color="#ff0000" class="main"><%=intpage%></font>/<%=rs.PageCount%> <%=rs.PageSize%>篇/页 共<%=rs.RecordCount%>个记录</td>
<%else%>
<td width="15%" align="left" class="main" height="10">当前页0/0</td><%end if%>
<td width="62%" align="right" bgcolor="#D4D0C8" height="10"> <span class="STYLE2"><a href="list.asp?page=1" class="main STYLE1">首页</a>|
<%if pre then%>
<a href="list.asp?page=<%=intpage -1%>" class="main"">上页</a>|
<%end if%>
<%if last then%>
<a href="list.asp?page=<%=intpage +1%>" class=main>下页</a> |
<%end if%>
<a href="list.asp?page=<%=rs.PageCount%>" class="main">尾页</a></span>|<font class="main">转到第</font>
<select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="list.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="list.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select><font class="main">页</font> </td>
</tr>
</table> </td>
</tr>
</table>
<center><input type="checkbox" name="chkall" value="on" onClick="checkall(this)" ID="Checkbox2"><font class=main> 选中此页所有显示的记录</font>
<input type="button" name="btnDelete" value="删除" style='font-family: 宋体; font-size: 9pt;' onClick="del()" ID="Button1"></center>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -