整页的代码:不要笑我写的太差就好。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/page.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>客户管理</title>
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
<script language="JavaScript">
function cc(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
e.checked = form.all_ids.checked;
}
}
</script>
<link href="admincss.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="kehu_inc.asp"-->
<%
'表格显示的项目由管理人员自行设定。
list="id,username,company,yw,addr,telephone,shouji,fax,tim"
list02=split(list,",")
listdh="序号,用户名称,公司名称,销售代表,公司地址,联系电话,手机,公司传真,添加时间"
listdh02=split(listdh,",")
list_cd=trim(request("list_cd"))
list_cd02=split(list_cd,",")
if ubound(list_cd02)<0 then
list_cd02=list02
end if
function showcaidan(caidan)
if isnull(caidan) or caidan="" then exit function
showcaidan=""
for i = 0 to ubound(list02)
caidan=replace(caidan,list02(i),listdh02(i))
next
showcaidan=caidan
end function
function showcaidan02(caidan)
if isnull(caidan) or caidan="" then exit function
showcaidan02=""
for i = 0 to ubound(list02)
caidan=replace(caidan,listdh02(i),list02(i))
next
showcaidan02=caidan
end function
%>
<br />
<table width="90%" height="30" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F7F7F7">
<tr>
<td align="center" valign="middle" bgcolor="#d6d6d6"><strong>管理客户</strong></td>
</tr>
</table>
<form id="form1" name="form1" method="post" action="kehu_manage.asp">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F7F7F7">
<tr><%for i_01 = 0 to ubound(list_cd02)%>
<td bgcolor="#FFFFFF"><%=showcaidan(list_cd02(i_01))%>&nbsp;</td>
<%next%>
<td bgcolor="#FFFFFF">全选
<input name='all_ids' type="checkbox" id="all_ids" onclick='cc(form1)' />&nbsp;</td>
</tr>
<!--begin loop--> <%set rs=server.CreateObject("adodb.recordset")
sql="select * from yh
order by id desc"
rs.open sql,conn,3,3
if rs.eof then
response.write ""
else
page=request("page")
if page="" then
page=1
end if
pagesize=10
rs.pagesize=pagesize
rs.absolutepage=cint(page)
do while not rs.eof and pagesize>0%><tr><%for i_rs = 0 to ubound(list_cd02)%>
<td bgcolor="#FFFFFF"><%=showcaidan02(list_cd02(i_rs))%>&nbsp;</td>
<%next%>
<td bgcolor="#FFFFFF"><input name="ids" type="checkbox" id="ids" value="<%=rs("id")%>" />&nbsp;</td>
</tr><%pagepagesize=pagesize-1
rs.movenext
loop
end if%><!--end loop-->
</table>
<table width="90%" height="30" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#F7F7F7"><%content="list_cd="&list_cd&""
call showpage()
rs.close
set rs=nothing%></td>
</tr>
</table></form>
<form action="kehu_manage.asp" method="post" name="form2" id="form2">
<table width="90%" height="30" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#F7F7F7">表格显示菜单:
<%for i = 0 to ubound(list02)
response.write listdh02(i)&"<input type='checkbox' name='list_cd' id='list_cd' value='"&list02(i)&"' />"
next%>
<input type="submit" name="Submit2" value="显示所选" /></td>
</tr>
</table></form>
</body>
</html>