?? d_clientareamainfrm.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">
<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>
<%set rs=server.CreateObject("adodb.recordset")
if rs.state=1 then rs.close
rs.open "select distinct Area from D_clientinfo where tag='kh' and Area<>''",pubconn,1,3%>
<%if rs.recordcount<=0 then
response.write "沒記錄!"%>
<center><a href="D_FenXiMainFrm.asp"><font size="2">返回</font></a></center>
<%response.end()
end if%>
<%set rs2=server.CreateObject("adodb.recordset")
if rs2.state=1 then rs2.close
rs2.open "select count(*) as Latent from D_clientinfo where tag='kh' and type='潛在客戶' and Area<>''",pubconn,1,3%>
<%TotalLatent=rs2.fields("Latent") '潛在客戶總數%>
<%set rs3=server.CreateObject("adodb.recordset")
if rs3.state=1 then rs3.close
rs3.open "select count(*) as Prev from D_clientinfo where tag='kh' and type='預期客戶' and Area<>''",pubconn,1,3%>
<%TotalPrev=rs3.fields("Prev") '預期客戶總數%>
<%set rs4=server.CreateObject("adodb.recordset")
if rs4.state=1 then rs4.close
rs4.open "select count(*) as FirstBuy from D_clientinfo where tag='kh' and type='首次購買客戶' and Area<>''",pubconn,1,3%>
<%TotalFirstBuy=rs4.fields("FirstBuy") '首次購買客戶總數%>
<%set rs5=server.CreateObject("adodb.recordset")
if rs5.state=1 then rs5.close
rs5.open "select count(*) as ZhongCheng from D_clientinfo where tag='kh' and type='忠誠客戶' and Area<>''",pubconn,1,3%>
<%TotalZhongCheng=rs5.fields("ZhongCheng") '忠誠客戶總數%>
<%set rs10=server.CreateObject("adodb.recordset")
if rs10.state=1 then rs10.close
rs10.open "select count(*) as chongfu from D_clientinfo where tag='kh' and type='重復購買客戶' and Area<>''",pubconn,1,3%>
<%Totalchongfu=rs10.fields("chongfu") '重復購買客戶總數%>
<%set rs11=server.CreateObject("adodb.recordset")
if rs11.state=1 then rs11.close
rs11.open "select count(*) as refuse from D_clientinfo where tag='kh' and type='拒絕客戶' and Area<>''",pubconn,1,3%>
<%Totalrefuse=rs11.fields("refuse") '拒絕客戶總數%>
<%'''''''''''''''''Total=TotalLatent+TotalPrev+TotalFirstBuy+TotalZhongCheng%>
<%rs.movefirst%>
<center><table border=1 cellspacing=0 width="636">
<tr>
<td width="36" bgcolor="#DDD2C4">
<p align="center">
區域</p>
</td>
<td width="42" bgcolor="#DDD2C4">
<p align="center">
潛在客戶數</p>
</td>
<td width="35" bgcolor="#DDD2C4">
<p align="center">
百分比(%)</p>
</td>
<td width="43" bgcolor="#DDD2C4">
<p align="center">
預期客戶數</p>
</td>
<td width="35" bgcolor="#DDD2C4">
<p align="center">
百分比(%)</p>
</td>
<td width="43" bgcolor="#DDD2C4">
<p align="center">
首次購買客戶數</p>
</td>
<td width="35" bgcolor="#DDD2C4">
<p align="center">
百分比(%)</p>
</td>
<td width="44" bgcolor="#DDD2C4">
<p align="center">
重復購買客戶數</p>
</td>
<td width="38" bgcolor="#DDD2C4">
<p align="center">
百分比(%)</p>
</td>
<td width="42" bgcolor="#DDD2C4">
<p align="center">
忠誠客戶數</p>
</td>
<td width="37" bgcolor="#DDD2C4">
<p align="center">
百分比(%)</p>
</td>
<td width="42" bgcolor="#DDD2C4">
<p align="center">
拒絕客戶數</p>
</td>
<td width="37" bgcolor="#DDD2C4">
<p align="center">
百分比(%)</p>
</td>
</tr>
<%line=0%>
<%while not rs.eof %>
<%if line mod 2 =0 then%>
<%backcolor="#f7f7f7"%>
<%else%>
<%backcolor="#EDEBEC"%>
<%end if%>
<%set rs6=server.CreateObject("adodb.recordset")
if rs6.state=1 then rs6.close
rs6.open " select count(*) as Latent from D_clientinfo where tag='kh' and type='潛在客戶' and Area='"& trim(rs.fields("Area")) &"'",pubconn,1,3 ''''潛在客戶數%>
<%set rs7=server.CreateObject("adodb.recordset")
if rs7.state=1 then rs7.close
rs7.open "select count(*) as Latent from D_clientinfo where tag='kh' and type='預期客戶' and Area='"& trim(rs.fields("Area")) &"'",pubconn,1,3 ''''預期客戶數%>
<%set rs8=server.CreateObject("adodb.recordset")
if rs8.state=1 then rs8.close
rs8.open "select count(*) as Latent from D_clientinfo where tag='kh' and type='首次購買客戶' and Area='"& trim(rs.fields("Area")) &"'",pubconn,1,3 ''''首次購買客戶數%>
<%set rs9=server.CreateObject("adodb.recordset")
if rs9.state=1 then rs9.close
rs9.open "select count(*) as Latent from D_clientinfo where tag='kh' and type='忠誠客戶' and Area='"& trim(rs.fields("Area")) &"'",pubconn,1,3 ''''忠誠客戶數%>
<%set rs18=server.CreateObject("adodb.recordset")
if rs18.state=1 then rs18.close
rs18.open "select count(*) as chongfu from D_clientinfo where tag='kh' and type='重復購買客戶' and Area='"& trim(rs.fields("Area")) &"'",pubconn,1,3 ''''首次購買客戶數%>
<%set rs19=server.CreateObject("adodb.recordset")
if rs19.state=1 then rs19.close
rs19.open "select count(*) as refuse from D_clientinfo where tag='kh' and type='拒絕客戶' and Area='"& trim(rs.fields("Area")) &"'",pubconn,1,3 ''''忠誠客戶數%>
<tr bgcolor=<%=backcolor%>>
<td width="36">
<p align="center">
<%=rs.fields("Area")%></td> <%'行業%>
<%'response.write rs.fields("occupation")%>
<td width="42">
<p align="center">
<%=rs6.fields("Latent")%></td> <%'潛在客戶數%>
<%if rs2.fields("Latent")<>0 then%>
<td width="35">
<p align="center">
<%=round(rs6.fields("Latent")/rs2.fields("Latent"),2)*100%></td> <%'占百分比%>
<%else%>
<td width="43">
<p align="center">
</p>
</td>
<%end if%>
<td width="35">
<p align="center">
<%=rs7.fields("Latent")%></td> <%'預期客戶數%>
<%if rs3.fields("Prev")<>0 then%>
<td width="43">
<p align="center">
<%=round(rs7.fields("Latent")/rs3.fields("Prev"),2)*100%></td> <%'占百分比%>
<%else%>
<td width="35">
<p align="center">
</p>
</td>
<%end if%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -