⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subpass.asp

📁 图书管理系统功能完善,界面美观.这是基于ASP做的一个简单的系统,同大家一起分享.
💻 ASP
字号:
<%
	'如果用户没有登陆,则结束响应
	if session("admin_name")="" then response.end

	'记录集对象
	set rs=server.createobject("adodb.recordset")
%>
<!--#include file="conn.asp"-->
<script>
  function openbag(id) { window.open("submore.asp?sub_id="+id,"","height=400,width=600,left=190,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");} 
</script>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta http-equiv="content-language" content="zh-cn">
<link href=../style.css rel=stylesheet type=text/css>
</head>
<%
	'获得当前页数
	page=request.querystring("page")

	'当前页数的默认设置为1
	if page="" then page=1
	if not(isnumeric(page)) then page=1
	page=int(page)
	if page<1 then page=1

	'查询订单
	sql="select * from sub where sub_check=0 order by sub_id desc"

	'打开记录集
	rs.open sql,conn,3,3

	'如果记录集为空,则显示没有订单
	if rs.eof then
		response.write "暂且没有任何订单"
		rs.close
	else
		'设置每页显示数目
		rs.pagesize=10
		'总记录数
		totalrec=rs.recordcount
		'总的页数
		totalpage=rs.pagecount

		'如果当前页数大于总页数,则设置当前页为最后一页
		if page>totalpage then page=totalpage

		'设置记录集的页面位置
		rs.absolutepage=page
		rs.cachesize=rs.pagesize
		i=0

		'数组定义
		dim sub_id(),user_name(),sub_number(),sub_adds(),sub_date()

		'循环将记录集中各字段的值存储到相应的数组中
		do while not rs.eof and (i<rs.pagesize)
			i=i+1
			redim preserve sub_id(i),user_name(i),sub_number(i),sub_adds(i),sub_date(i)
			sub_id(i)=rs("sub_id")
			user_name(i)=rs("user_name")
			sub_number(i)=rs("sub_number")
			sub_adds(i)=rs("sub_adds")
			sub_date(i)=rs("sub_date")

			'移至下一条记录
			rs.movenext
		loop
    
		'关闭记录集
		rs.close

		'显示分页控制超级链接和所有订单的信息
%>
	<table border="0" width="100%" cellspacing="1">
	<tr>
	<td width="100%" colspan="4">共<font color=red><%=totalpage%></font>页 第<%=page%>页         
	<font color=666666><%if page-1>0 then%>
	<a href="subpass.asp?page=<%=page-1%>">上一页</a>
	<%else%>上一页<%end if%>
	<%if page+1<=totalpage then%>
	<a href="subpass.asp?page=<%=page+1%>">下一页</a>
	<%else%>下一页</font><%end if%></td>
	</tr>
	<tr>
	<td width="25%">订单号</td>
	<td width="25%">订货人</td>
	<td width="25%">地址</td>
	<td width="25%">日期</td>
	</tr>
	<%for i=1 to ubound(sub_id)%>
	<tr>
	<td width="25%"><a href='javascript:openbag(<%=sub_id(i)%>)'><%=sub_number(i)%></td>
	<td width="25%"><%=user_name(i)%></td>
	<td width="25%"><%=sub_adds(i)%></td>
	<td width="25%"><%=sub_date(i)%></td>
	</tr>
	<%next%>
	<tr>
	<td width="100%" colspan="4">共<font color=red><%=totalpage%></font>页 第<%=page%>页         
	<font color=666666><%if page-1>0 then%>
	<a href="subpass.asp?page=<%=page-1%>">上一页</a>
	<%else%>上一页<%end if%>
	<%if page+1<=totalpage then%>
	<a href="subpass.asp?page=<%=page+1%>">下一页</a>
	<%else%>下一页</font><%end if%></td>
	</tr>
    </table>
<%
	end if

	'释放记录集对象
	set rs=nothing

	'关闭数据库连接,释放对象
	conn.close
	set conn=Nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -