<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
  data_path="../" 'ACC连接数据库路径，对SQL无效 %>
<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=WebName%>-关键词竞价</title>
<link href="<%=HOPE_InstallDir%>blue/blue.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<%=HOPE_InstallDir%>images/General.css" type="text/css" />
<style type="text/css">
<!--
.STYLE2 {
	color: #1D8FCD;
	font-size: 16px;
}
.STYLE5 {color: #188ECE; font-size: 16px; }
.STYLE6 {font-size: 16px}
-->
</style>
</head>
 <body leftMargin=0 topMargin=0  >
   <!--#include file="../inc/head.asp"--> <br />
   <div class="juzhong1">
<table width="780" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="<%=HOPE_PageWidth%>" style="border-collapse:collapse" height="23" border="1" cellpadding="0" cellspacing="0" bordercolor="#E7E7E7" bgcolor="#F9F9F9"  >
    <tr> 
      <td width="5">  </td>
      <td height="25" align="left"> 当前位置：<a href="<%=HOPE_InstallDir%>">首页</a> > <a href="<%=HOPE_InstallDir%>price/index.asp">关键词竞价</a>    </td>
    </tr>
	<tr><td colspan="2" height="2"  bgcolor="#999999"></td></tr>
</table>
   <table width="<%=HOPE_PageWidth%>"  height="23" border="1" style="border-collapse:collapse" bordercolor="#E6E6E6" cellpadding="0" cellspacing="0"  >
     <tr>
       <td   height="50" ><table   border="0" width="90%" align="center" cellpadding="0" cellspacing="0"  >
           <tr style="font-size:14px; font-weight:bold">
             <td width="18%"><span class="STYLE6"><font color="#FF0000">①</font></span>.选择关键词→</td>
             <td width="17%"><span class="STYLE6"><font color="#FF0000">②</font></span>.出价→</td>
             <td width="18%"><span class="STYLE6"><font color="#FF0000">③</font></span>.竞价成功→</td>
             <td width="11%"><span class="STYLE6"><font color="#FF0000">④</font></span>.付款→</td>
             <td width="36%"><span class="STYLE6"><font color="#FF0000">⑤</font></span>.享受信息优先排前服务</td>
           </tr>
       </table></td>
     </tr>
 </table>
   <table width="<%=HOPE_PageWidth%>" border="0" cellpadding="0" cellspacing="0">
<tr><td height="40">
  <%=replace(HOPE_HotKeyW,"热门搜索关键字","<b><font color=#0099CC>热门搜索关键字</font></b>")%>
 </td></tr></table>
 	 <table width="<%=HOPE_PageWidth%>" style="border-collapse:collapse" border="1" cellpadding="0" cellspacing="0" bordercolor="#E7E7E7">
		 <form  name="form1" method="post" action="searchprice.asp"> <tr bgcolor="#F7F7F7" height="30">
 	 <td width="59"  >&nbsp;</td>
 	 <td width="719">
       查询关键词竞价情况：
       <input name="keywords" type="text" id="keywords" maxlength="16" />
        <input type="submit" name="Submit" value="我要查询" />
    </td></tr> </form>
</table>
	     <table width="<%=HOPE_PageWidth%>" style=" border-collapse:collapse" border="1" cellpadding="0" cellspacing="0" bordercolor="#E7E7E7">
		 <tr><td colspan="4"  height="1"></td></tr>
	 <% 
	 if Replace_Text(request("keywords"))<>"" then 
	 %>
	 <tr><td colspan="4" height="30">&nbsp;关键词&nbsp;<font color="red"><b><%=Replace_Text(request("keywords"))%></b></font>&nbsp;→&nbsp;&nbsp;<a href="searchprice.asp?keywords=<%=Replace_Text(request("keywords"))%>&action=2">当前竞价</a>&nbsp;  <a href="searchprice.asp?keywords=<%=Replace_Text(request("keywords"))%>&action=1">历史竞价</a><br />
       </td></tr>
	<%
	 if Replace_Text(request("action"))="2" then 
	  sqlv="SELECT   Websen_temp_price.*,Websen_corporation.[user],Websen_corporation.qymc,Websen_corporation.gradeid   FROM Websen_temp_price  ,Websen_corporation  where Websen_corporation.id=Websen_temp_price.gsid and  Websen_corporation.flag=1 and  keywords='"&Replace_Text(request("keywords"))&"' order by Websen_temp_price.price desc,Websen_temp_price.addtime desc"
    elseif Replace_Text(request("action"))="1" then 
	 sqlv="SELECT   Websen_history_price.*,Websen_corporation.[user],Websen_corporation.qymc,Websen_corporation.gradeid   FROM Websen_history_price  ,Websen_corporation  where Websen_corporation.id=Websen_history_price.gsid and  Websen_corporation.flag=1 and  keywords='"&Replace_Text(request("keywords"))&"' order by Websen_history_price.price desc,Websen_history_price.addtime desc"
    else
	 sqlv="SELECT   Websen_temp_price.*,Websen_corporation.[user],Websen_corporation.qymc,Websen_corporation.gradeid   FROM Websen_temp_price  ,Websen_corporation  where Websen_corporation.id=Websen_temp_price.gsid and  Websen_corporation.flag=1 and  keywords='"&Replace_Text(request("keywords"))&"' order by Websen_temp_price.price desc,Websen_temp_price.addtime desc"

	end if
	Set rsv=Server.CreateObject("adodb.recordset")
	 rsv.open sqlv,conn,1,1
 	 if  rsv.eof then
	 response.Write("<tr><td  colspan=4 height=30  align=center bgcolor=#E3EFF9 ><font color=#666666>暂无数据</font></td></tr>")
	 else
	 i=1
	  %>
     <tr bgcolor="#EFEFEF"><td width="92">&nbsp;&nbsp;
       <%if Replace_Text(request("action"))="2" then response.Write("<font color=#666666>当前竞价</font>")else response.Write("<font color=#666666>历史竞价</font>") end if %></td>
         <td width="272" height="26" align="center"><strong>竞价公司</strong></td>
         <td width="163" height="26" align="center"><strong>金额(元)</strong></td>
         <td width="251" height="26" align="center"><strong>竞价时间</strong></td>
       </tr>
	   <%
	  do while not rsv.eof 
	   %>
       <tr>
         <td align="center"  >&nbsp;
         <%
		 if i<=3 then 
		 response.Write("<font color=#666666>第<font color=red>"&i&"</font>名</font>")
		 end if 
 		 %></td>
         <td>&nbsp;
		 <%
  		'--是否使用的名片页------------------------------------------------------------
		   set rsmp=server.CreateObject("adodb.recordset")
		   sqlmp="select  top 4 * from Websen_vipgrade where roleid="&rsv("gradeid")
		   rsmp.open sqlmp,conn,1,1
		   if not rsmp.eof  then 
 	
		   if instr(rsmp("rolelist"),"qw")>0 then							
			if is2weburl=1 then
			%>
							<a href="http://<%=rsv("user")%>.<%=weburl1%>"  target="_blank"><font color="#666666"><%=rsv("qymc")%></font></a>
							<%else%>
							<a href="<%=HOPE_InstallDir%>vipcom/<%=rsv("user")%>/" target="_blank"><font color="#666666"><%=rsv("qymc")%></font></a>
							<%
		  end if 
		  else
		  %>
							<a href="<%=HOPE_InstallDir%>Ptcom/<%=rsv("user")%>.html" target="_blank"><font color="#666666"><%=rsv("qymc")%></font></a>   
	   <%
 		  end if
		  rsmp.close
		  end if
  		 %></td>
         <td  align="center"><font color="red"><%=rsv("price")%></font></td>
         <td height="25" align="center"><%=rsv("addtime")%></td>
       </tr>
	   <tr><td colspan="4" bgcolor="#F6F6F6"  height="1" ></td></tr>	
	   <% 
	   if i=10 then exit do
	   i=i+1
	   rsv.movenext
	   loop
	   
	end if 
	set rsv=nothing
	end if
	   
	    %>
 
 </table>
        <br />
 	 <table   border="1" bordercolor="#EAEAEA" style="border-collapse:collapse" cellpadding="0" cellspacing="0" width="<%=HOPE_PageWidth%>" >
	 <tr><td colspan="5"></td></tr><tr>
	 
	 <%
	set rs=server.CreateObject("adodb.recordset")
    sql="SELECT DISTINCT keywords  FROM Websen_temp_price  order by keywords "
    rs.open sql,conn,1,1
     	if rs.eof or rs.bof then 
		%>
		<td height="50"  colspan="5"   align="center"><font color=red>对不起 !暂无任何关键词竞价的信息！ </font></td>
		<%
		
	 else 
	msg_per_page=30 
	rs.pagesize=msg_per_page  
	
	if not (rs.eof and rs.bof) then
		totalrec=RS.RecordCount 
		if rs.recordcount mod msg_per_page=0 then 
			n=rs.recordcount\msg_per_page' 
		else
			n=rs.recordcount\msg_per_page+1                        
		end if                                                                
		currentpage=Replace_Text(request("page")) 	
		If currentpage <> "" then
			currentpage =  cint(currentpage)
			if currentpage < 1 then  
				currentpage = 1
			end if  
			if err.number <> 0 then  
				err.clear
				currentpage=1
			end if
		else
			currentpage=1
		End if                                                                
		if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then 
			currentPage=1
		end if
		rs.absolutepage=currentpage 
		rowcount=rs.pagesize 
	end if
	i=1
 do while not rs.eof and rowcount > 0
 %>
 
     <td height="25">
 &nbsp; <A href="searchprice.asp?page=<%=request("page")%>&keywords=<%=rs("keywords")  %>"><%=rs("keywords")%> </A>
 </td>
<%
if i mod 5=0 then
response.Write("</tr><tr>")
end if
i=i+1
rowcount=rowcount-1
rs.movenext
loop
 
%>
</td></tr>
<tr><td colspan="5" align="center"><%call listPages("searchprice.asp?action="&Replace_Text(request("action"))&"&keywords="&Replace_Text(request("keywords"))&"")%></td></tr>
<%
end if
%></table>
     <!--#include file="../inc/end.asp"-->
	 <div>
</body>
</html>
 <%
 rs.close
 	conn.close
	set conn=nothing
%>