📄 xzkhtj.asp
字号:
sql="select count(*) as num,stuffnum,name,departcode from viewcs where (type='预期客户' or type='潜在客户')"
if xsbm<>"" then
sql=sql&" and departcode='"&xsbm&"'"
end if
if ddate<>"" and edate="" then
sql=sql&" and rq>='"&ddate&"' and rq<='"&date()&"'"
end if
if ddate="" and edate<>"" then
sql=sql&" and rq<='"&edate&"'"
end if
if ddate<>"" and edate<>"" then
sql=sql&" and rq>='"&ddate&"' and rq<='"&edate&"'"
end if
sql=sql&" group by stuffnum,name,departcode order by count(*) desc"
else
sql="select count(*) as num,stuffnum,name,departcode from viewcs where type='预期客户' or type='潜在客户' group by stuffnum,name,departcode order by count(*) desc"
end if
'response.write sql
'response.end
rs.open sql,pubconn,1,3
if rs.recordcount>=1 then
rs.pagesize=10
if currentpage>=rs.pagecount then
currentpage=rs.pagecount
else
if currentpage<1 then
currentpage=1
end if
end if
rs.absolutepage=currentpage
pagenum=rs.pagecount
if pagenum<1 then
pagenum=1
end if
khsql="select count(*) as znum from viewcs where (type='预期客户' or type='潜在客户')"
if xsbm<>"" then
khsql=khsql&" and departcode='"&xsbm&"'"
end if
set khrs=pubconn.execute(khsql)
znum=khrs("znum")
khrs.close
%>
<table border="1" cellspacing="0" width="100%" height="38">
<tr>
<td width="7%" height="1" align="center" bgcolor="#DDD2C4"><font size="2">排 名</font></td>
<td width="14%" height="1" align="center" bgcolor="#DDD2C4"><font size="2">业务员</font></td>
<td width="10%" height="20" align="center" bgcolor="#DDD2C4"><font size="2">潜在客户数</font></td>
<td width="10%" height="20" align="center" bgcolor="#DDD2C4"><font size="2">预期客户数</font></td>
<td width="1%" height="1" align="center" bgcolor="#DDD2C4"><font size="2">合 计</font></td>
<td width="5%" height="1" align="center" bgcolor="#DDD2C4"><font size="2">百分比</font></td>
</tr>
<%hzb=""
zzb=""
num1=0
num2=0
pm=0
for i=1 to rs.pagesize %>
<%
if i mod 2=1 then%>
<tr bgcolor="#f7f7f7" >
<%else%>
<tr bgcolor="#EDEBEC" >
<%end if%>
<%
recno=(currentpage-1)*rs.pagesize+i %>
<td width="7%" height="1" align="center"><font size="2">第<%=recno%>名</font></td>
<%hzb=hzb&rs("name")&","%>
<td width="10%" height="1" align="center"><font size="2"><%=rs("name")%></font></td>
<%ywy=rs("stuffnum")
if xsbm="" then
qzsql="select count(*) as num from d_clientinfo where type='潜在客户' and stuffnum='"&ywy&"' and delflag='0'"
else
qzsql="select count(*) as num from d_clientinfo where type='潜在客户' and stuffnum='"&ywy&"' and departcode='"&xsbm&"' and delflag='0'"
end if
set qzrs=pubconn.execute(qzsql)
qznum=qzrs("num")
num1=num1+qznum
%>
<td width="10%" height="1" align="center"><font size="2"><%=qznum%></font></td>
<%qzrs.close
if xsbm="" then
yqsql="select count(*) as num from d_clientinfo where type='预期客户' and stuffnum='"&ywy&"' and delflag='0'"
else
yqsql="select count(*) as num from d_clientinfo where type='预期客户' and stuffnum='"&ywy&"' and departcode='"&xsbm&"' and delflag='0'"
end if
set yqrs=pubconn.execute(yqsql)
yqnum=yqrs("num")
num2=num2+yqnum
yqrs.close%>
<td width="10%" height="1" align="center"><font size="2"><%=yqnum%></font></td>
<%
zsl=qznum+yqnum
zzb=zzb&zsl&","%>
<td width="1%" height="1" align="center"><font size="2"><%=zsl%></font></td>
<%'newnum=rs("num")
'response.end
if znum="" then
bfb=0
else
bfb=formatpercent((zsl/znum),2,-1)
end if
%>
<td width="5%" height="1" align="center"><font size="2"><%=bfb%></font></td>
</tr>
<%
rs.MoveNext
if rs.EOF then
exit for
end if
next %>
<%
hjje=0
if currentPage=rs.pagecount then
%>
<tr>
<td width="22%" height="1" align="center" colspan="2">
<p align="center"><font size="2">合计</font></p>
</td>
<td width="8%" height="1" align="center"><font size="2">
<p align="center"><%=num1%></font></td>
<td width="8%" height="1" align="center"><font size="2">
<p align="center"><%=num2%></font></td>
<td width="8%" height="1" align="center"><font size="2">
<p align="center"><%=num1+num2%></font></td>
<td width="8%" height="1" align="center"><font size="2">
<p align="center"><%="100.00%"%></font></td>
</tr>
<%end if%>
</table> <br>
共<%=rs.pagecount%>页
<a href="xzkhtj.asp?currentPage=1&bz=<%=bz%>&xsbm=<%=xsbm%>&dyear=<%=dyear%>&dmonth=<%=dmonth%>&dday=<%=dday%>&eyear=<%=eyear%>&emonth=<%=emonth%>&eday=<%=eday%>">首 页</a>
<%
if currentPage<pagenum then%>
<a href="xzkhtj.asp?currentPage=<%=currentpage+1%>&bz=<%=bz%>&xsbm=<%=xsbm%>&dyear=<%=dyear%>&dmonth=<%=dmonth%>&dday=<%=dday%>&eyear=<%=eyear%>&emonth=<%=emonth%>&eday=<%=eday%>">下一页</a>
<% else%>
下一页 <%
end if
if currentPage>1 then
%> <a href="xzkhtj.asp?currentPage=<%=currentpage-1%>&bz=<%=bz%>&xsbm=<%=xsbm%>&dyear=<%=dyear%>&dmonth=<%=dmonth%>&dday=<%=dday%>&eyear=<%=eyear%>&emonth=<%=emonth%>&eday=<%=eday%>">上一页</a>
<% else%>
上一页 <%
end if
%>
<a href="xzkhtj.asp?currentPage=<%=rs.pagecount%>&bz=<%=bz%>&xsbm=<%=xsbm%>&dyear=<%=dyear%>&dmonth=<%=dmonth%>&dday=<%=dday%>&eyear=<%=eyear%>&emonth=<%=emonth%>&eday=<%=eday%>">尾 页</a>
<select name="page1" >
<%
for j=1 to rs.pagecount%>
<option value=<%=j%>><%=j%>
<%next%>
</select>
<%if bz="" then%>
<input type="button" value="Go" name="page" onclick="win1()" style="background-color: #D1D1D1; border-style: solid; border-width: 1">
<%else%>
<input type="button" value="Go" name="page" onclick="win()" style="background-color: #D1D1D1; border-style: solid; border-width: 1">
<%end if%>
<%
m_ddate=dyear&"-"&dmonth&"-"&dday
m_edate=eyear&"-"&emonth&"-"&eday
%>
<a href="khtx.asp?hzb=<%=hzb%>&zzb=<%=zzb%>&bz=1&unit=&tablename=新增客户数统计">图形</a>
<a href="#" onclick="window.print()" >打印</a>
<%else%>
<p align="center">
<font size="2">
经查询,没有记录显示!
<%end if%>
</font>
<br><br><a href="D_FenXiMainFrm.asp">返回</a>
</form>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -