<%@ page language="C#" autoeventwireup="true" inherits="admin_search_selectclient, 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  runat="server">
<title>客户列表页面</title>
<link href="/admin/common/client.css" rel="stylesheet" type="text/css" />

</head>
<body style="background-color:#ffffff;" class="mg3">
<%
	PageContent.Table="sys_Client";
	PageContent.Url = "clientlist.aspx?ord=" + Para("ord") + "&pn=@pagenumber@";
	PageContent.SQL=" select C_ID,C_Name,C_Memo as _html_cmemo,C_Time,C_Type from sys_Client ";
	
	PageContent.PageBody("@@Const.PageTable()@@","@@Const.PageBar(\"  ##Const.SearchButton('客户姓名','C_Name')##	\")@@","<tr>@content@</tr>","<tr id='tr_@C_ID@'>@content@</tr>");
	
	PageContent.Action="";//本页处理
	
	PageContent.AddList("<td>选择</td>","<td><input type='radio' name='radid' onclick=\"SelectClient('@C_ID@','@C_Name@')\"  /></td>");
	PageContent.AddList("<td>编号</td>","<td>@ItemNumber@</td>");
	
	PageContent.AddList("@@Const.PageOrderField('selectclient.aspx?ord=','C_Name','" + Para("ord") + "','客户姓名')@@","<td>@C_Name@</td>");
  PageContent.AddList("@@Const.PageOrderField('selectclient.aspx?ord=','C_Type','" + Para("ord") + "','客户类型')@@", "<td>@@Csharp.GetSelectValue('@C_Type@','0,潜在客户|1,<span class=\"green\">购买客户</span>|2,<span class=\"red\">热门客户</span>')@@</td>");
  //PageContent.AddList("@@Const.PageOrderField('selectclient.aspx?ord=','C_Time','" + Para("ord") + "','最后访问时间')@@","<td>@C_Time@</td>");
  PageContent.AddList("<td >联系信息</td>","<td style='text-align:left;padding:0px 10px;' id='td@c_id@'>@_html_cmemo@</td>");
%>
<uc1:pageContent ID="PageContent" runat="server" />

<div style="float:right;">
<input type="button" value="选择" class="button" onclick="SetData()" /> &nbsp; 
<input type="button" value="退出" class="button" onclick="parent.popup_close();" /> 
</div>

<script type="text/javascript" >
var s_id="",s_name="",s_memo="";

function SelectClient(s_id,s_name)
{
	this.s_id=s_id;
	this.s_name=s_name;
	var reg=new RegExp("<BR>","ig");
	this.s_memo=$("td"+s_id).innerHTML.replace(reg,"\r\n");
}

function SetData()
{
	if(s_id=="")
	{
		alert("请选择客户!");
	}
	else
	{
		parent.SetClient(s_id,s_name,s_memo);
		parent.popup_close();
	}
}
</script>
</body>
</html>   
