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

📄 user_list.asp

📁 ASP程序实现的酒店预定系统
💻 ASP
字号:
<!--#include file="../Include/AdoConn.asp"-->
<%
'删除此用户
dim delcode
delcode=request.querystring("delcode")'此参数由JS生成
if delcode<>"" then 
   strsql="delete from xt_td_user where 会员卡号='" & delcode & "'"
   conn.execute strsql
   strsql="delete from xt_td_bookup where 卡号='" & delcode & "'"
   conn.execute strsql
   Response.redirect("user_list.asp?page=" & request("page"))
end if
%>
<script language="javascript">
function del(code)
{
	msgzh= confirm ("确定要删除此用户吗?删除此用户同时将删除此用户所有定单!")
	if (msgzh)
	{
	document.forms(0).action="<%=PageName%>?delcode="+code+"&page="+"<%=request("page")%>"
	document.forms(0).submit()
	}
}
</script>
<%
	dim objres,strsql
	if Request.QueryString ("query")="query" then '根据查询界面生成查询语句
		dim code,name,strSQLWhere,strQueryType

		'按查询界面各输入框生成多条件where选项
		name=Request.Form ("CardNo")
		name2=Request.Form ("UserName")
		name3=Request.Form ("City")
		name4=Request.Form ("Email")
		name5=Request.Form ("Lbound")
		name6=Request.Form ("UBound")
		if not name="" then
		   strSQLWhere=strSQLWhere+" and 会员卡号 ='"+name+"'"
		end if
		if not name2="" then
		   strSQLWhere=strSQLWhere+" and 姓名 like '%"+name2+"%'"
		end if
		if not name3="" then
		   strSQLWhere=strSQLWhere+" and 城市 ='"+name3+"'"
		end if
		if not name4="" then
		   strSQLWhere=strSQLWhere+" and Email ='"+name4+"'"
		end if
		if not name5="" then
		   strSQLWhere=strSQLWhere+" and 积分>="+name5 
		end if
		if not name6="" then
		   strSQLWhere=strSQLWhere+" and 积分<="+name6 
		end if
		session("UserSQLWhere")=strSQLWhere
	else
		strSQLWhere=session("UserSQLWhere")
	end if	
	if Request.QueryString ("submit")="submit" then '设置优惠
		for i=1 to 10
			if request("txtCode"& i)="" then exit for
			if isnumeric(request("txtPrice" & i)) then
				if request("check"& i)="1" then
					sql="Update xt_td_hotel Set 价格=" & request("txtPrice" & i) & ",特惠=1" 
				else
					sql="Update xt_td_hotel Set 价格=" & request("txtPrice" & i) & ",特惠=0" 
				end if	
				sql=sql & " Where 酒店编码='" & request("txtCode" & i) & "'"
				conn.execute sql
			end if	
		next
	end if

	strsql="select 会员卡号,姓名,城市,EMail,移动电话,积分 from xt_td_user where 1=1 "+strSQLWhere+" order by 会员卡号"
	set rst=server.CreateObject ("adodb.recordset")
	rst.Open strsql,conn,3,2
%>
<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="588" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#999999">
  <form name=ConList method="post" action="hotel_list.asp?submit=submit&page=<%=request("page")%>">
    <tr bordercolor="#0099FF" bgcolor="#FFF4E6" align="center"> 
      <td width="33" height="20"> 
        <div align="center">序号</div>
      </td>
      <td width="73" height="20">会员卡号</td>
      <td width="83" height="20">姓名</td>
      <td width="56" height="20" bgcolor="#FFF4E6">城市</td>
      <td width="104" height="20"> 
        <div align="center">EMail</div>
      </td>
      <td width="72" height="20">移动电话</td>
      <td width="38" height="20">积分</td>
      <td width="40" height="20"> 
        <div align="center">修改</div>
      </td>
      <td width="33" height="20"> 
        <div align="center">删除</div>
      </td>
    </tr>
    <%
if rst.recordcount<=0 then '如果没有记录
%>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="9" width="580">对不起,没有符合要求的记录! </td>
    </tr>
    <%
	response.end
else'有记录
rst.pagesize=10 '每页最多显示2条纪录
'页面参数异常处理
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

rst.absolutepage=page '当前页为page参数指定的页
rowcount=rst.pagesize'当页的记录数
ThisCordCount=rst.PageSize*(page-1)+1
i=0
do while not rst.eof and rowcount>0
i=i+1
%>
    <tr bgcolor="#FFFFFF"> 
      <td width="33" height="18"> 
        <div align="center"><font size="2"><%=ThisCordCount%></font></div>
      </td>
      <td width="73" height="18"><font size="2"><%=rst(0)%></font></td>
      <td height="18" width="83"><font size="2"><%=rst(1)%></font></td>
      <td height="18" width="56" ><font size="2"><%=rst(2)%></font></td>
      <td height="18" align="center" width="104"><font size="2"><%=rst(3)%></font></td>
      <td height="18" align="center" width="72">
          <font size="2">
          <%=rst(4)%>      </font>      </td>  
      <td height="18" align="center" width="38"><font size="2"><%=rst(5)%></font></td>  
      <td height="18" align="center" width="40"><a href="user_edit.asp?code=<%=rst(0)%>"><font size="2"><img src="../Images/edit.gif" width="20" height="17" border="0"></font></a></td>  
      <td  height="18" align="center" width="33"><a href="javascript:del(<%=rst(0)%>)"><font size="2"><img src="../Images/del1.gif" width="19" height="17" border="0"></font></a></td>  
    </tr>  
    <%  
rst.movenext '纪录指针下移  
rowcount=rowcount-1  
ThisCordCount=ThisCordCount+1  
loop  
end if  
%>  
    <tr bgcolor="#FFF4E6">   
      <td colspan="10" height="20" width="580">   
      </td>  
    </tr>  
<tr>  
<td colspan="10" height="20" width="580"align="right" > 
<font color="#FFFFFF" >
        <%if page>1 then   
	    response.write "<a href='user_list.asp?page=1' class=blank>首页</a> | "   
        response.write "<a href='user_list.asp?page="&(page-1)&"' class=blank>上一页</a> | "   
        else  
        Response.Write "首页 | "  
        Response.Write "上一页 | "  
        end if   
		if page<>rst.pagecount then   
		response.write "<a href='user_list.asp?page="&(page+1)&"' class=blank>下一页</a> | "   
        response.write "<a href='user_list.asp?page="&rst.pagecount&"' class=blank>末页</a> | "   
        else  
        Response.Write "下一页 | "  
        Response.Write "末页"  
        end if  
		response.write "    第"&page&"页/共"&rst.pagecount &"页/共"&rst.RecordCount&"条记录"%>  
</font>		
</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 + -