<!--#include file="conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sqltext="select * from hotelb where htype='"&request("htype")&"' order by paixu asc" 
rs.open sqltext,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="images/site.css" type=text/css rel=stylesheet>
<title>上饶折扣网---折扣消费大舞台!</title>
<style>
<!--
td {
	font-family: Arial, Helvetica, sans-serif;
}
.style5 {font-size: 14px}
a:link {
	text-decoration: none;
}
.style4 {color: #e20000}
.style3 {color: #FF0000}
.style1 {	color: #FF0000;
	font-weight: bold;
}
.cm_rlink {
	FILTER: alpha(opacity=100); LEFT: 0px; POSITION: absolute; TOP: 0px
}
.poll {
	FONT-SIZE: 9pt; WORD-SPACING: -3px; FONT-FAMILY: "&#46027"; arial
}
-->
</style>
</head>

<body bgColor=#ffffff leftMargin=1 background="images/right_bg2.gif" topMargin=0 style="text-align: right">
<!-- #include file="top.asp"-->

<!-- Top顶部表格 -->
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="table2" height="238" bgcolor="#FFFFFF">
	<tr>
		<td background="images/left_bg2.gif" width="9">　</td>
		<td valign="top" width="180" bgcolor="#FFFFFF">
		<!-- #include file="left.asp"-->
</td>
		<td width="9" background="images/left_bg1.gif">　</td>
		<td width="9">　</td>
		<td width="518" valign="top">
		<table border="0" width="100%" id="table12">
			<tr>
				<td>
                <p align="center"><img border="0" src="images/<%select case request("htype")
                case "食在上饶" response.write "1.jpg"
                case "潮流搜店" response.write "02.jpg"
                case "玩转上饶" response.write "03.jpg"
                case "住在上饶" response.write "04.jpg"
                case "美在饶城" response.write "05.jpg"
                case "装饰建材" response.write "06.jpg"
                case "IT手机" response.write "07.jpg"
                case "家用电器" response.write "08.jpg"
                case "综合服务" response.write "09.jpg"
                end select
                %>" ></p>
                </td>
			</tr>
			<tr>
				<td>　</td>
			</tr>
			<tr>
				<td>
<%dim MaxPerPage
MaxPerPage=20

'假如没有数据时
If rs.eof and rs.bof then 
   call emptylist
   call showpages

   CurrentPage=1

else

'取得页数,并判断用户输入的是否数字类型的数据，如不是将以第一页显示
dim text,checkpage
text="0123456789"
 Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
   checkpage=instr(1,text,mid(request("page"),i,1))
   if checkpage=0 then
      exit for 
   end if
next

If checkpage<>0 then
      If NOT IsEmpty(request("page")) Then
        CurrentPage=Cint(request("page"))
        If CurrentPage < 1 Then CurrentPage = 1
        If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
      Else
        CurrentPage= 1
      End If
      If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
   CurrentPage=1
End if
call list
call showpages


If Rs.recordcount > MaxPerPage then
   call showpages
end if
End if
'显示帖子的子程序
Sub list()%>				
              <table border="0" width="100%" id="table13" cellspacing="1" bordercolor="#FFFFFF" bordercolorlight="#DEDEDE" cellpadding="0" bordercolordark="#FFFFFF">
				<tr style="font-size:14px">
					<td bgcolor="#FF6600" height="31" align="center">
					<font color="#FFFFFF">商家名称</font></td>
					<td bgcolor="#FF6600" height="31" align="center">
					<font color="#FFFFFF">类型</font></td>
					<td bgcolor="#FF6600" height="31" align="center">
					<font color="#FFFFFF">区域</font></td>
				</tr>
<%                                 
if not rs.eof then                                 
  i=0                                 
  do while not rs.eof                                  
%> 				
				<tr <%if i mod 2=0 then response.write "bgcolor=#EFEFEF"%>>
					<td height="28">·<a  href="hoteldetail.asp?id=<%=rs("id")%>"  style="font-size:14px"><%=rs("name")%></a><%if rs("huiyuan")=1 then%><font color="#FF0000">（加盟店）</font><%end if%></td>
					<td height="28" style="font-size:14px" align="center"><%=rs("htype")%></td>
					<td height="28" style="font-size:14px" align="center"><%=rs("eara")%></td>
				</tr>
<%                                 
   i=i+1                                 
   if i >= MaxPerpage then exit do                                 
   rs.movenext                                 
   loop                                 
end if                                 
%> 				</table>
<%                                 
End sub                                 

'显示空帖子的子程序
Sub emptylist()%>				
              <table border="0" width="100%" id="table13" cellspacing="1" bordercolor="#FFFFFF" bordercolorlight="#DEDEDE" cellpadding="0" bordercolordark="#FFFFFF" height="127">
				<tr style="font-size:14px">
					<td bgcolor="#FF6600" height="30" align="center">
					<font color="#FFFFFF">商家名称</font></td>
					<td bgcolor="#FF6600" height="30" align="center">
					<font color="#FFFFFF">类型</font></td>
					<td bgcolor="#FF6600" height="30" align="center">
					<font color="#FFFFFF">区域</font></td>
				</tr>
				<tr>
					<td height="94" colspan="3">
					<p align="center"><font color="#CC3300" style="font-size:14px">暂无此类
					商家信息</font></td>
				</tr>
				</table>
<%                                 
End sub                                                               
%> 	
<%'显示翻页的子程序
sub showpages()%><p>
<table width=100% background=images/bg1.gif border=0 border="0" cellPadding="0" cellSpacing="0">
<tr height=41><td >
<%
response.write "<form method=Post action='hoteList.asp' name=111>"
%>
<input type=hidden value=<%=request("htype")%> name=htype>
<div align="center">
<table border="0" cellPadding="0" cellSpacing="0" width="100%" >
<tr>
<td>
<%
htype=request("htype")

If currentpage > 1 Then
response.write "<input type='button' class='buttonx5'  value='首页' onclick=window.location='hoteList.asp?page="+cstr(1)+"&htype="+htype+"'>&nbsp;"
Response.write "<input type='button' class='buttonx5'  value='上一页' onclick=window.location='hoteList.asp?page="+Cstr(currentpage-1)+"&htype="+htype+"'>&nbsp;"
Else
Response.write "<input type='button' class='buttonx5'  value='首页' disabled>&nbsp;"
Response.write "<input type='button' class='buttonx5'  value='上一页' disabled>&nbsp;"
End if

If currentpage < rs.PageCount Then
Response.write "<input type='button' class='buttonx5'  value='下一页' onclick=window.location='hoteList.asp?page="+Cstr(currentPage+1)+"&htype="+htype+"'>&nbsp;"
Response.write "<input type='button' class='buttonx5'  value='尾页' onclick=window.location='hoteList.asp?page="+Cstr(rs.PageCount)+"&htype="+htype+"'>&nbsp;&nbsp;"
Else
Response.write "<input type='button' class='buttonx5'  value='下一页' disabled>&nbsp;"
Response.write "<input type='button' class='buttonx5'  value='尾页' disabled>&nbsp;&nbsp;"
End if

Response.write "页次：" & Cstr(CurrentPage)&"/"&Cstr(rs.pagecount) 

response.write "</SPAN></td><td align='right'class=text3>"
response.write "转到：<input type='text' name='page' size=2 maxlength=4  value="&Currentpage&">&nbsp;"
response.write "<input type='submit'  value='Go'  name='cndok' class='buttonx5'>&nbsp;&nbsp;"
%>
</font>
</td>
</tr>
</table>
</div>
</td></tr>
</table>
</form>
<%end sub%>                                
				
				</td>
			</tr>
			<tr>
				<td>　</td>
			</tr>
			<tr>
				<td>
				<p align="center"></td>
			</tr>
			</table>
		</td>
		<td width="9">　</td>
		<td width="9" background="images/left_bg2.gif">　</td>
    <TD class=main_bg vAlign=top bgColor=#e5e5e5>  <!-- #include file="right.asp"--></TD>
		<td background="images/left_bg1.gif" width="9">　</td>
	</tr>
</table>
<!-- #include file="bottom.asp"-->
</body>

</html>