📄 d_clientcountmainfrm.asp
字号:
<!--#include file="../include/Pubconn.asp"-->
<!--#include file="../include/PubConnCode.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title><link href="../cread.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<script language = "JavaScript">
var count1; //*********************88选择业务员
var count2;
count2=0;
Stuffarray = new Array();
<%count1=0
set rs=server.CreateObject("adodb.recordset")
rs.open "SELECT * FROM A_StuffInfo where SaleFlag='1' and delflag='0'",pubconn,1,3
if rs.recordcount> 0 then
do while not rs.eof %>
Stuffarray [<%=count1%>] = new Array("<%= trim(rs("DepartCode"))%>","<%= trim(rs("StuffNum"))%>","<%= trim(rs("Name"))%>");
<%count1 = count1 + 1
rs.movenext
loop
end if
rs.close
set rs=nothing%>
count2=<%=count1%>;
function changelocation()
{
document.form1.m_Careeror.length = 0;
var locationid=locationid;
var i;
document.form1.m_Careeror.options[0] = new Option('请选择','');
for (i=0;i < count2; i++)
{
if (Stuffarray [i][0] == document.form1.m_BelongDepart.value)
{
document.form1.m_Careeror.options[document.form1.m_Careeror.length] = new Option(Stuffarray [i][2], Stuffarray [i][1]);
}
}
}
</script>
<%function getYGName(aa) ''取员工姓名
set rs1=server.CreateObject("adodb.recordset")
if rs1.State=1 then rs1.Close
rs1.Open "select * from A_stuffinfo where StuffNum='"& aa &"' and delflag='0'",pubconn,1,3
if rs1.RecordCount<=0 then
getYGName=""
else
getYGName=rs1.Fields("Name")
end if
end function%>
<table border="0" width="100%">
<tr>
<td width="100%" valign="middle"><img border="0" src="it_22.gif" width="34" height="15"> <b><font size="2">客户类型/数量分析</font></b><hr width="40%" align="left" color="#C0C0C0" size="1"></td>
</tr>
</table>
<form name="form1" method="post" action="D_ClientCountMainFrm.asp">
<%m_DepartCode=trim(request("m_BelongDepart"))
m_StuffNum=trim(request("m_Careeror"))%>
<center>所属部门 <select name="m_BelongDepart" style="width: 120" onclick="changelocation()">
<option value="">请选择:
<%set rs=server.CreateObject("adodb.recordset")
if rs.state=1 then rs.close
rs.open "select * from A_DepartInfo where delflag='0'",pubconn,1,3
if rs.recordcount>0 then%>
<%rs.movefirst
while not rs.eof%>
<%if rs.fields("DepartCode")=m_DepartCode then%>
<option value=<%=rs.fields("DepartCode")%> selected><%=rs.fields("Name")%>
<%else%>
<option value=<%=rs.fields("DepartCode")%>><%=rs.fields("Name")%>
<%end if%>
<%rs.movenext
wend%>
<% end if%>
</select> 业 务 员 <select name="m_Careeror" style="width: 120; height: 23" >
<option value="">请选择: <%if m_StuffNum<>"" then%>
<option value=<%=m_StuffNum%> selected><%=getYGName(m_StuffNum)%>
<%end if%>
</select>
<input type="submit" value="确定" class=hand style="background-color: #D1D1D1; border-style: solid; border-width: 1"> </center> <br>
<%set rs=server.CreateObject("adodb.recordset")
if rs.state=1 then rs.close
if m_DepartCode<>"" then
if m_StuffNum<>"" then
rs.open "select * from D_clientinfo where tag='kh' and DepartCode='"& m_DepartCode &"' and StuffNum='"& m_StuffNum &"' and delflag='0'",pubconn,1,3
else
rs.open "select * from D_clientinfo where tag='kh' and DepartCode='"& m_DepartCode &"' and delflag='0'",pubconn,1,3
end if
else
if m_StuffNum<>"" then
rs.open "select * from D_clientinfo where tag='kh' and StuffNum='"& m_StuffNum &"' and delflag='0'",pubconn,1,3
else
rs.open "select * from D_clientinfo where tag='kh' and delflag='0'",pubconn,1,3
end if
end if%>
<%if rs.recordcount<=0 then%>
<br><br><center><%response.write "没记录!"%></center><br><br>
<center><a href="D_FenXiMainFrm.asp"><font size="2">返回</font></a></center>
<%response.end()
end if%>
<%Latent=0 '潜在客户
Prev=0 '预期客户
FirstBuy=0 '首次购买客户
ChongFu=0 '重复购买客户
ZhongCheng=0 '忠诚客户
Fefuse=0 '拒绝客户
Total=0
rs.movefirst
for i=0 to rs.recordcount-1
if trim(rs.fields("Type"))="潜在客户" then
Latent=Latent+1
end if
if trim(rs.fields("Type"))="预期客户" then
Prev=Prev+1
end if
if trim(rs.fields("Type"))="首次购买客户" then
FirstBuy=FirstBuy+1
end if
if trim(rs.fields("Type"))="重复购买客户" then
ChongFu=ChongFu+1
end if
if trim(rs.fields("Type"))="忠诚客户" then
ZhongCheng=ZhongCheng+1
end if
if trim(rs.fields("Type"))="拒绝客户" then
Fefuse=Fefuse+1
end if
rs.movenext
next
Total=Latent+Prev+FirstBuy+ZhongCheng+ChongFu+Fefuse
%>
<center><table border=1 cellspacing=0 width="80%">
<tr>
<td align="center" bgcolor="#DDD2C4" height="30">客户类型</td>
<td align="center" bgcolor="#DDD2C4" height="30">数量</td>
<td align="center" bgcolor="#DDD2C4" height="30">百分比(%)</td>
</tr>
<tr bgcolor="#EDEBEC">
<td align="center">潜在客户</td>
<td align="center"><%=Latent%></td>
<%if Total<>0 then%>
<td align="center"><%=round((Latent/Total)*100,2)%></td>
<%else%>
<td align="center"> </td>
<%end if%>
</tr>
<tr bgcolor="#f7f7f7">
<td align="center">预期客户</td>
<td align="center"><%=Prev%></td>
<%if Total<>0 then%>
<td align="center"><%=round((Prev/Total)*100,2)%></td>
<%else%>
<td align="center"> </td>
<%end if%>
</tr>
<tr bgcolor="#EDEBEC">
<td align="center">首次购买客户</td>
<td align="center"><%=FirstBuy%></td>
<%if Total<>0 then%>
<td align="center"><%=round((FirstBuy/Total)*100,2)%></td>
<%else%>
<td align="center"> </td>
<%end if%>
<tr bgcolor="#f7f7f7">
<td align="center">重复购买客户</td>
<td align="center"><%=ChongFu%></td>
<%if Total<>0 then%>
<td align="center"><%=round((ChongFu/Total)*100,2)%></td>
<%else%>
<td align="center"> </td>
<%end if%>
</tr>
<tr bgcolor="#EDEBEC">
<td align="center">忠诚客户</td>
<td align="center"><%=ZhongCheng%></td>
<%if Total<>0 then%>
<td align="center"><%=round((ZhongCheng/Total)*100,2)%></td>
<%else%>
<td align="center"> </td>
<%end if%>
</tr>
<tr bgcolor="#f7f7f7">
<td align="center">拒绝客户</td>
<td align="center"><%=Fefuse %></td>
<%if Total<>0 then%>
<td align="center"><%=round((Fefuse /Total)*100,2)%></td>
<%else%>
<td align="center"> </td>
<%end if%>
</tr>
<tr bgcolor="#EDEBEC">
<td align="center">合计</td>
<td align="center"><%=Total%></td>
<td align="center">100</td>
</tr>
</table></center><br>
<center>
<a href="D_FenXiMainFrmGraphic.asp?Latent=<%=Latent%>&Prev=<%=Prev%>&FirstBuy=<%=FirstBuy%>&ChongFu=<%=ChongFu%>&ZhongCheng=<%=ZhongCheng%>&Fefuse=<%=Fefuse%>"><font
size="2">图形</font></a><font size="2">
            <a href="D_FenXiMainFrm.asp">返回</a></font></center>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -