index.asp

来自「旅游管理系统 用ASP+SQL 2」· ASP 代码 · 共 110 行

ASP
110
字号
<html>
<head>
<meta name=vs_targetSchema content="HTML 4.0">
<title>旅行社旅游线路网上预订</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/css1.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" style="background-color: #999999" text="#000000" topmargin="5">
<!--#include file="includefile/conn.asp" -->
<!--#include file="includefile/shoubu.asp" -->
<%
dim page
page=Request("page")
if page="" or not isNumeric(page) then 
page=1
end if
sql="select * from xianlu order by id desc"
rs.open sql,,1,1
if rs.RecordCount = 0 then
Response.Write "<div align='center'><font color='#9933FF' size='5'>被操作的数据库暂时还为空!</font></div>"
else
rs.PageSize = 10
%>
<table width="755" border="0" cellspacing="0" cellpadding="0" align="center" class="shizhou">
  <tr>
    <td height="22" align="center">尊敬的客户您好!我们旅行社现有<b><%=rs.RecordCount%></b>条精品旅游线路供您选择,每页显示<b><%=rs.PageSize%></b>条,分<b><%=rs.PageCount%></b>页显示。<%
    if rs.PageCount >= 0 then
    Response.Write "分页:"
    for i=1 to rs.PageCount
    %>
      <a href="index.asp?page=<%=i%>">『<%=i%>』</a> 
      <%
    next
    end if
    %></td>
  </tr>
</table>
<script id=clientEventHandlersVBS language=vbscript>
<!--
Sub buttongo_onclick
  if not IsNumeric (form1.page.value) then
window.alert ("请输入一个大于0而小于当前所有分页的数字!")
form1.page.focus 
else
form1.submit
end if
End Sub
-->
  </script>
<table width="755" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#CCCCCC">
  <tr> 
    <td height="22" width="31" align="center" bgcolor="#EFEFEF">ID号</td>
    <td height="22" width="406" bgcolor="#EFEFEF" align="center" class="xia">线路名称</td>
    <td height="22" width="80" align="center" bgcolor="#EFEFEF">时间</td>
    <td height="22" width="69" align="center" bgcolor="#EFEFEF">类型</td>
    <td height="22" width="108" align="center" bgcolor="#EFEFEF">报价 元/人</td>
    <td height="22" width="54" align="center" bgcolor="#EFEFEF">预订</td>
  </tr>
  <tr> 
<%
  dim i
  i=0
	while not Rs.EOF and i<(page-1)*10
	RS.MoveNext
	i=i+1
	wend
	while not Rs.eof and i<page*10
%>
    <td height="20" width="31" align="center" bgcolor="#EFEFEF"><%=rs("id")%></td>
    <td height="20" width="406" onmouseover="me.bgcolor='#EFEFEF'" onmouseout="me.bgcolor='#FFFFFF'" bgcolor="#FFFFFF"> <a href="listxianlu.asp?id=<%=rs("id")%>" target =_blank title="点击这里查看此线路的祥细信息" ><%=rs("x_name")%></a> </td>
    <td height="20" width="80" align="center" bgcolor="#FFFFFF"><%=rs("x_shijian")%></td>
    <td height="20" width="69" align="center" bgcolor="#FFFFFF"><%=rs("x_leixun")%></td>
    <td height="20" width="108" align="center" bgcolor="#FFFFFF"><%=rs("x_baojia")%></td>
    <td height="20" width="54" align="center" onmouseover=me.bgcolor="#EFEFEF" onmouseout="me.bgcolor='#FFFFFF'" bgcolor="#FFFFFF"><a href="giveme.asp?id=<%=rs("id")%>" target=_blank title="我要预订这条线路">预订</a></td>
  </tr>
    <%i=i+1
Rs.MoveNext
		wend
%>
</table>
  <table width="755" border="0" cellspacing="0" cellpadding="0" align="center" class="shizhou">
    <tr> 
     <form name="form1" method="post" action="index.asp">
      <td height="22" width="639"> 
        <%  if rs.PageCount >= 0 then
    Response.Write "分页:"
    for i=1 to rs.PageCount
    %>
        <a href="index.asp?page=<%=i%>">『<%=i%>』</a> 
        <%
    next
    end if
    %>
      </td>
      <td height="22" width="45" bgcolor="#EFEFEF" align="center">转到:</td>
      <td height="22" width="71" bgcolor="#EFEFEF" align="center"> 
        <input type="text" name="page" size="3" class="input" value=<%=page%>>
        <input type="button" name="buttongo" value="GO" class="button">
      </td>
     </form> 
   </tr>
  </table>
<%
rs.close
conn.close
end if
%>
<!-- #include file= "includefile/weibu.asp" -->
</body>
</html>

⌨️ 快捷键说明

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