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

📄 city_list_kr.asp

📁 ASP程序实现的酒店预定系统
💻 ASP
字号:
<!--#include file="../Include/AdoConn.asp"-->
<%
dim PageName	'本网页名
dim TableName	'本页涉及的数据表名
dim KeyWord		'各表主关键字名称
dim KeyType		'主键类型,自动增加型为"空",字符型为 " ' "
dim WhereOther	'where 语句后的其他选项,如order by 
PageName="City_List.asp"
TableName="xt_vd_city"
KeyWord="城市编码"
KeyType=""
WhereOther="order by 所在省 desc"
%>
<script language="javascript">
function del(code)
{
	msgzh= confirm ("确定要删除这条记录吗?")
	if (msgzh)
	{
	document.forms(0).action="<%=PageName%>?delcode="+code
	document.forms(0).submit()
	}
}
</script>
<%
dim delcode
delcode=request.querystring("delcode")'此参数由JS生成
if delcode<>"" then 
strsql="delete from "&TabLeName&" where "& KeyWord &"="& KeyType & delcode & KeyType
conn.execute strsql,1
Response.Write "此记录已删除!"
Response.End 
end if
dim objres,strsql
	if Request.QueryString ("query")="query" then '根据查询界面生成查询语句
		dim code,name,strSQLWhere,strQueryType
		'是否进行模糊查询
		if Request.Form("checkbox").Count=1 then
		   strQueryType="%"
		   else 
		   strQueryType=""
		end if

		'按查询界面各输入框生成多条件where选项
		name=Request.Form ("name")
		name2=Request.Form ("name2")
		questionType=Request.Form ("questionType")
		if not name="" then
		   strSQLWhere=strSQLWhere+" and 业务员 like '"+strQueryType+name+strQueryType+"'"
		end if
		if not name2="" then
		   strSQLWhere=strSQLWhere+" and 客户名称 like '"+strQueryType+name2+strQueryType+"'"
		end if
		if not questionType="" then
		   strSQLWhere=strSQLWhere+" and 问题类型 like '"+strQueryType+questionType+strQueryType+"'"
		end if
	end if	

	strsql="select * from "&TableName&" where 1=1 "+strSQLWhere+WhereOther
	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="100%" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#999999">
  <form name=ConList method="post" action="">
    <tr bordercolor="#0099FF" bgcolor="#FFF4E6" align="center"> 
      <td width="43" height="20"> 
        <div align="center">序号</div>
      </td>
      <td width="138" height="20">城市中文名</td>
      <td width="145" height="20">韩文城市名</td>
      <td width="69" height="20"> 所在区</td>
      <td width="73" height="20" bgcolor="#FFF4E6"> 所在省</td>
      <td width="83" height="20"> 
        <div align="center">区号</div>
      </td>
      <td width="72" height="20">邮编</td>
      <td width="60" height="20"> 
        <div align="center">修改</div>
      </td>
      <td width="68" height="20"> 
        <div align="center">删除</div>
      </td>
    </tr>
    <%
if rst.recordcount<=0 then '如果没有记录
%>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="9">对不起,没有符合要求的记录! </td>
    </tr>
    <%
	response.end
else'有记录
rst.pagesize=10 '每页最多显示2条纪录
page=cint(request("page"))'从URL获取当前要显示的页
'页面参数异常处理
if page="" then page=1
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
do while not rst.eof and rowcount>0
%>
    <tr bgcolor="#FFFFFF" valign="top"> 
      <td width="43" height="18"> 
        <div align="center"><%=ThisCordCount%></div>
      </td>
      <td width="138" height="18"><%=rst("中文城市名")%></td>
      <td width="145" height="18"><%=rst("韩文城市名")%></td>
      <td width="69" height="18"><%=rst("中文地区名")%></td>
      <td width="73" height="18" ><%=rst("中文省名")%></td>
      <td width="83" height="18" align="center"><%=rst("区号")%></td>
      <td width="72" height="18" align="center"><%=rst("邮编")%></td>
      <td width="60" height="18" align="center"><a href="city_edit.asp?code=<%=rst("城市编码")%>" target="_blank"><img src="../Images/edit.gif" width="20" height="17" border="0"></a></td>
      <td width="68" height="18" align="center"><a href="javascript:del(<%=rst("城市编码")%>)"><img src="../Images/del1.gif" width="19" height="17" border="0"></a></td>
    </tr>
    <%
rst.movenext '纪录指针下移
rowcount=rowcount-1
ThisCordCount=ThisCordCount+1
loop
end if
%>
    <tr bgcolor="#FFF4E6"> 
      <td colspan="9" height="20" align=center> 
        <%if page>1 then 
	    response.write "<a href='"&PageName&"?page=1' class=blank>首页</a> | " 
        response.write "<a href='"&PageName&"?page="&(page-1)&"' class=blank>上一页</a> | " 
        else
        Response.Write "首页 | "
        Response.Write "上一页 | "
        end if 
		if page<>rst.pagecount then 
		response.write "<a href='"&PageName&"?page="&(page+1)&"' class=blank>下一页</a> | " 
        response.write "<a href='"&PageName&"?page="&rst.pagecount&"' class=blank>末页</a> | " 
        else
        Response.Write "下一页 | "
        Response.Write "末页"
        end if
		response.write "          第"&page&"页/共"&rst.pagecount &"页/共"&rst.RecordCount&"条记录"%>
      </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 + -