<%
dim startime,endtime,idArr
startime=timer()
%> 
<!--#include file="Include/Conn.asp" -->
<!--#include file="Include/Char.asp" -->
<!--#include file="Include/const.asp" -->
<!--#include file="Include/ubbcode.asp" -->
<%
'过滤关键词
     m_Keywords = checkStr(Trim(Request("Keywords")))
	' m_keywords=replace(m_Keywords,"%20"," ")
	
	 if m_Keywords<>"" then
	 idArr=split(site_info(8),",")
	 for i = 0 to ubound(idArr)
	 m_Keywords=replace(m_Keywords,idArr(i),"")
	 next
	 i=0
	 end if
	 
Function gradeimage(gradevalue)
select case gradevalue
case "4"
response.write "<img src='Images/medal/icon_golden.gif' title='金牌商家' width='25' height='29' hspace='0' vspace='0' align='absmiddle'>"
case "3"
response.write "<img src='Images/medal/icon_general.gif' title='银牌商家' width='25' height='29' hspace='0' vspace='0' align='absmiddle'>"
case "2"
response.write "<img src='Images/medal/icon_copper.gif' title='铜牌商家' width='25' height='29' hspace='0' vspace='0' align='absmiddle'>"
case else
response.write ""
end select
End function
%>

<html>
<head>
<title>襄樊搜索 - 搜索<%=m_Keywords%>在折扣商家</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="襄樊搜索是立足于襄樊本地的搜索引擎。提供襄樊吃喝玩乐住行游等方面信息的搜索查询。">
<meta name="keywords" content="襄樊信息港,生活消费,休闲娱乐,时尚,家政,安居,旅游,购物,美食,交友,俱乐部,特约商户,消费打折">
<!--#include file="Include/style1.css"-->
<script>
window.status="襄樊折扣商家搜索"; 
</script>
</HEAD>
<body topmargin="5">
<!--#include file="Include/top_search.inc"-->
<TABLE cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
  <TR>
    <TD>
      <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0" class="td1">
	<TR>
    	  <TD width="9" height="28"></TD>
    	  <TD width="100">&nbsp;</TD>
    	  <TD width="1"><IMG src="images/icon/_1.gif"></TD>
    	  <TD width="75" class="td1"><a href="/so/Search.asp?keyword=<%=server.urlencode(m_Keywords)%>" class="menu1">网站网页</a></TD>
    	  <TD width="75" class="td2"><a href="/so/CardSearch.asp?keywords=<%=server.urlencode(m_Keywords)%>" class="menu">折扣商家</a></TD>
    	  <TD width="1"><IMG src="images/icon/_1.gif"></TD>
    	  <TD width="75" class="td1"><a href="/so/InfoSearch.asp?keywords=<%=server.urlencode(m_Keywords)%>" class="menu1">分类信息</a></TD>
		  <TD width="75" class="td1"><a href="/so/ClassADSearch.asp?keywords=<%=server.urlencode(m_Keywords)%>" class="menu1">都市生活</a></TD>
    	  <TD width="1"><IMG src="images/icon/_1.gif"></TD>
    	  <TD class="td1">&nbsp;</TD>
	<TR>
      </TABLE>
    </TD>
  </TR>
  <TR>
    <TD height="60" class="tdbg1">
      <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
	<TR>
    	  <TD>&nbsp;</TD>
    	  <TD>

            <TABLE cellSpacing=0 cellPadding=0 width="550" border=0>
              <form name="form1" method="get" action="/so/CardSearch.asp">
                <TBODY>
                  <TR>
                    <TD width="240" align="right"><INPUT name=Keywords value="<%=m_Keywords%>" class="input2" size=22></TD>
                    <TD width="70" align="center">
                      <select name="selBigCategory" onChange="TypeChange(this);" >
                        <%
             mSql="Select F_ID,F_Value From T_CityType where F_ID=15 order by F_ID"
			 Set rst = conn.Execute(mSql)

			 mBigArray = rst.GetRows()
			 for i=0 to ubound(mBigArray,2)
			   mSql2="Select * From T_AreaType Where F_CityTypeID="&mBigArray(0,i)&" order by F_Grade"
			   Set rst = conn.Execute(mSql2)
			   strSmallCategory = mBigArray(0,i)&"-"
			   Do While not rst.Eof 
			     
   			     strSmallCategory = strSmallCategory & rst("F_ID")&"+"&rst("F_Value")+"-"
				 rst.Movenext
			   Loop
			   Response.write "<option value="&strSmallCategory&">"&mBigArray(1,i)&"</option>"
			 next'for
          %>
                      </select>
                      <script language="javascript">                               
function TypeChange(theSelect)
{
var sTemp,sString,i,sBigTypeID;
sValue=theSelect.value;
sSubTypeArray=sValue.split("-");
sBigTypeID = sSubTypeArray[0];
sString="<select name='TypeID'>";
 sString+="<option value='"+sBigTypeID+":all'>全　部</option>";
for(i=1;i<sSubTypeArray.length-1;i++)
{
 sTemp=sSubTypeArray[i].split("+");
 sString+="<option value='"+sBigTypeID+":"+sTemp[0]+"'>"+sTemp[1]+"</option>";
}

sString+="</Select>"
form1.TypeID.outerHTML=sString;

}
    </script>
                    </TD>
                    <TD>
                      <select name="TypeID" >
                      </select>
                      <script language="javascript">TypeChange(form1.selBigCategory);</script>
                    </TD>
                    <TD>
                      <select name="TradeTypeID">
                        <%
								Response.write "<option value='all'>所有类别</option>"
								m_SQL =  "SELECT F_ID,F_Value FROM T_TradeType ORDER BY F_ID"
								SET  rst = conn.Execute(m_SQL)
								Do While Not rst.Eof 
								  Response.write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								  rst.MoveNext
								Loop
								rst.Close
								%>
                      </select>
                    </TD>
                    <TD><INPUT type="image" src="images/td/button_search.gif" width="68" height="24" name="Submit"></TD>
                  </TR>
                  </FORM>
                 </TABLE>

	  </TD>
	<TR>
      </TABLE>
    </TD>
  </TR>
  <TR>
    <TD height="1" bgcolor="#c0c0c0">
    </TD>
  </TR>
  <TR>
    <TD height="29" background="images/bg/bg_td_001.gif">
      <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
	<TR>
    	  <TD width="70%" class="result_content">　<b>搜索：</b></span>襄樊所有的商家信息</TD>
    	  <TD></TD>
	</TR>
      </TABLE>
    </TD>
  </TR>
</TABLE>

<TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
  <TR>
    <TD height="5"></TD>
  </TR>
</TABLE>

	<%
    m_TypeID = checkStr(Trim(Request("TypeID")))
	if instr(m_TypeID,":") <> 0 then
      m_BigCategoryID = mid(m_TypeID,1,instr(m_TypeID,":")-1)
      m_SmallCategoryID = mid(m_TypeID,instr(m_TypeID,":")+1)
    else
	  m_BigCategoryID = "all"
	  m_SmallCategoryID = "all"
	end if
	
    m_TradeTypeID = checkStr(Request("TradeTypeID"))
	if m_TradeTypeID = "" then m_TradeTypeID = "all"	
	
	 m_iscard = checkStr(Trim(Request("iscard")))
    m_Parameter = "TypeID="&m_TypeID&"&TradeTypeID="&m_TradeTypeID&"&Keywords="&server.urlencode(m_Keywords)&"&iscard="&m_iscard
    dim m_RecordCount,m_PageNo,m_Page,mcc
    m_RecordCount=0 : m_PageNo=0 : m_Page=0
	m_PageSize = 15 '每页显示数录数
    m_PageNo = Trim(Request("PageNo"))
	Set rs = Server.createobject("Adodb.RecordSet")
    m_SQL = "SELECT  * FROM CityCard_League WHERE (ischecked=1)"
	
	if m_SmallCategoryID <> "all" then
	  m_SQL = m_SQL +" and cityid="&m_SmallCategoryID
	else
	  if m_BigCategoryID <> "all" then m_SQL = m_SQL +" and stateid="&m_BigCategoryID
	end if
	
	if m_TradeTypeID <> "all" then
	  m_SQL = m_SQL +" and hangyeid="&m_TradeTypeID
	end if
	
	if m_Keywords<>"" then
	     idwords=split(m_Keywords," ")
	      wordsql1=""
		  wordsql2=""	 
		  wordsql3=""	 
	     for i = 0 to ubound(idwords)
	
		  if idwords(i)<>"" then 
		  if i>0 then
		   wordsql1 = wordsql1 +" and " 
		   wordsql2 = wordsql2 +" and " 
		   wordsql3 = wordsql3 +" and " 
		  end if	   
     	 wordsql1 = wordsql1 +" name like  '%" & idwords(i) &"%'"
         wordsql2 = wordsql2 +" address like  '%" & idwords(i) & "%'"
     	 wordsql3 = wordsql3 +" content like  '%" & idwords(i) & "%'"	
		  end if 
	     next
		 wordsql=wordsql1&" or "&wordsql2&" or "&wordsql3	
	m_SQL = m_SQL +" and ( "&wordsql&" )"
	end if
	' m_iscard="card"
	'if m_iscard="card" then
	m_SQL = m_SQL +" and iscard<>'0,0'"
	'end if
	m_SQL = m_SQL +" order by companyid desc"
	
	rs.open m_SQL,conn,1,1
	if rs.Eof then
	   response.write ""  '暂无查询记录显示
    else
      m_RecordCount = rs.RecordCount
      rs.PageSize = m_PageSize
      m_Page = rs.PageCount
      if m_PageNo = ""  then m_PageNo =1
      if cint(m_PageNo) < 1 or cint(m_PageNo) > m_Page then m_PageNo = 1
      rs.AbsolutePage = m_PageNo
      rc = m_PageSize
	  	%>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TR>
    <TD vAlign=bottom width="63%" height=35 class="result_content"><STRONG>&nbsp;&nbsp;<% if m_Keywords<>"" then %>
        &quot;<%=m_Keywords%>&quot; <% end if %>相关商家</STRONG></SPAN> 共找到<span class="result_highlight"><%=m_RecordCount%></span> 家(耗时 <% endtime=timer() %><%=FormatNumber((endtime-startime),3,-1)%>秒)
    </TD>
    <TD vAlign=bottom width="37%"><A href="/CardManage/Reginfo.asp" class="dark1" target=_blank>我要发布</A></TD>
  </TR>
</TABLE>

<%     
 End if
%>	

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TR>
    <TD valign=top>
	<% 
	re = 1
	m_Count = 1'另加
	if not rs.eof then
	mcc=(m_PageNo*m_PageSize)-m_PageSize+1  '设定数值序号
	
	 Do while not rs.eof and rc>0
	  m_Count = m_Count +1'另加
	  if m_Count mod 2 then m_BgColor = "ffffff" else m_BgColor = "f9f9f9" '另加
        '---------------------------------
	
		'调用显示内容
        ShowContent()
        '----------------------------------
      rs.MoveNext
      re = re+1
      rc = rc-1
	  mcc=mcc+1
    Loop
	rs.Close
	else
	%>

<!-- include nothing -->

<TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
  <TR>
    <TD height="40" class="result_content">　<B>小提示</B>：你只需输入商家的名称，地址，电话，经营项目等信息，就可以搜索到你想要的商家信息了！</TD>
  </TR>
  <TR>
    <TD height="80"><p class="result_content">　<IMG src="images/icon/icon_alert.gif" align="absmiddle"> 对不起！未找到和您的查询相匹配的内容，请您另选关键字搜索！</p></TD>
  </TR>
</TABLE>

	<%
	end if 
	 Sub ShowContent()
  cardfile=""
  if rs("iscard")=1 then
  cardfile="../Card/"
  end if
  %>
      	<TABLE cellSpacing=0 cellPadding=0 width="90%" bgcolor="<%=m_BgColor%>" border=0 style="border: #CCCCCC dotted; border-width: 1px 0px 0px 0px;">
          <TBODY>
            <TR> 
              <TD colSpan=4 height=10></TD>
            </TR>
            <TR> 
              <TD align=center width=25></TD>
              <TD colSpan=2><a target="_blank" class="result_title" href="/card/show.asp?id=<%=rs("companyid")%>">

                <% if m_Keywords<>"" then %>
                <%
				'idwords=split(m_Keywords," ")
				re_text=rs("name")
				for i = 0 to ubound(idwords)
				re_text=replace(re_text,idwords(i),"<SPAN class='result_highlight'>"&idwords(i)&"</span>")
				next
				response.write re_text
				%>
                <% else %>
                <%=rs("name")%>
                <% end if %></a>
		<%=gradeimage(rs("grade"))%> 
                &nbsp;<FONT color=#666666>[ 
                <% =datevalue(rs("adddate")) %>
                ]</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                <%
						  Response.write "<img src='../Images/card/fl/fl_"&rs("hangyeid")&"_s.jpg' width='20' height='20' hspace='0' vspace='0' align='absmiddle' border=0>"
						 m_SQL = "SELECT F_ID,F_Value FROM T_TradeType WHERE F_ID="&rs("hangyeid")
						  Set rst = conn.Execute(m_SQL)
						  Response.write " <a href='/card/Search.asp?TypeID="&m_TypeID&"&TradeTypeID="&rst(0)&"'>"
						  Response.write ""&rst(1)&""
						  Response.write "</a>"
						  rst.Close
					   %></TD>
              <TD height=23>&nbsp;</TD>
            </TR>
            <TR> 
              <TD width=25>&nbsp;</TD>
              <TD width="200" class="result_content">联系电话：<% =rs("tel") %> </TD>
              <TD width="500" class="result_content">联系地址： 
                <% if m_Keywords<>"" then %>
                <%
				re_text=rs("address")
				for i = 0 to ubound(idwords)
				re_text=replace(re_text,idwords(i),"<font color=#ff6600>"&idwords(i)&"</font>")
				next
				response.write re_text
				%> 
			  <% else %> 
			  <%=rs("address")%> 
			  <% end if %>
	      </TD>
              <TD width=44>&nbsp;</TD>
            </TR>
            <TR> 
              <TD width=25>&nbsp;</TD>
              <TD colSpan=2>
		<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                  <TBODY>
                    <TR> 
                      <TD width=70 class="result_content">简　　介：</TD>
                      <TD rowSpan=2 valign=top class="result_content"> <% if deleteHtmlTag(rs("content"))<>"" then %> 
				  <% if m_Keywords<>"" then %> 
				<%
				'idwords=split(m_Keywords," ")
				re_text=left(deleteHtmlTag(rs("content")),150)
				for i = 0 to ubound(idwords)			
				re_text=replace(re_text,idwords(i),"<font color=#ff6600><b>"&idwords(i)&"</b></font>")
				next
				response.write re_text
				 %>
				  <% else %> 
				  <%=left(deleteHtmlTag(rs("content")),150)%> 
				  <% end if %> 
				  ...<% end if %> <a target="_blank" class="line" href="/card/show.asp?id=<%=rs("companyid")%>">[详细内容]</A>
		      </TD>
                    </TR>
                    <TR> 
                      <TD>&nbsp;</TD>
                    </TR>
                  </TBODY>
                </TABLE>
	      </TD>
              <TD width=44 rowSpan=2>&nbsp; </TD>
            </TR>
            <TR> 
              <TD width=25>&nbsp;</TD>
              <TD colSpan=2 class="result_content">相关网页：<a class="result_url" target="_blank" href="/card/show.asp?id=<%=rs("companyid")%>">
                       /card/show.asp?id=<%=rs("companyid")%>                    
              </a></TD>
            </TR>
            <TR>
              <TD width=25>&nbsp;</TD>
              <TD colSpan=3>更多同类商家:

                <%
						 m_SQL = "SELECT F_ID,F_Value FROM T_TradeType WHERE F_ID="&rs("hangyeid")
						  Set rst = conn.Execute(m_SQL)
						  Response.write " <a class='a1' target='_blank' href='/card/Search.asp?TypeID="&m_TypeID&"&TradeTypeID="&rst(0)&"'>"
						  Response.write " 襄樊信息港：商家大全："&rst(1)&""
						  Response.write "</a>"
						  rst.Close
					   %>

	      </TD>
            </TR>
            <TR> 
              <TD colSpan=4 height=10></TD>
            </TR>
          </TBODY>
        </TABLE>
		     <%
				   End Sub
				  %>
      </TD>

    <TD vAlign=top align=center width=220>

<!-- 右侧关键字广告区 -->

      <TABLE width="95%" cellSpacing="0" cellPadding="0" border="0" class="table_border">
        <TR>
          <TD align=center background="images/bg/bg_td_title.jpg" height="32"><A href="/card" target="_blank" style="behavior:url(include/font.htc)" class="content">查看更多商家信息</A></TD>
        </TR>
      </TABLE>
					<%					
					dim PerPage
				    set rs_c=server.createobject("adodb.recordset")
					sql_c="SELECT  * FROM CityCard_League WHERE (tj='1')"
					if m_TradeTypeID <> "all" then
	                   sql_c=sql_c&" and hangyeid="&m_TradeTypeID
	                 end if					
					 if m_Keywords<>"" then					 
					 sql_c=sql_c&" and ("
					  for i = 0 to ubound(idwords)					  
					   if idwords(i)<>"" then 
					   if i>0 then sql_c=sql_c&" or "
					  sql_c=sql_c&" name like  '%" & idwords(i) & "%'"
					    end if
					  next
					 sql_c=sql_c&" ) "
					 end if
					sql_c=sql_c&" order by grade desc ,tuijian desc"
					rs_c.open sql_c,conn,1,1
					'response.write sql_c
					'response.end
					'flag="尚未处理"
                    PerPage=12
				
                   '假如没有数据时
                 ' If rs_c.eof and rs_c.bof then
                  ' response.write "<p align='center'><font color='#ff0000'>还没任何新闻</font></p>"
                 ' response.end
                 ' End if
					'取得页数,并判断用户输入的是否数字类型的数据，如不是将以第一页显示
                    text="0123456789"
                    Rs_c.PageSize=PerPage
					
                    for i=1 to len(m_PageNo)
                    checkpage=instr(1,text,mid(m_PageNo,i,1))
                    if checkpage=0 then
                    exit for
                    end if
                    next

                  If checkpage<>0 then
                  If NOT IsEmpty(m_PageNo) Then
                  CurrentPage=Cint(m_PageNo)
                  If CurrentPage < 1 Then CurrentPage = 1
                  If CurrentPage > Rs_c.PageCount Then CurrentPage = Rs_c.PageCount
                  Else
                  CurrentPage= 1
                  End If
                 If not Rs_c.eof Then Rs_c.AbsolutePage = CurrentPage end if
                 Else
                 CurrentPage=1
                 End if					
		
if not rs_c.eof then
i=1
do while not rs_c.eof
%>

<!-- 右侧商家展示 -->

      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TR>
          <TD height=5></TD>
        </TR>
      </TABLE>

      <TABLE cellSpacing=2 cellPadding=2 width=95% border=0 class="result_table">
	<TR>
	  <TD><a target="_blank" class="result_title_right" href="/card/show.asp?id=<%=rs_c("companyid")%>">
            	<% if m_Keywords<>"" then %>
                <%
				re_text=rs_c("name")
				for m = 0 to ubound(idwords)
				re_text=replace(re_text,idwords(m),"<span class='result_highlight'>"&idwords(m)&"</span>")
				next
				response.write re_text
				%> 
                <% else %>
                <%=rs_c("name")%> 
                <% end if %></A>
	  </TD>
	</TR>
	<TR>
	  <TD>地址：<%=rs_c("address")%></TD>
	</TR>
	<TR>
	  <TD>电话：<% =left(rs_c("tel"),20) %></TD>
	</TR>
	<TR>
	  <TD class="result_url">
	<% if rs_c("website")<>"" then %>
	<a target="_blank" class="result_url" href="<%=rs_c("website")%>"><%=rs_c("website")%></a>
	<% else %>
	<a class="result_url" target="_blank" href="/card/show.asp?id=<%=rs_c("companyid")%>">
	/card/show.asp?id=<%=rs_c("companyid")%>
	</a>
	<% end if %>
	  </TD>
        </TR>
      </TABLE>

      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TR>
          <TD height=5></TD>
        </TR>
      </TABLE>

<%
if i >= Perpage then exit do
i=i+1
rs_c.movenext
loop
end if
rs_c.close
set rs_c=nothing
%>

      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TR>
          <TD height=5></TD>
        </TR>
      </TABLE>

      <!-- 窄告开始 -->
    </TD>
  </TR>
</TABLE>
<!-- 分页过程 -->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TR>
    <TD height=5></TD>
  </TR>
</TABLE>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TR>
    <TD height=35>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><% Call ShowPage(m_Parameter)'调用示分页过程%%></td>
  </tr>
</table>

<%
	SUB ShowPage(strParameter)
  if m_PageNo = ""  then m_PageNo =1
  if cint(m_PageNo) < 1 or cint(m_PageNo) > m_Page then m_PageNo = 1
%>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TR>
          <TD align=center height=35 width="30%"> 页次：<span class="dark4"><%=m_PageNo%></span>/<span class="dark4"><%=m_Page%></span>页 每页<span class="dark4"><%=m_PageSize%></span>条记录 总数<span class="dark4"><%=m_RecordCount%></span>条</TD>
          <TD width="70%">
            
<%  If m_PageNo > 1 then  %>
            <a href='?Page=1&<%=strParameter%>'> <img alt='首页' src='images/arrow4.gif' border=0 width='11' height='11'></a>
            <% Else  %>
            <img alt='首页' src='images/arrow4-1.gif' border=0 width='11' height='11'>
            <%  End if 
  if m_PageNo > 1 then
  %>
            <a href='?PageNo=<%=m_PageNo-1%>&<%=strParameter%>' class="content5">上一页</a>
            <% else %>
            <span class="content">上一页</span>
            <% end if 

  dim m_PageNumber,m,n,i
  m_PageNumber = 9 '数字分页个数+1
  if m_PageNo-int(m_PageNumber/2) <= 1 then m = 1 else m = m_PageNo-int(m_PageNumber/2)
  if m+m_PageNumber > m_Page then 
    n = m_Page
    if m_Page-m_PageNumber <= 1 then m=1 else m = m_Page - m_PageNumber
  else
    n = m+m_PageNumber
  end if

  for i = m to n
    if pno = cint(m_PageNo) then
      response.write "&nbsp;span class='result_highlight'>"&i&"</span>"
    else
      response.write "&nbsp;<a class='td4' href='?PageNo="&i&"&"&strParameter&"'>["&i&"]</a>"
    end if
  next
  Response.Write "&nbsp"

  if int(m_PageNo) < int(m_Page) then
  %>
            <a href='?PageNo=<%=m_PageNo+1%>&<%=strParameter%>' class="content5">下一页</a>
            <% else %>
            <span class="content">下一页</span>
            <%  end if 
  if int(m_PageNo) < int(m_Page) then
  %>
            <a href='?PageNo=<%=m_Page%>&<%=strParameter%>'><img alt='末页' src='images/arrow2.gif' border=0 width='11' height='11'></a>
            <% else %>
            <img alt='末页' src='images/arrow2-1.gif' border=0 width='11' height='11'>
            <%  end if	%>
            </SPAN></TD>
	  </TR>
       </TABLE>
  <% End Sub %>
    </TD>
  </TR>
</TABLE>

<%
if m_Keywords="hpewghfhgldfhgfdlhgkdfhghhljljl" then 
		  'write search word 写入关键词
		  	set rst=server.createobject("adodb.recordset")
			sqlt="select * from search_word where f_class=1 and f_word='"&m_Keywords&"'"
			rst.open sqlt,conn,1,3
			if rst.eof then
			rst.addnew
			rst("f_word")=m_keywords
			rst("f_class")=1   '1=商家搜索  2=信息广场
			rst("F_update")=now()
			rst("f_ip")=Request.ServerVariables("REMOTE_ADDR") 
			rst.update
			else
			rst("f_hits")=rst("f_hits")+1   '搜索率
			rst("F_update")=now()
			rst("f_ip")=Request.ServerVariables("REMOTE_ADDR") 
			rst.update
			end if
			rst.close
			
%>


      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="result_table">
        <tr> 
          <td width="15%" align="center" class="content1">相关搜索：</td>
          <td width="85%" height="40">
	    <table width="100%" border="0" cellspacing="3" cellpadding="3">
              <tr align="center"> 
			  <% 			
			sqlt="select top 10 * from search_word where f_class=1"
				     if m_Keywords<>"" then					 
					 sqlt=sqlt&" and ("
					  for i = 0 to ubound(idwords)					  
					   if idwords(i)<>"" then 
					   if i>0 then sqlt=sqlt&" or "
					  sqlt=sqlt&" f_word like  '%" & idwords(i) & "%'"
					   end if
					  next
					 sqlt=sqlt&" ) "
					 end if
			
			sqlt=sqlt&" order by f_hits desc"
			rst.open sqlt,conn
			i=1
			do while not rst.eof
			%>
                <td><A href="?keywords=<%=server.urlencode(rst("f_word"))%>" class="result_related"><%=rst("f_word")%></a></td>
			<%
			if i mod 5=0 then response.write "</tr><tr align=center>"
			i=i+1
			rst.movenext
			loop
			rst.close
			set rst=nothing
			%>		
              </tr>
            </table>
	  </td>
        </tr>
      </table>

<% end if %>

<TABLE cellSpacing=3 cellPadding=3 width=100% border=0>
  <FORM name=form2 action=/so/select.asp method=get>
  <TR>
    <TD align=center width="15%" class="content1">继续搜索：</TD>
    <TD align=center>

      <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
	<TR>
	  <TD height="30">
	    <INPUT size=22 class="input2" value="<%=m_Keywords%>" name=KeyWords>
	    <INPUT style="FONT-SIZE: 14px; HEIGHT: 25px" type=submit value=" 搜索 " name=Submit>
	  </TD>
	</TR>
	<TR>
	  <TD height="30">
	    <INPUT type=radio value=1 name=t> 网站网页
	    <INPUT type=radio CHECKED value=3 name=t> 折扣商家
	    <INPUT type=radio value=4 name=t> 分类信息
	    <INPUT type=radio value=5 name=t> 信息广场
	  </TD>
	</TR>
      </TABLE>

    </TD>
  </TR>
  </FORM>
</TABLE>

<!--#include file="../include/bottom.asp"-->
</BODY>
</HTML>
