<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Session.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<%if Not (Getconfig("SK_Client")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK200000000") AND (JudgePopedomTF(Session("UserName"),"SK200000100"))))) then Call ReturnError()%>
<%
if Not isnumeric(JCID(F("ID"))) then Call ReturnError10()
set rs=server.createobject("adodb.recordset")
if Session("Manager")=1 or Session("Manager")=2 then
sql="SELECT * from SK_Client where ClientID="&JCID(F("ID"))&""
elseif Session("Manager")=3 then
sql="SELECT * from SK_Client INNER JOIN SK_SystemUsers ON SK_Client.SK_SalesID=SK_SystemUsers.UsersID where SK_SystemUsers.SK_Dept1="&Session("Dept1")&" AND SK_Client.ClientID="&JCID(F("ID"))&""
elseif Session("Manager")=4 then
sql="SELECT * from SK_Client INNER JOIN SK_SystemUsers ON SK_Client.SK_SalesID=SK_SystemUsers.UsersID where SK_SystemUsers.SK_Dept1="&Session("Dept1")&" AND SK_SystemUsers.SK_Dept2="&Session("Dept2")&" AND SK_Client.ClientID="&JCID(F("ID"))&""
elseif Session("Manager")=5 then
sql="SELECT * from SK_Client INNER JOIN SK_SystemUsers ON SK_Client.SK_SalesID=SK_SystemUsers.UsersID where SK_SystemUsers.SK_Dept1="&Session("Dept1")&" AND SK_SystemUsers.SK_Dept2="&Session("Dept2")&" AND SK_SystemUsers.SK_Dept3="&Session("Dept3")&" AND SK_Client.ClientID="&JCID(F("ID"))&""
elseif Session("Manager")=6 then
sql="SELECT * from SK_Client where (SK_SalesID="&Session("UID")&" OR "&Session("UID")&" in (select SK_SalesID from SK_ShareClient where SK_ClientID="&JCID(F("ID"))&")) AND ClientID="&JCID(F("ID"))&""
end if
rs.Open sql,conn,1,3
if rs.eof AND rs.bof then Call ReturnError4()
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="查看客户："&Rs("SK_Wname")&" 的信息"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
conn.execute(sql)
rs("SK_Click")=rs("SK_Click") + 1
rs.Update
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title><%=Rs("SK_Wname")%></title>
<META http-equiv=Page-Enter content=SKCRM>
<META http-equiv=Page-Exit content=SKCRM>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR>
<LINK href="../images/style.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
<SCRIPT type=text/javascript>
function selectTag(showContent,selfObj){
var tag = document.getElementById("tags").getElementsByTagName("li");
var taglength = tag.length;
for(i=0; i<taglength; i++){
tag[i].className = "";
}
selfObj.parentNode.className = "selectTag";
for(i=0; j=document.getElementById("tagContent"+i); i++){
j.style.display = "none";
}
document.getElementById(showContent).style.display = "block";
}
</SCRIPT>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<TBODY>
<tr>
<td class="SK_Td_Top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="25"><img src="../images/tab_03.gif" width="12" height="25" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle">查看客户信息</td>
<td width="54%"></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="16" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="../images/tab_12.gif"></td>
<td>
<DIV id="con">
<UL id="tags">
<LI class="selectTag"><A onClick="selectTag('tagContent0',this)" href="javascript:void(0)">客户资料</A></LI>
<%if Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK200000200") then%>
<LI><A onClick="selectTag('tagContent1',this)" href="javascript:void(0)">相关联系人</A></LI>
<%end if%>
<%if Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK200000300") then%>
<LI><A onClick="selectTag('tagContent2',this)" href="javascript:void(0)">相关跟进</A></LI>
<%end if%>
<%if Getconfig("SK_Sales")="0" AND (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK300000300")) then%>
<LI><A onClick="selectTag('tagContent3',this)" href="javascript:void(0)">相关报价</A></LI>
<%end if%>
<%if Getconfig("SK_Sales")="0" AND (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK300000400")) then%>
<LI><A onClick="selectTag('tagContent4',this)" href="javascript:void(0)">相关订单</A></LI>
<%end if%>
<%if Getconfig("SK_Service")="0" AND (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK600000000")) then%>
<LI><A onClick="selectTag('tagContent5',this)" href="javascript:void(0)">相关客服</A></LI>
<%end if%>
</UL>
<DIV id="tagContent">
<DIV class="tagContent selectTag" id="tagContent0">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
  <td colspan="4" class="SK_Title1">基本资料</td>
</tr>

<tr>
<td width="16%" class="SK_Text2">客户类型</td>
<td colspan="3" class="SK_Text1"><%if Rs("SK_Di")=0 then Response.write"单位客户" else Response.write"个人客户" end if%></td>
</tr>

<tr>
  <td class="SK_Text2">所在区域</td>
  <td colspan="3" class="SK_Text1"><%
Set RsArea1=server.createobject("adodb.recordset")
SqlArea1="SELECT * from SK_SystemArea where Areaid="&Rs("SK_AreaID")&""
RsArea1.Open SqlArea1,Conn,1,1

Set RsArea2=server.createobject("adodb.recordset")
SqlArea2="SELECT * from SK_SystemArea where Areaid="&RsArea1("ParentID")&""
RsArea2.Open SqlArea2,Conn,1,1

Set RsArea3=server.createobject("adodb.recordset")
SqlArea3="SELECT * from SK_SystemArea where Areaid="&RsArea2("ParentID")&""
RsArea3.Open SqlArea3,Conn,1,1

Set RsArea4=server.createobject("adodb.recordset")
SqlArea4="SELECT * from SK_SystemArea where Areaid="&RsArea3("ParentID")&""
RsArea4.Open SqlArea4,Conn,1,1

Set RsArea5=server.createobject("adodb.recordset")
SqlArea5="SELECT * from SK_SystemArea where Areaid="&RsArea4("ParentID")&""
RsArea5.Open SqlArea5,Conn,1,1
if RsArea5.eof AND RsArea5.bof then 
else
Response.write""&RsArea5("AreaName")&" > "
end if
if RsArea4.eof AND RsArea4.bof then
else
Response.write""&RsArea4("AreaName")&" > "
end if
if RsArea3.eof AND RsArea3.bof then
else
Response.write""&RsArea3("AreaName")&" > "
end if
if RsArea2.eof AND RsArea2.bof then
else
Response.write""&RsArea2("AreaName")&" > "
end if
Response.write""&RsArea1("AreaName")&""

RsArea1.close
set RsArea1=Nothing

RsArea2.close
set RsArea2=Nothing

RsArea3.close
set RsArea3=Nothing

RsArea4.close
set RsArea4=Nothing

RsArea5.close
set RsArea5=Nothing
%>
</td>
</tr>

<tr>
<td width="16%" class="SK_Text2">客户编号</td>
<td colspan="3" class="SK_Text1"><%=Rs("SK_No")%></td>
</tr>

<tr>
  <td class="SK_Text2">客户名称</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Wname")%></td>
</tr>
<tr>
  <td class="SK_Text2">其他名称</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Jname")%></td>
</tr>
<%
'自定义选项开始
set RsOptions=server.createobject("adodb.recordset")
sqlOptions="SELECT * from SK_ClientOptions where SK_Di=0 and SK_ShowOnForm=0 Order by SK_OrderID asc"
RsOptions.Open sqlOptions,conn,1,1
if RsOptions.bof and RsOptions.eof then
else
%>
<tr>
  <td colspan="4" class="SK_Title1">自定义选项</td>
</tr>
<tr>
<td colspan="4" class="SK_Text1">
<%
Response.write"<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""1"">"
for Optionsi=1 to RsOptions.recordCount '变量i从1循环到数据库中的全部记录数 
if (Optionsi mod 2 =1) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "<tr>" 
end if
Response.write"<td class=""SK_Text2"" width=""16%"">"&RsOptions("SK_Title")&"</td><td class=""SK_Text1"">"

Set rsOptionsDetail=Server.CreateObject("ADODB.RecordSet") 
sqlOptionsDetail="SELECT * from SK_ClientOptionsDetail where SK_OptionsID="&RsOptions("FieldID")&" and OptionsDetailID="&rs(""&RsOptions("SK_FieldName")&"")&"" 
rsOptionsDetail.Open sqlOptionsDetail,conn,1,1
Response.write""&rsOptionsDetail("SK_OName")&""
rsOptionsDetail.close
set rsOptionsDetail=Nothing

Response.write"</td>"
if (Optionsi mod 2 = 0) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "</tr>" 
end if 
RsOptions.movenext 
next 
Response.write"</table>"
%>
</td>
</tr>
<%
end if
RsOptions.close
set RsOptions=Nothing
'自定义选项结束
'自定义字段开始
set RsFields=server.createobject("adodb.recordset")
sqlFields="SELECT * from SK_ClientFields where SK_Di=0 and SK_ShowOnForm=0 Order by SK_OrderID asc"
RsFields.Open sqlFields,conn,1,1
if RsFields.bof and RsFields.eof then
else
%>
<tr>
  <td colspan="4" class="SK_Title1">自定义字段</td>
</tr>
<tr>
  <td colspan="4" class="SK_Text1">
<%
Response.write"<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""1"">"
for Fieldsi=1 to RsFields.recordCount '变量i从1循环到数据库中的全部记录数 
if (Fieldsi mod 2 =1) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "<tr>" 
end if
Response.write"<td class=""SK_Text2"" width=""16%"">"&RsFields("SK_Title")&"</td><td class=""SK_Text1"">"&Rs(""&RsFields("SK_FieldName")&"")&"</td>"
if (Fieldsi mod 2 = 0) then '每个tr即每行显示1个记录,可根据需要自行修改, 将左边的1修改为2即显示两行。
response.write "</tr>" 
end if 
RsFields.movenext 
next 
Response.write"</table>"
%>
</td>
</tr>
<%
end if
RsFields.close
set RsFields=Nothing
'自定义字段结束
%>
<tr>
  <td colspan="4" class="SK_Title1">备注与策略</td>
</tr>

<tr>
  <td class="SK_Text2">客户备注</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Content")%></td>
</tr>

<tr>
  <td class="SK_Text2">合作现状</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Status")%></td>
</tr>
<tr>
  <td class="SK_Text2">合作前景</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Prospect")%></td>
</tr>
<tr>
  <td class="SK_Text2">跟进策略</td>
  <td colspan="3" class="SK_Text1"><%=Rs("SK_Plot")%></td>
</tr>
<tr>
  <td colspan="4" class="SK_Title1">管理资料</td>
</tr>
<tr>
  <td class="SK_Text2">业务人员</td>
  <td colspan="3" class="SK_Text1"><%
set RsClientSales=server.createobject("adodb.recordset")
SqlClientSales="select * from SK_SystemUsers where UsersID="&Rs("SK_SalesID")&""
RsClientSales.open SqlClientSales,conn,1,1
Response.write"<font color=#999999>"&RsClientSales("SK_OName")&"</font>"
RsClientSales.close
Set RsClientSales=Nothing
%></td>
</tr>
<tr>
  <td class="SK_Text2">创建人员</td>
  <td width="22%" class="SK_Text1"><%=Rs("SK_Addor")%></td>
  <td width="15%" class="SK_Text2">创建时间</td>
  <td width="47%" class="SK_Text1"><%=Rs("SK_ATime")%></td>
</tr>
<%if Rs("SK_Editor")<>"0" then%>
<tr>
  <td class="SK_Text2">修改人员</td>
  <td class="SK_Text1"><%
set RsClientEditor=server.createobject("adodb.recordset")
SqlClientEditor="select * from SK_SystemUsers where UsersID="&Rs("SK_Editor")&""
RsClientEditor.open SqlClientEditor,conn,1,1
Response.write"<font color=#999999>"&RsClientEditor("SK_OName")&"</font>"
RsClientEditor.close
Set RsClientEditor=Nothing
%></td>
  <td class="SK_Text2">修改时间</td>
  <td class="SK_Text1"><%=Rs("SK_ETime")%></td>
</tr>
<%end if%>
<tr><td colspan="4" class="SK_Title1">统计信息</td></tr>
<tr>
<td colspan="4" class="SK_Text">

<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td colspan="2" class="SK_Title">客户跟进</td>
<td colspan="2" class="SK_Title">产品订单</td>
<td colspan="2" class="SK_Title">项目合同</td>
</tr>
<tr>
<td width="13%" class="SK_Text">计划跟进</td>
<td width="11%" class="SK_Text">已经跟进</td>
<td width="22%" class="SK_Text">总金额(已审)</td>
<td width="23%" class="SK_Text">积分</td>
<td width="15%" class="SK_Text">总金额</td>
<td width="16%" class="SK_Text">积分</td>
</tr>
<tr>
  <td class="SK_Text"><%=conn.execute("select count(*) from SK_Follow where SK_SalesID="&Session("UID")&" and SK_Del=0 and SK_Di=0 and SK_ClientID="&Rs("ClientID")&"")(0)%> 次</td>
  <td class="SK_Text"><%=conn.execute("select count(*) from SK_Follow where SK_SalesID="&Session("UID")&" and SK_Del=0 and SK_Di=1 and SK_ClientID="&Rs("ClientID")&"")(0)%> 次</td>
<td class="SK_Text">
<%
set RsAG1=server.createobject("adodb.recordset")
if Session("Manager")=1 or Session("Manager")=2 then
SqlAG1="select sum(SK_Total*SK_Price) as AG1 from SK_SalesOrdersDetail INNER JOIN SK_SalesOrders ON SK_SalesOrders.OrdersID=SK_SalesOrdersDetail.SK_ProOrdersID INNER JOIN SK_Client ON SK_SalesOrders.SK_ClientID=SK_Client.ClientID INNER JOIN SK_SystemUsers ON SK_SalesOrders.SK_SalesID=SK_SystemUsers.UsersID where SK_SalesOrders.SK_ClientID="&Rs("ClientID")&" AND SK_SalesOrders.SK_ShFeet=1"
elseif Session("Manager")=3 then
SqlAG1="select sum(SK_Total*SK_Price) as AG1 from SK_SalesOrdersDetail INNER JOIN SK_SalesOrders ON SK_SalesOrders.OrdersID=SK_SalesOrdersDetail.SK_ProOrdersID INNER JOIN SK_Client ON SK_SalesOrders.SK_ClientID=SK_Client.ClientID INNER JOIN SK_SystemUsers ON SK_SalesOrders.SK_SalesID=SK_SystemUsers.UsersID where SK_SalesOrders.SK_Del=0 AND SK_SalesOrders.SK_ClientID="&Rs("ClientID")&" AND SK_SalesOrders.SK_ShFeet=1 AND SK_SystemUsers.SK_Dept1="&Session("Dept1")&""
elseif Session("Manager")=4 then
SqlAG1="select sum(SK_Total*SK_Price) as AG1 from SK_SalesOrdersDetail INNER JOIN SK_SalesOrders ON SK_SalesOrders.OrdersID=SK_SalesOrdersDetail.SK_ProOrdersID INNER JOIN SK_Client ON SK_SalesOrders.SK_ClientID=SK_Client.ClientID INNER JOIN SK_SystemUsers ON SK_SalesOrders.SK_SalesID=SK_SystemUsers.UsersID where SK_SalesOrders.SK_Del=0 AND SK_SalesOrders.SK_ClientID="&Rs("ClientID")&" AND SK_SalesOrders.SK_ShFeet=1 AND SK_SystemUsers.SK_Dept1="&Session("Dept1")&" AND SK_SystemUsers.SK_Dept2="&Session("Dept2")&""
elseif Session("Manager")=5 then
SqlAG1="select sum(SK_Total*SK_Price) as AG1 from SK_SalesOrdersDetail INNER JOIN SK_SalesOrders ON SK_SalesOrders.OrdersID=SK_SalesOrdersDetail.SK_ProOrdersID INNER JOIN SK_Client ON SK_SalesOrders.SK_ClientID=SK_Client.ClientID INNER JOIN SK_SystemUsers ON SK_SalesOrders.SK_SalesID=SK_SystemUsers.UsersID where SK_SalesOrders.SK_Del=0 AND SK_SalesOrders.SK_ClientID="&Rs("ClientID")&" AND SK_SalesOrders.SK_ShFeet=1 AND SK_SystemUsers.SK_Dept1="&Session("Dept1")&" AND SK_SystemUsers.SK_Dept2="&Session("Dept2")&" AND SK_SystemUsers.SK_Dept3="&Session("Dept3")&""
elseif Session("Manager")=6 then
SqlAG1="select sum(SK_Total*SK_Price) as AG1 from SK_SalesOrdersDetail INNER JOIN SK_SalesOrders ON SK_SalesOrders.OrdersID=SK_SalesOrdersDetail.SK_ProOrdersID INNER JOIN SK_Client ON SK_SalesOrders.SK_ClientID=SK_Client.ClientID INNER JOIN SK_SystemUsers ON SK_SalesOrders.SK_SalesID=SK_SystemUsers.UsersID where SK_SalesOrders.SK_Del=0 AND SK_SalesOrders.SK_ClientID="&Rs("ClientID")&" AND SK_SalesOrders.SK_ShFeet=1 AND SK_SalesOrders.SK_SalesID="&Session("UID")&""
end if
RsAG1.open SqlAG1,Conn,1,1
Dim iAG1
if RsAG1("AG1")<>"" then
iAG1=RsAG1("AG1")
response.write"<font color=blue>"&formatnumber(RsAG1("AG1"),2)&"</font>"
else
iAG1="0"
response.write"<font color=blue>0</font>"
end if
RsAG1.close
set RsAG1=Nothing
%></td>
<td class="SK_Text"><%=(iAG2*Getconfig("SK_JF")/100)%></td>
  <td class="SK_Text">
<%
set RsBG1=server.createobject("adodb.recordset")
if Session("Manager")=1 or Session("Manager")=2 then
SqlBG1="select sum(SK_Amount) as BG1 from SK_ItemContract where SK_ClientID="&Rs("ClientID")&" AND SK_Del=0 AND SK_Feet=1"
elseif Session("Manager")=3 then
SqlBG1="select sum(SK_Amount) as BG1 from SK_ItemContract INNER JOIN SK_SystemUsers ON SK_ItemContract.SK_SalesID=SK_SystemUsers.UsersID where SK_ItemContract.SK_ClientID="&Rs("ClientID")&" AND SK_ItemContract.SK_Del=0 AND SK_ItemContract.SK_Feet=1 AND SK_SystemUsers.SK_Dept1="&Session("Dept1")&""
elseif Session("Manager")=4 then
SqlBG1="select sum(SK_Amount) as BG1 from SK_ItemContract INNER JOIN SK_SystemUsers ON SK_ItemContract.SK_SalesID=SK_SystemUsers.UsersID where SK_ItemContract.SK_ClientID="&Rs("ClientID")&" AND SK_ItemContract.SK_Del=0 AND SK_ItemContract.SK_Feet=1 AND SK_SystemUsers.SK_Dept1="&Session("Dept1")&" AND SK_SystemUsers.SK_Dept2="&Session("Dept2")&""
elseif Session("Manager")=5 then
SqlBG1="select sum(SK_Amount) as BG1 from SK_Payment INNER JOIN SK_SystemUsers ON SK_ItemContract.SK_SalesID=SK_SystemUsers.UsersID where SK_ItemContract.SK_ClientID="&Rs("ClientID")&" AND SK_ItemContract.SK_Del=0 AND SK_ItemContract.SK_Feet=1 AND SK_SystemUsers.SK_Dept1="&Session("Dept1")&" AND SK_SystemUsers.SK_Dept2="&Session("Dept2")&" AND SK_SystemUsers.SK_Dept3="&Session("Dept3")&""
elseif Session("Manager")=6 then
SqlBG1="select sum(SK_Amount) as BG1 from SK_ItemContract where SK_ClientID="&Rs("ClientID")&" AND SK_Del=0 AND SK_Feet=1 AND SK_SalesID="&Session("UID")&""
end if
RsBG1.open SqlBG1,Conn,1,1
Dim iBG1
if RsBG1("BG1")<>"" then
iBG1=RsBG1("BG1")
response.write"<font color=blue>"&formatnumber(RsBG1("BG1"),2)&"</font>"
else
iBG1="0"
response.write"<font color=red>0</font>"
end if
RsBG1.close
set RsBG1=Nothing
%></td>
  <td class="SK_Text"><%=(iBG2*Getconfig("SK_JF")/100)%></td>
</tr>
</table></td>
</tr>
</table>
</DIV>
<%if Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK200000200") then%>
<DIV class="tagContent" id="tagContent1">
<%
'相关联系人开始
Dim RsLinkman,A
set RsLinkman=Server.createobject("adodb.recordset")
SqlLinkman="select * from SK_LinkMan where SK_Del=0 AND SK_ClientID="&Rs("ClientID")&" order by LinkmanID asc"
RsLinkman.open SqlLinkman,conn,1,1
if RsLinkman.bof and RsLinkman.eof then 
Call ReturnError8()
else
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td width="20%" class="SK_Title">姓名</td>
<td width="7%" class="SK_Title">性别</td>
<td width="15%" class="SK_Title">电话</td>
<td width="20%" class="SK_Title">手机</td>
<td width="35%" class="SK_Title">邮箱</td>
</tr>
<%
A=0
while not RsLinkman.eof
A=A+1
%>
<tr>
<td class="SK_Text">
<a href="javascript:void(0)" onClick="javascript:var win=window.open('SK.ReLinkman.asp?id=<%=RsLinkman("LinkmanID")%>','ReLinkman','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()"><%=RsLinkman("SK_LName")%></a></td>
<td class="SK_Text"><%if RsLinkman("Sex")="1" then Response.write"男" else Response.write"女" end if%></td>
<td class="SK_Text"><%=RsLinkman("SK_Tel")%></td>
<td class="SK_Text"><%=RsLinkman("SK_Mobile")%></td>
<td class="SK_Text1"><%=RsLinkman("SK_Email")%></td>
</tr>
<%
RsLinkman.movenext
wend
%>
</table>
<%
end if
RsLinkman.close
Set RsLinkman=Nothing
'相关联系人结束
%>
</DIV>
<%end if%>

<%if Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK200000300") then%>
<DIV class="tagContent" id="tagContent2">
<%
'相关跟进开始
Dim RsFollow,B
set RsFollow=Server.createobject("adodb.recordset")
SqlFollow="select * from SK_Follow where SK_Del=0 AND SK_ClientID="&Rs("ClientID")&" order by FollowID asc"
RsFollow.open SqlFollow,conn,1,1
if RsFollow.bof and RsFollow.eof then 
Call ReturnError8()
else
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td width="67%" class="SK_Title">跟进主题</td>
<td width="13%" class="SK_Title">跟进日期</td>
<td width="10%" class="SK_Title">跟进状态</td>
<td width="10%" class="SK_Title">业务人员</td>
</tr>
<%
B=0
while not RsFollow.eof
B=B+1
%>
<tr>
<td class="SK_Text1">
<a href="javascript:void(0)" onClick="javascript:var win=window.open('SK.ReFollow.asp?id=<%=RsFollow("FollowID")%>','ReFollow','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()"><%=RsFollow("SK_Ftitle")%></a></td>
<td class="SK_Text"><%=RsFollow("SK_Ftime")%></td>
<td class="SK_Text"><%if RsFollow("SK_Di")="1" then Response.write"<font color=blue>已经跟进</font>" else Response.write"<font color=red>计划跟进</font>" end if%></td>
<td class="SK_Text"><%
set RsFollowUser=server.createobject("adodb.recordset")
SqlFollowUser="select * from SK_SystemUsers where UsersID="&RsFollow("SK_SalesID")&""
RsFollowUser.open SqlFollowUser,conn,1,1
Response.write""&RsFollowUser("SK_OName")&""
RsFollowUser.close
Set RsFollowUser=Nothing
%></td>
</tr>
<%
RsFollow.movenext
wend
%>
</table>
<%
end if
RsFollow.close
Set RsFollow=Nothing
'相关跟进结束
%>
</DIV>
<%end if%>

<%if Getconfig("SK_Sales")="0" AND (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK300000300")) then%>
<DIV class="tagContent" id="tagContent3">
<%
'相关报价开始
Dim RsProPrice,C
set RsProPrice=Server.createobject("adodb.recordset")
SqlProPrice="select * from SK_SalesProPrice where SK_Del=0 AND SK_ClientID="&Rs("ClientID")&" order by ProPriceID asc"
RsProPrice.open SqlProPrice,conn,1,1
if RsProPrice.bof and RsProPrice.eof then 
Call ReturnError8()
else
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td width="20%" class="SK_Title">报价编号</td>
<td width="36%" class="SK_Title">报价主题</td>
<td width="14%" class="SK_Title">金额</td>
<td width="10%" class="SK_Title">报价日期</td>
<td width="10%" class="SK_Title">报价状态</td>
<td width="10%" class="SK_Title">业务人员</td>
</tr>
<%
C=0
while not RsProPrice.eof
C=C+1
%>
<tr>
<td class="SK_Text1">
<a href="javascript:void(0)" onClick="javascript:var win=window.open('../Sales/SK.ReProPrice.asp?id=<%=RsProPrice("ProPriceID")%>','ReProPrice','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()"><%=RsProPrice("SK_PriceNo")%></a></td>
<td class="SK_Text1"><%=RsProPrice("SK_PriceTitle")%></td>
<td class="SK_Text"><%
set RsPriceCurrency=server.createobject("adodb.recordset")
SqlPriceCurrency="select * from SK_SystemCategory where SK_Di=25 and CategoryID="&RsProPrice("SK_Currency")&""
RsPriceCurrency.open SqlPriceCurrency,conn,1,1
Response.write"<font color=""#999999"">"&RsPriceCurrency("SK_Name")&"</font> "
RsPriceCurrency.close
Set RsPriceCurrency=Nothing
set RsPriceAG=server.createobject("adodb.recordset")
SqlPriceAG="select sum(SK_Total*SK_Price) as AG from SK_SalesProPriceDetail where SK_ProPriceID="&RsProPrice("ProPriceID")&""
RsPriceAG.open SqlPriceAG,Conn,1,1
Response.write"<font color=blue>"&formatnumber(RsPriceAG("AG"),2)&"</font>"
RsPriceAG.close
set RsPriceAG=Nothing
%></td>
<td class="SK_Text"><%=RsProPrice("SK_PriceTime")%></td>
<td class="SK_Text"><%if RsProPrice("SK_Feet")="0" then Response.write"<font color=red>计划报价</font>" else Response.write"<font color=blue>已经报价</font>" end if%></td>
<td class="SK_Text"><%
set RsPriceSales=server.createobject("adodb.recordset")
SqlPriceSales="select * from SK_SystemUsers where UsersID="&RsProPrice("SK_SalesID")&""
RsPriceSales.open SqlPriceSales,conn,1,1
Response.write""&RsPriceSales("SK_OName")&""
RsPriceSales.close
Set RsPriceSales=Nothing
%></td>
</tr>
<%
RsProPrice.movenext
wend
%>
</table>
<%
end if
RsProPrice.close
Set RsProPrice=Nothing
'相关报价结束
%>
</DIV>
<%end if%>
<%if Getconfig("SK_Sales")="0" AND (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK300000400")) then%>
<DIV class="tagContent" id="tagContent4">
<%
'相关订单开始
Dim RsProOrders,D
set RsProOrders=Server.createobject("adodb.recordset")
SqlProOrders="select * from SK_SalesOrders where SK_Del=0 AND SK_ClientID="&Rs("ClientID")&" order by OrdersID asc"
RsProOrders.open SqlProOrders,conn,1,1
if RsProOrders.bof and RsProOrders.eof then 
Call ReturnError8()
else
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td width="20%" class="SK_Title">订单编号</td>
<td width="31%" class="SK_Title">订单主题</td>
<td width="15%" class="SK_Title">金额</td>
<td width="10%" class="SK_Title">签约日期</td>
<td width="7%" class="SK_Title">状态</td>
<td width="7%" class="SK_Title">审核</td>
<td width="10%" class="SK_Title">业务人员</td>
</tr>
<%
D=0
while not RsProOrders.eof
D=D+1
%>
<tr>
<td class="SK_Text1">
<a href="javascript:void(0)" onClick="javascript:var win=window.open('../Sales/SK.ReProOrder.asp?id=<%=RsProOrders("OrdersID")%>','ReProPrice','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()"><%=RsProOrders("SK_OrdersNo")%></a></td>
<td class="SK_Text1"><%=RsProOrders("SK_OrdersTitle")%></td>
<td class="SK_Text"><%
set RsOrdersCurrency=server.createobject("adodb.recordset")
SqlOrdersCurrency="select * from SK_SystemCategory where SK_Di=142 and CategoryID="&RsProOrders("SK_Currency")&""
RsOrdersCurrency.open SqlOrdersCurrency,conn,1,1
Response.write"<font color=""#999999"">"&RsOrdersCurrency("SK_Name")&"</font> "
RsOrdersCurrency.close
Set RsOrdersCurrency=Nothing
set RsOrdersAG=server.createobject("adodb.recordset")
SqlOrdersAG="select sum(SK_Total*SK_Price) as AG from SK_SalesOrdersDetail where SK_ProOrdersID="&RsProOrders("OrdersID")&""
RsOrdersAG.open SqlOrdersAG,Conn,1,1
Response.write"<font color=blue>"&formatnumber(RsOrdersAG("AG"),2)&"</font>"
RsOrdersAG.close
set RsOrdersAG=Nothing
%></td>
<td class="SK_Text"><%=RsProOrders("SK_OrdersTime")%></td>
<td class="SK_Text"><%
set rsFeet=server.createobject("adodb.recordset")
sqlFeet="select * from SK_SystemCategory where SK_Di=45 and CategoryID="&RsProOrders("SK_Feet")&""
rsFeet.open sqlFeet,conn,1,1
Response.write"<font color=blue>"&RsFeet("SK_Name")&"</font>"
RsFeet.close
RsFeet=Nothing
%></td>
<td class="SK_Text"><%
set RsOrderShUID=server.createobject("adodb.recordset")
SqlOrderShUID="select * from SK_SystemUsers where UsersID="&RsProOrders("SK_ShUID")&""
RsOrderShUID.open SqlOrderShUID,conn,1,1
if RsProOrders("SK_ShFeet")=0 then 
Response.write"<font color=""#009999"">未审核</font>"
elseif RsProOrders("SK_ShFeet")=1 then
Response.write"<span style=""CURSOR: hand"" title=""审核时间:"&RsProOrders("SK_ShTime")&"&#13;审核人员:"&RsOrderShUID("SK_OName")&"&#13;审核备注:"&RsProOrders("SK_ShContent")&"""><font color=""#0066FF"">已通过</font></span>"
elseif RsProOrders("SK_ShFeet")=2 then
Response.write"<span style=""CURSOR: hand"" title=""审核时间:"&RsProOrders("SK_ShTime")&"&#13;审核人员:"&RsOrderShUID("SK_OName")&"&#13;审核备注:"&RsProOrders("SK_ShContent")&"""><font color=""red"">未通过</font></span>"
end if
RsOrderShUID.close
Set RsOrderShUID=Nothing
%>
</td>
<td class="SK_Text"><%
set RsOrdersSales=server.createobject("adodb.recordset")
SqlOrdersSales="select * from SK_SystemUsers where UsersID="&RsProOrders("SK_SalesID")&""
RsOrdersSales.open SqlOrdersSales,conn,1,1
Response.write""&RsOrdersSales("SK_OName")&""
RsOrdersSales.close
Set RsOrdersSales=Nothing
%></td>
</tr>
<%
RsProOrders.movenext
wend
%>
</table>
<%
end if
RsProOrders.close
Set RsProOrders=Nothing
'相关订单结束
%>
</DIV>
<%end if%>
<%if Getconfig("SK_Service")="0" AND (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK600000000")) then%>
<DIV class="tagContent" id="tagContent5">
<%
'相关服务开始
set RsServices=Server.createobject("adodb.recordset")
SqlServices="select * from SK_Services where SK_Del=0 AND SK_ClientID="&Rs("ClientID")&" order by ServicesID asc"
RsServices.open SqlServices,conn,1,1
if RsServices.bof and RsServices.eof then 
Call ReturnError8()
else
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
<td width="16%" class="SK_Title">客服编号</td>
<td width="20%" class="SK_Title">客服主题</td>
<td width="10%" class="SK_Title">客服类别</td>
<td width="11%" class="SK_Title">客服状态</td>
<td width="12%" class="SK_Title">紧急程度</td>
<td width="11%" class="SK_Title">客户方式</td>
<td width="10%" class="SK_Title">客服日期</td>
<td width="10%" class="SK_Title">客服人员</td>
</tr>
<%
L=0
while not RsServices.eof
L=L+1
%>
<tr>
<td class="SK_Text1">
<a href="javascript:void(0)" onClick="javascript:var win=window.open('../Services/SK.ReServices.asp?id=<%=RsServices("ServicesID")%>','ReServices','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()"><%=RsServices("SK_SNo")%></a></td>
<td class="SK_Text"><%=RsServices("SK_STitle")%></td>
<td class="SK_Text"><%
set RsServicesClass=server.createobject("adodb.recordset")
SqlServicesClass="select * from SK_SystemCategory where SK_Di=101 and CategoryID="&RsServices("SK_Di")&""
RsServicesClass.open SqlServicesClass,conn,1,1
Response.write""&RsServicesClass("SK_Name")&""
RsServicesClass.close
Set RsServicesClass=Nothing
%></td>
<td class="SK_Text"><%
set RsServicesFeet=server.createobject("adodb.recordset")
SqlServicesFeet="select * from SK_SystemCategory where SK_Di=103 and CategoryID="&RsServices("SK_Feet")&""
RsServicesFeet.open SqlServicesFeet,conn,1,1
Response.write""&RsServicesFeet("SK_Name")&""
RsServicesFeet.close
Set RsServicesFeet=Nothing
%></td>
<td class="SK_Text"><%
set RsLevel=server.createobject("adodb.recordset")
SqlLevel="select * from SK_SystemCategory where SK_Di=104 and CategoryID="&RsServices("SK_Level")&""
RsLevel.open SqlLevel,conn,1,1
Response.write"<font color=""#999999"">"&RsLevel("SK_Name")&"</font> "
RsLevel.close
Set RsLevel=Nothing
%></td>
<td class="SK_Text"><%
set RsServicesMode=server.createobject("adodb.recordset")
SqlServicesMode="select * from SK_SystemCategory where SK_Di=102 and CategoryID="&RsServices("SK_Mode")&""
RsServicesMode.open SqlServicesMode,conn,1,1
Response.write"<font color=""#999999"">"&RsServicesMode("SK_Name")&"</font> "
RsServicesMode.close
Set RsServicesMode=Nothing
%></td>
<td class="SK_Text"><%=RsServices("SK_ATime")%></td>
<td class="SK_Text"><%
set RsServicesUser=server.createobject("adodb.recordset")
SqlServicesUser="select * from SK_SystemUsers where UsersID="&RsServices("SK_SalesID")&""
RsServicesUser.open SqlServicesUser,conn,1,1
Response.write""&RsServicesUser("SK_OName")&""
RsServicesUser.close
Set RsServicesUser=Nothing
%></td>
</tr>
<%
RsServices.movenext
wend
%>
</table>
<%
end if
RsServices.close
Set RsServices=Nothing
'相关服务结束
%>
</DIV>
<%end if%>
</DIV>
</DIV>
</td>
<td width="8" background="../images/tab_15.gif"></td>
</tr>
<tr>
  <td background="../images/tab_12.gif"></td>
  <td class="SK_Text"><input type="button" value=" 关闭 " onClick="window.close();" class="button1" /></td>
  <td background="../images/tab_15.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="SK_Td_Foot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="20"><img src="../images/tab_18.gif" width="12" height="20" /></td>
<td width="98%" class="SK_Td_Page"></td>
<td width="1%"><img src="../images/tab_20.gif" width="16" height="20" /></td>
</tr>
</table>

</td>
</tr>
</TBODY>
</table>
</body>
<%
Call CloseDB()
%>
</html>