<%@ page language="C#" autoeventwireup="true" inherits="admin_search_userkeyslist, localhost_deploy" %>
<%@ Register Src="../../common/pageContent.ascx" TagName="pageContent" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>搜索关键词列表页面</title>
<link href="/admin/common/client.css" rel="stylesheet" type="text/css" />
<style>
.show1{
display:none;
}
</style>
<script language="javascript">
function AddKeyInFast(s_key)
{
	top.o_parentFrame=window;
	window.open("userkeyslist.aspx?do=add&key="+escape(s_key)+"&rnd="+Math.random(),"fredo");
}

function GetKeyTop(obj,s_key)
{
		obj.style.display="none";
		$P('txtcol').value+=s_key+"\r\n";
}

function ShowKeyAdd(s_key)
{
	
	if(("\r\n"+$P('txtcol').value+"\r\n").search("\r\n"+s_key+"\r\n")<0)
	{
		document.write("<input type='button' class='button' value='采集' onclick=\"GetKeyTop(this,'"+s_key+"')\" />");
	}
	 
}
</script>
</head>
<body class="mg3">
<%
	//详细列表
	string s_url= "userkeyslist.aspx?to="+Para("to")+"&from="+Para("from")+"&date="+Para("date")+"&type="+Para("type")+"&rang="+Para("rang")+"&ord=";
	PageContent.ImagePageBar=true;
  PageContent.Table="User_Keys";
	PageContent.Url = ""+s_url+ Para("ord") + "&pn=@pagenumber@";
	PageContent.PageBody("@@Const.PageTable()@@","@@Const.PageBar(\"\")@@","<tr id='trhead'>@content@</tr>","<tr id='tr_@K_ID@'>@content@</tr>");
	PageContent.AddList("<td>编号</td>","<td>@ItemNumber@</td>");
	
	if(Para("type")=="1")
	{
		//组记录
		PageContent.SQL=" select K_Name,K_Name as _url_name,count(k_name) as kcnt,(select count(*) from Sys_FastResult where F_Key=K_name) as fcnt from User_Keys where " +GetWhere().Replace("'","#") + " group by k_name  ";
	  PageContent.SQLCount="select count(*) as cnt from (select count(*) from User_Keys where " +GetWhere().Replace("'","#") + " group by k_name )";
		PageContent.AddList("@@Const.PageOrderField('"+s_url+"','K_Name','" + Para("ord") + "','关键词')@@", "<td><a target='_blank' href='/search.aspx?tp=5&wd=@_url_name@'>@K_Name@</a></td>");
		PageContent.AddList("@@Const.PageOrderField('"+s_url+"','count(k_name)','" + Para("ord") + "','搜索量')@@", "<td>@kcnt@</td>");
		PageContent.AddList("<td width='10%'>快速提示</td>", "<td>&nbsp;<input type='button' class='button show@fcnt@' value='加入提示' onclick=\"AddKeyInFast('@k_name@')\" /></td>");
		PageContent.AddList("<td width='10%'>采集</td>", "<td>&nbsp;<script language='javascript'>ShowKeyAdd('@k_name@')</script></td>");
		
		 
	}
	else
	{	
		//0 详细记录
		PageContent.SQL=" select K_Type,K_ID,K_Name,K_Name as _url_name,K_Time as _time_Key,K_IP,K_Count from User_Keys where " +GetWhere().Replace("'","#") ;
	  PageContent.AddList("@@Const.PageOrderField('"+s_url+"','K_Name','" + Para("ord") + "','关键词')@@", "<td><a target='_blank' href='/search.aspx?tp=5&wd=@_url_name@'>@K_Name@</a></td>");
		PageContent.AddList("@@Const.PageOrderField('"+s_url+"','K_Time','"+Para("ord")+"','搜索时间')@@","<td>@_time_Key@</td>");
		PageContent.AddList("@@Const.PageOrderField('"+s_url+"','K_IP','"+Para("ord")+"','用户地址')@@","<td>@K_IP@</td>");
		PageContent.AddList("@@Const.PageOrderField('"+s_url+"','K_Type','"+Para("ord")+"','搜索类型')@@","<td>@@Csharp.GetSelectValue('@K_Type@','##Const.SearchListType()##')@@</td>");
		PageContent.AddList("@@Const.PageOrderField('"+s_url+"','K_Count','"+Para("ord")+"','结果数量')@@","<td>@K_Count@</td>");
	}
%>
<%//=PageContent.SQL%>
<uc1:pageContent ID="PageContent" runat="server" />


</body>
</html>   
