本人菜鸟,谁能帮我注释下这段ASP代码,谢谢啦!
我知道是实现分页功能的,但不知道具体意思,帮帮忙啦~<%constMaxPerPage=5dimtotalPutdimCurrentPagedimTotalPagesdi...
我知道是实现分页功能的,但不知道具体意思,帮帮忙啦~
<%
const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim sql
dim rs
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>风琳天下酒店—预定管理</title>
<link href='Images/Css.css' rel='stylesheet' type='text/css'>
</head>
<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>
<p align="center">
<%
Set Rs= Server.CreateObject("ADODB.Recordset")
sql="select * from Orders Where IdType='0' Order By Id"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'><font color=#81c7ec> <b>暂无信息</b> </font></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
end if
end if
rs.close
end if
sub showContent
%> 展开
<%
const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim sql
dim rs
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>风琳天下酒店—预定管理</title>
<link href='Images/Css.css' rel='stylesheet' type='text/css'>
</head>
<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>
<p align="center">
<%
Set Rs= Server.CreateObject("ADODB.Recordset")
sql="select * from Orders Where IdType='0' Order By Id"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'><font color=#81c7ec> <b>暂无信息</b> </font></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
end if
end if
rs.close
end if
sub showContent
%> 展开
2个回答
展开全部
<%
const MaxPerPage=5 "每页显示记录数量
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist) "获取记录数
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim sql
dim rs
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>风琳天下酒店—预定管理</title>
<link href='Images/Css.css' rel='stylesheet' type='text/css'>
</head>
<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>
<p align="center">
<%
Set Rs= Server.CreateObject("ADODB.Recordset")
sql="select * from Orders Where IdType='0' Order By Id"
rs.open sql,conn,1,1 "查询数据库表orders找出符合条件的记录
if rs.eof and rs.bof then
response.write "<p align='center'><font color=#81c7ec> <b>暂无信息</b> </font></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then "通过页码和每页记录判断是否超记录了
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage "记录数除于每页显示最大记录数得出页数
else
currentpage= totalPut \ MaxPerPage + 1 "刚好为整数时显示多一页
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"Orders.asp" "如果页数为1则显示
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark "书签
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
end if
end if
rs.close
end if
sub showContent
%>
const MaxPerPage=5 "每页显示记录数量
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist) "获取记录数
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim sql
dim rs
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>风琳天下酒店—预定管理</title>
<link href='Images/Css.css' rel='stylesheet' type='text/css'>
</head>
<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>
<p align="center">
<%
Set Rs= Server.CreateObject("ADODB.Recordset")
sql="select * from Orders Where IdType='0' Order By Id"
rs.open sql,conn,1,1 "查询数据库表orders找出符合条件的记录
if rs.eof and rs.bof then
response.write "<p align='center'><font color=#81c7ec> <b>暂无信息</b> </font></p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then "通过页码和每页记录判断是否超记录了
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage "记录数除于每页显示最大记录数得出页数
else
currentpage= totalPut \ MaxPerPage + 1 "刚好为整数时显示多一页
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"Orders.asp" "如果页数为1则显示
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark "书签
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"Orders.asp"
showContent
showpage totalput,MaxPerPage,"Orders.asp"
end if
end if
rs.close
end if
sub showContent
%>
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询