<%@ page language="C#" autoeventwireup="true" inherits="admin_search_sekeysitem, localhost_deploy" %>
<%@ Register Src='../../common/formitem.ascx' TagName='formitem' TagPrefix='uc1' %>
<%@ 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 runat="server">
<title>网站入口编辑页</title>
<link href='/admin/common/client.css' rel='stylesheet' type='text/css' />
<style type='text/css' >
#V_Memo {height:90px;}
</style>
</head>
<body>
<br />
<%

	Formitem.Table="Sys_VisitedReport";
	Formitem.Head="修改信息";
	Formitem.Action="";
	Formitem.AddOther("@@Csharp.SetInputHidden('V_ID','##Table[\"Sys_VisitedReport\"].V_ID##')@@");
	
	Formitem.AddItem("<tr><td colspan='2'  class='tipbar'>基本信息</td></tr>");
	Formitem.AddItem("@@Csharp.SetShowText('地区','##Table[\"Sys_VisitedReport\"].V_Area##','')@@");	
	Formitem.AddItem("@@Csharp.SetShowText('时间','##Table[\"Sys_VisitedReport\"].V_Date##','')@@");	
	Formitem.AddItem("@@Csharp.SetShowText('IP地址','##Table[\"Sys_VisitedReport\"].V_IP##','')@@");	
	
	if(Formitem["V_SE"]!="0")
	{
		Formitem.AddItem("@@Csharp.SetShowText('方式','"+ts.TranslateAll("@@Csharp.GetSelectValue('"+Formitem["V_Buy"]+"','2,<span class=\"blue\">直接访问</span>|0,<span class=\"green\">自然排名</span>|1,<span class=\"red\">竞价推广</span>|3,<span style=\"color:deeppink;\">其他网站</span>')@@")+"','')@@");	
	}
	
	Formitem.AddItem("@@Csharp.SetShowText('本地页面','<a target=\"_blank\" href=\""+Formitem["V_Url"]+"\">"+Formitem["V_Title"]+"</a>','')@@");	
	Formitem.AddItem("@@Csharp.SetShowText('访问次数','##Table[\"Sys_VisitedReport\"].V_Visited## 次','')@@");	
	Formitem.AddItem("@@Csharp.SetShowText('停留时间','"+ts.TranslateAll("@@Csharp.ShowVisitedTime('"+Formitem["V_StayTime"]+"')@@")+"','')@@");	
	
	Formitem.AddItem("<tr><td colspan='2'  class='tipbar'>扩展信息</td></tr>");
	if(Formitem["V_SE"]!="0")
	{
		Formitem.AddItem("@@Csharp.SetShowText('搜索引擎','"+ ts.TranslateAll("@@Csharp.GetSelectValue('"+Formitem["V_SE"]+"','0,"+ds.GetDataString("select S_ID,S_Description from Sys_Spider ","|@S_ID@,@S_Description@")+"')@@") +"','')@@");	
		Formitem.AddItem("@@Csharp.SetShowText('来源页面','<a target=\"_blank\" href=\""+Formitem["V_REFERER"]+"\">"+Formitem["V_Name"]+"</a>','')@@");	
		
	}
	else
	{
		if(Formitem["V_REFERER"]!="")
		{
			Formitem.AddItem("@@Csharp.SetShowText('来源页面','##Table[\"Sys_VisitedReport\"].V_REFERER##','')@@");	
		}	
	}	
	
	if(Formitem["V_Enter"]=="1")
	{
		Formitem.AddItem("@@Csharp.SetShowText('访问类型','入口页面','')@@");	
	}
	
	if(Formitem["V_Stop"]!="0")
	{
		Formitem.AddItem("@@Csharp.SetShowText('防护','"+GetStopType(Formitem["V_Stop"])+"','')@@");	
	}
	
	if(Formitem["V_Conversion"]=="1")
	{
		Formitem.AddItem("@@Csharp.SetShowText('转换','发生转换','')@@");	
	}
	
	Formitem.AddItem("@@Csharp.SetShowText('用户身份识别','##Table[\"Sys_VisitedReport\"].V_SessionID##','')@@");	
	
	if (s_noextend.IndexOf(",41,") >-1)
	{
		//被禁用 只能简单记录
		Formitem.AddItem("@@Csharp.SetTextArea('备注','V_Memo','##Table[\"Sys_VisitedReport\"].V_Memo##','10','true','')@@");
	}	
	else
	{
		string s_name=Formitem["V_Memo"];//是否是老客户？
		string s_id=ds.GetDataString("select top 1 C_ID from sys_Client where C_Session='" + Formitem["V_SessionID"] + "'", "@C_ID@");
		
		WebCode.Table tabclient=new WebCode.Table("sys_Client",WebCode.function.GetNumber(s_id).ToString());
		
		Formitem.AddOther("@@Csharp.SetInputHidden('Client','1')@@");
		Formitem.AddOther("@@Csharp.SetInputHidden('C_Session','" + Formitem["V_SessionID"] + "')@@");
		
		Formitem.AddOther("@@Csharp.SetInputHidden('C_ID','"+tabclient["C_ID"]+"')@@");
		
		
		Formitem.AddItem("@@Csharp.SetInputText('客户姓名','C_Name','"+tabclient["C_Name"]+"','25','true','<br /><input type=\"button\" class=\"button\" value=\"选择客户\" onclick=\"ShowClientList()\" />')@@");
		
		
		Formitem.AddItem("<td class=\"tright\">联系信息：</td><td class=\"tleft\"><textarea rows=\"10\" name=\"C_Memo\" id=\"C_Memo\" class=\"inputbox bred\">"+tabclient["C_Memo"]+"</textarea><br />内容包括客户的联系方式、所在公司等信息。<span class=\"red\" id=\"spn_C_Memo\"></span><script type=\"text/javascript\" >    ExistVerify(\"C_Memo\",\"联系信息不能为空。\")</script></td>");
		
		//客户记录
		s_id=WebCode.function.GetNumber(ds.GetDataString("select C_ID from Sys_ClientContact where C_VID=" + Formitem["V_ID"] + "", "@C_ID@")).ToString();
		
		WebCode.Table tabcc=new WebCode.Table("Sys_ClientContact",s_id);
		
		Formitem.AddOther("@@Csharp.SetInputHidden('C_CID','"+s_id+"')@@");
		
		Formitem.AddItem("@@Csharp.SetInputText('联系时间','C_Time','"+(s_id=="0"?Now():tabcc["C_Time"])+"','25','true','')@@");
		
		Formitem.AddItem("<td class=\"tright\">咨询内容：</td><td class=\"tleft\"><textarea rows=\"10\" name=\"C_CMemo\" id=\"C_CMemo\" class=\"inputbox bred\">"+tabcc["C_Memo"]+"</textarea><br />详细记录客户咨询内容，便于分析客户需求。<span class=\"red\" id=\"spn_C_CMemo\"></span><script type=\"text/javascript\" >    ExistVerify(\"C_CMemo\",\"咨询内容不能为空。\")</script></td>");
		
	}
	
%>

<uc1:formitem ID='Formitem' runat='server' />
<br />
<%	if(Formitem["V_Enter"]=="1")
	{
	
	%>
	<div style="width:99%;height:500px;">
		<iframe name="list" src="/admin/search/sekeyslist.aspx?type=10&rang=10&ord=V_Date desc&SID=<%=Formitem["V_SID"]%>&id=<%=Formitem["V_ID"]%>" frameborder="0" width="100%" height="100%"></iframe>
	</div>
	<%
	}
	%>
	
<script type="text/javascript" src="/common/popwindow.js" charset="utf-8"></script>
<script language="javascript">
function ShowClientList()
{
	popup_open("/admin/search/selectclient.aspx","选择客户",590,465);
}

function SetClient(s_id,s_name,s_memo)
{
	$('C_ID').value=s_id;
	$('C_Name').value=s_name;
	$('C_Memo').value=s_memo;
}
</script>
</body>
</html>   
