<!--#include file="inc/conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="top.asp"-->
<%
dim rs,sql,b,bb,i,tj,class1,class2,cnmai,diqu,key
set rs=server.createobject("ADODB.recordset")
key=trim(request("keyword"))
class1=trim(request("class1"))
cnmai=request("cnmai")
if request("page")="" then
  ThisPage=1		
else
  ThisPage=request("page")
end if
%>
<HTML><HEAD><TITLE><%=title%>-全部商家</TITLE></HEAD>
<BODY topMargin=0>
<!--#include file="topcnmai2.asp" -->
<div align="center">
<table width="760" bgcolor="#FFFFFF" style="border-left:1px solid #CCCCCC; border-right:1px solid #CCCCCC; padding:1px; " cellspacing="0" cellpadding="0">
<tr><td height="30" class=td5_muen width="100%" colspan="2">  
  <font color="#008080">&nbsp; 位置导航：</font><a href="index.asp">首页</a> <font color="#008080">→</font> 全部商家</td>
</tr>
<tr>
<td width="100%" colspan="2">
<form action="allcom.asp?cnmai=3" name="myform" method="POST" style="line-height: 200%; margin-top: 0; margin-bottom: 0"> 
<p align="left" style="line-height: 200%; margin-top: 4px; margin-bottom: 0">
&nbsp; <span class="font1"><font face="Wingdings 2" size="4">R</font></span>&nbsp;<%
dim rsc,sqlc
set rsc=server.createobject("adodb.recordset")
sqlc = "select * from class1 order by paixu desc"
rsc.open sqlc,conn,1,1
if rsc.eof and rsc.bof then
response.write "请先添加栏目。"
response.end
else
%><SELECT name="class1"  size="1" onchange="location=this.options[this.selectedIndex].value">
<OPTION selected value="allcom.asp">选择分类</OPTION>
<%do while not rsc.eof
%><OPTION value="allcom.asp?class1=<%=trim(rsc("id"))%>&cnmai=1"><%=trim(rsc("class1"))%></OPTION>
<%
rsc.movenext
loop
end if
rsc.close
set rsc=nothing
%></SELECT>&nbsp;<img border="0" src="image/search.gif">
<input name="keyword" type="text"  size="30" onFocus="this.select()" onBlur="if (value ==''){value='商家关键字'}" onClick="if(this.value=='商家关键字')this.value=''"onMouseOver="this.focus()" value="商家关键字"> 
<input type="submit" value="搜商家" name="B2"></form><hr size="1"></td>
</tr>
<tr>
<td valign="top" width="600">
<table border="1" width="100%" id="table1" cellspacing="1" bordercolor="#F2F2F2" style="border-collapse: collapse">
<%
dim ThisPage,Pagesize,Allrecord,Allpage,leixing
tj=0
Select Case cnmai
Case "1"
sql = "select * from com where class1="&class1&" order by vip desc,jf desc,zcdata desc"
Case "2"
sql = "select * from com where vip=1 order by jf desc,zcdata desc"
Case "3"
sql = "select * from com where com like '%"&key&"%' or comabout like '%"&key&"%' or username like '%"&key&"%' or name like '%"&key&"%' order by vip desc,jf desc,zcdata desc"
Case Else
sql = "select * from com  order by vip desc,zcdata desc"
End Select
rs.open sql,conn,1,1
rs.Pagesize=10
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then                           
ThisPage=1                           
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
if rs.eof then
response.write "还没有商家信息！"
else
do while not rs.eof
b=trim(rs("b"))
bb=len(b)
response.write "<tr>"
response.write "<td align=""middle"" width=120 height=120 rowspan=2>"
if right(rs("logo"),4)=".gif" or right(rs("logo"),5)=".jpeg" or right(rs("logo"),4)=".jpg"then
response.write "<a target=""_blank"" href=""com.asp?com="&rs("username")&"""><img src="""&rs("logo")&""" align=""middle"" border=0 width=120 height=90 alt=""店标""></a>"
else
response.write "<a target=""_blank"" href=""com.asp?com="&rs("username")&"""><img src=""image/nopic.gif"" align=""middle"" border=0 alt=""没有店标""></a>"
end if
response.write "</td>"
response.write "<td style=""BACKGROUND-COLOR: #F3F3F3"" height=""26"" width=350>"
response.write "<img src=""image/point05.gif"">"
response.write "<a target=""_blank"" title="""&rs("com")&"""  href=com.asp?com="&rs("username")&">"
if rs("vip")="1" then
response.write "<font size=3  face=""黑体"" color=""red""><u>"&rs("com")&"</u></font>"
else
response.write "<font size=3  face=""黑体""><u>"&rs("com")&"</u></font>"
end if
response.write "</a>"
response.write " "&rs("jf")&"'"
if rs("vip")="1" then
response.write "<img src=""image/num/jian.gif"" alt=""特约商家"">"
end if
response.write "</td></tr> "
response.write "<tr><td>"&mid(rs("comabout"),1,120)&"<br>"
if rs("vip")="1" then
response.write "联系电话：<b>"&rs("dianhua")&"</b><br>联 系 人：<b>"&rs("name")&"</b><br>店铺地址：<b>"&rs("dizhi")&"</b>"
else
if request.cookies("cnmai")("username")="" then
response.write "联系电话：<b>普通会员登陆可见</b><br>联 系 人：<b>普通会员登陆可见</b><br>店铺地址：<b>普通会员登陆可见</b>"
else
response.write "联系电话：<b>"&rs("dianhua")&"</b><br>联 系 人：<b>"&rs("name")&"</b><br>店铺地址：<b>"&rs("dizhi")&"</b>"
end if
end if
response.write "</td></tr>"

response.write "<tr><td background=""image/bar6.gif"" height=3 colspan=7></td></tr>"
tj=tj+1
rs.movenext
if tj>=Pagesize then exit do
loop
end if
rs.close
set rs=nothing
%>
</table>


<center>
<table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#F2F2F2" width="100%">
<tr> 
<td height="25" width="151">
<p align="center">
共有&nbsp;<font color="#CC5200"><%=Allrecord%></font>&nbsp;条记录</td>
<td height="25" width="126">
<p align="center">共 <font color="#CC5200"><%=Allpage%></font> 页</td>
<td height="25" width="118">
<p align="center">现在是第 
<font color="#CC5200"><%=ThisPage%></font> 页</td>
<td height="25" width="183">
<p align="center">
<%
if ThisPage<2 then     
response.write "<font color=""#808080"">首页</font>&nbsp;"
response.write "<font color=""#808080"">上一页</font>&nbsp;"     
else     
response.write "<a href=?page=1&class1="&class1&"&cnmai="&cnmai&">首页</a>&nbsp;"
response.write "<a href=?page="&ThisPage-1&"&class1="&class1&"&cnmai="&cnmai&">上一页</a>&nbsp;"     
end if
if Allpage-ThisPage<1 then     
response.write "<font color=""#808080"">下一页</font>&nbsp;"
response.write "<font color=""#808080"">尾页</font>&nbsp;"  
else     
response.write "<a href=?page="&(ThisPage+1)&"&class1="&class1&"&cnmai="&cnmai&">下一页</a>&nbsp;"   
response.write "<a href=?page="&Allpage&"&class1="&class1&"&cnmai="&cnmai&">尾页</a>&nbsp;"     
end if
%></td>
</tr>
</table>
<td valign="top" width="250" bgcolor="#FFF7FF">
<p style="line-height: 200%; margin-top: 0; margin-bottom: 0"><img src=image/allcom1.gif title="最新商家信息"><br><%
sql = "select top 15 * from com order by zcdata desc"
call newcom
%><p style="line-height: 200%; margin-top: 0; margin-bottom: 0"><img src=image/allcom2.gif title="商家积分排行"><br><%
sql = "select top 15 * from com order by jf desc"
call newcom
%></td></table>    
<!--#include file="endcnmai.asp" -->
</div>

</BODY></HTML>  
<%
Conn.Execute("Update xinxi Set b=0 where DateDiff('D',fbsj,now())>="&b_y&" and rz=1")
closedb
%>