?? 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 + -