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

📄 room_list.asp

📁 ASP程序实现的酒店预定系统
💻 ASP
字号:
<!--#include file="../Include/AdoConn.asp"-->
<%
'删除
dim delcode,delcode1
delcode=request("delcode")'此参数由JS生成
delcode1=request("delcode1")
if delcode<>"" and delcode1<>"" then 
   strsql="delete from xt_td_room  where 酒店编码='" &  delcode & "'"
   strsql=strsql & " and 房型序号='" & delcode1 & "'"
   conn.execute strsql
   Response.redirect("Room_list.asp?code=" & delcode & "&page=" & request("page"))
   response.end
end if
%>
<%
'''''''''''是否已经有酒店信息
code=Request("code")
if code="" then response.redirect("hotel_query.asp")
strsql="select 酒店名_cn from xt_td_hotel where 酒店编码='" & code & "'"
set rst=conn.execute(strsql)
if rst.eof then response.redirect("hotel_query.asp")
sHotelName=rst(0)

strsql="select 酒店编码,房型序号,房型_cn,房型_kr,门市价,会员价 from xt_td_room where 酒店编码='"+code+"' order by 房型_cn"
set rst=server.CreateObject ("adodb.recordset")
rst.Open strsql,conn,3,2
%>
<script language="javascript">
function del(code,code1)
{
	msgzh= confirm ("确定要删除这条记录吗?")
	if (msgzh)
	{
	document.forms(0).action="room_list.asp?delcode="+code+"&delcode1="+code1+"&page="+"<%=request("page")%>"
	document.forms(0).submit()
	}
}
</script>
<html>
<head>
<title>城市列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/Css/All.css">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#999999">
  <form name=ConList method="post" action="">
    <tr bgcolor="#FFFFFF"> 
      <td colspan="4" height="30"><b>酒店名称:<%=sHotelName%></b></td>
      <td colspan="3" height="30">
        <p align="right"><a href="room_edit.asp?code=<%=code%>">添加新房型</a></td>
    </tr>
    <tr bordercolor="#0099FF" bgcolor="#FFF4E6" align="center"> 
      <td width="47" height="20"> 
        <div align="center">序号</div>
      </td>
      <td width="163" height="20">中文房型</td>
      <td width="163" height="20">韩文房型</td>
      <td width="120" height="20" bgcolor="#FFF4E6">门市价</td>
      <td width="163" height="20">会员价</td>
      <td width="60" height="20"> 
        <div align="center">修改</div>
      </td>
      <td width="60" height="20"> 
        <div align="center">删除</div>
      </td>
    </tr>
    <%
rst.pagesize=10 '每页最多显示
'页面参数异常处理
if request("page")="" then 
	page=1
else
	page=cint(request("page"))'从URL获取当前要显示的页
end if
if page<1 then page=1
if page>= rst.pagecount then page=rst.pagecount

if not rst.eof then
	rst.absolutepage=page '当前页为page参数指定的页
	rowcount=rst.pagesize'当页的记录数
	ThisCordCount=rst.PageSize*(page-1)+1
end if	
do while not rst.eof and rowcount>0
%>
    <tr bgcolor="#FFFFFF" valign="top"> 
      <td width="47" height="18"> 
        <div align="center"><%=ThisCordCount%></div>
      </td>
      <td height="18"><%=rst(2)%></td>
      <td height="18"><%=rst(3)%></td>
      <td height="18" ><%=rst(4)%></td>
      <td height="18" align="center"><%=rst(5)%></td>
      <td height="18" align="center"><a href=<%="room_edit.asp?code=" & rst(0) & "&code1=" & rst(1)%>><img src="../Images/edit.gif" width="20" height="17" border="0"></a></td>
      <td height="18" align="center"><a href="javascript:del(<%=rst(0)%>,<%=rst(1)%>)"><img src="../Images/del1.gif" width="19" height="17" border="0"></a></td>
    </tr>
    <%
rst.movenext '纪录指针下移
rowcount=rowcount-1
ThisCordCount=ThisCordCount+1
loop
%>
    <tr bgcolor="#FFF4E6"> 
      <td colspan="7" height="20" align=center> 
        <p align="right"> 
        <%if page>1 then%> 
	    <a href=<%="room_list.asp?code=" & code & "&page=1"%> class=blank>首页</a> |      
        <a href=<%="room_list.asp?code=" & code & "&page=" & (page-1)%> class=blank>上一页</a> |      
        <%else%>    
        首页 |     
        上一页 |     
        <%end if  %>    
		<%if page<>rst.pagecount then  %>   
		<a href=<%="room_list.asp?code=" & code & "&page="&(page+1)%> class=blank>下一页</a> |     
        <a href=<%="room_list.asp?code=" & code & "&page="&rst.pagecount %> class=blank>末页</a> |     
        <%else  %>   
        <%Response.Write "下一页 | "  %>   
        <%Response.Write "末页"  %>   
        <%end if  %>   
		<%response.write "     第"&page&"页/共"&rst.pagecount &"页/共"&rst.RecordCount&"条记录"%>     
      </td>     
    </tr>     
<tr bgcolor="#FFFFFF"> 
<td height="30" colspan="7"><A href="javascript:parent.history.back();" 
                  onmouseover="window.status='Back'; return true;"><IMG alt="" border=0 
                   src="../images/back.jpg" align="left" ></a></td> 
</tr> 
  </form>     
</table>     
<%     
'关闭对象,释放内存     
rst.close     
set rs=nothing     
conn.close     
set conn=nothing     
%>     
</body>     
</html>     

⌨️ 快捷键说明

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