📄 copy of qttj_cgl.asp
字号:
<%
' 将数据中的单引号改成两个单引号
Function SqlStr( data )
SqlStr = Replace( data, "'", "''" )
End Function
'完美的显示空格子程序-----------------------------------------------------------
sub break1(now_page,total_page)
for a_page=1 to total_page-now_page
if a_page mod 2=1 then
color="#F8F4E0"
else
color="#F4F4E8"
end if
response.write "<tr bgcolor="&color&">"
response.write "<td class='small'> </td>"
response.write "<td class='small'> </td>"
response.write "<td class='small'> </td>"
response.write "<td class='small'> </td>"
response.write "<td class='small'> </td>"
response.write "</tr>"
next
end sub
'显示数据的子程序---------------------------------------------------------------
sub showdata
for ipage=1 to rs.pagesize
'计算该业务员的总洽谈数
'初始化设置洽谈次数
dim count
dim count1
dim counter
count=0
count1=0
'查询 talk 表单记录
'SET rs3=CONN.EXECUTE("select * from talk where worker='"&rs("name")&"' and check='1'")
response.write ("select * from talk where worker='"&rs("name")&"' and check='1'")
Do while not rs3.eof
count=count+1
rs3.MoveNext
loop
'查询 jiaoyi 表单记录
SET rs2=CONN.EXECUTE("select * from jiaoyi where worker='"&rs("name")&"' where check='1'")
while not rs2.eof
count1=count1+1
rs2.MoveNext
wend
if count=0 then
couter=0
else
couter=count1/count
end if
'决定颜色
if ipage mod 2=1 then
color="#F8F4E0"
else
color="#F4F4E8"
end if
'输出数据
response.write "<tr bgcolor="&color&">"
idno=rs("id")
response.write "<td class='small'><a href='javascript:openFrameless("&idno&")' title='点击["&left(rs("name"),18)&"]查看详情'>"&left(rs("name"),18)&"</A></td>"
response.write "<td class='small'>"&count&"</td>"
response.write "<td class='small'>"&count1&"</td>"
response.write "<td class='small'>"&formatpercent(couter,1,-1)&"</td>"
response.write "<td class='small'><img src='images/red.jpg' height='12' width="&couter*100&"></td>"
response.write "</tr>"
rs.MoveNext
'如果没有数据
if rs.eof then
'输出空表格
call break1(ipage,rs.pagesize)
exit for
end if
next
end sub
'显示分页符号的子程序---------------------------------------------------------------
'如果是第一页
sub fenye
if page=1 then
Response.Write " [最前页]"
Response.Write "[上一页]"
else
Response.Write "[<a href=qttj_cgl.asp?page=1 class='01'>最前页</a>]"
Response.Write "[<a href=qttj_cgl.asp?Page="&Page-1&" class='01'>上一页</a>]"
End If
'如果是最后一页
If Page <> rs.PageCount Then
Response.Write "[<A HREF=qttj_cgl.asp?Page="&Page+1&" class='01'>下一页</a>]"
Response.Write "[<A HREF=qttj_cgl.asp?Page="&rs.PageCount&" class='01'>最末页</a>]"
else
Response.Write "[下一页]"
Response.Write "[最末页]"
End If
end sub
'--程序开始----------------------------------------------------------------------------------------
'打开数据库
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};pwd=webcool_2000;dbq=" & Server.MapPath("../database/customer.mdb")
'建立rs对象
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM worker"
'发送一条SQL的指令
rs.Open sql, conn, 3
if rs.eof then
response.redirect("ywyzl_no.asp")
else
'设置一页显示n条记录
rs.PageSize =15
'计算总记录数
page1=rs.PageCount
rs.AbsolutePage = Page1
for apage=1 to rs.pagesize
recno=(page1-1)*rs.pagesize+apage
rs.movenext
if rs.eof then exit for
next
'设置当前显示页码
Page = cint(Request("Page"))
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = Page
'如果数据是最后一页,那数字为最后一个
page_end=page*rs.pagesize
if page=rs.PageCount then page_end=recno end if
%>
<SCRIPT LANGUAGE="JavaScript">
function openFrameless(aaa)
{
var bbb="jytj_sltj_ywy.asp?id="+aaa
NFW =window.open(bbb,"","fullscreen");//打开一个窗口为满屏显示
NFW.resizeTo(420,500);//改变窗口大小
NFW.moveTo(screen.width/2-210,screen.height/2-250);//移动窗口
}
</SCRIPT>
<html>
<head>
<title>『晨景软体』-客户资源管理系统</title>
<link rel="stylesheet" href="other/customer.css">
<style>
.drag{position:relative;cursor:hand}
</style>
<script language="JavaScript">
var dragapproved=false
var eventsource,x,y
function move()
{
if (event.button==1&&dragapproved) //改变被拖动元素在页面上的位置
{
self.moveBy (event.clientX-x,event.clientY-y); //改变窗体位置
return false
}
}
function drags()
{
if (!document.all)
return
if (event.srcElement.className=="drag") //捕捉鼠标当前位置
{
dragapproved=true//确信当前鼠标是按下
x=event.clientX//鼠标当前位置
y=event.clientY//鼠标当前位置
document.onmousemove=move//调动move函数
}
}
document.onmousedown=drags //鼠标左键按下时,准备拖动
document.onmouseup=new Function("dragapproved=false")//鼠标左键放开时,拖动停止
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" width="619" height="437">
<tr>
<td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="609" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td colspan="3" background="images/cx_r1_c1.gif" class="title" valign="middle"> 『晨景软体』-客户统计-成功率统计
<div id="Layer1" style="position:absolute; width:22px; height:21px; z-index:3; left: 598px; top: 6px"><a href="javascript:window.close()"><img src="images/xx.gif" width="13" height="13" border="0"></a></div>
</td>
<td><img src="images/spacer.gif" width="1" height="26" border="0"></td>
</tr>
<tr>
<td rowspan="2"><img name="cx_r2_c1" src="images/cx_r2_c1.gif" width="5" height="423" border="0"></td>
<td bgcolor="#cdd5e4">
<table width="100%" cellspacing="1" height="415">
<tr>
<td height="12" colspan="2"> </td>
</tr>
<tr>
<td height="319" colspan="2">
<table width="100%" cellspacing="1" bgcolor="#666666">
<tr bgcolor="#657cb1" class="big_b">
<td width="19%" height="6">
<div align="center">业务员姓名</div>
</td>
<td width="15%" height="6" align="center">
<div align="center">洽谈次数</div>
</td>
<td width="16%" height="6" align="center">交易次数</td>
<td width="11%" height="6" align="center">成功率</td>
<td height="6" width="39%">
<div align="center">统 计 图</div>
</td>
</tr>
<%
'显示数据的子程序
call showdata
%>
</table>
</td>
</tr>
<tr>
<td class="small" width="23%" >
<div align="left">[<%=(page-1)*rs.pagesize+1%> - <%=page_end%>] 共<%=recno%>记录</div>
</td>
<td class="small" width="77%" >
<div align="right" >
<%
'调用分页子程序
call fenye
%>
</div>
</td>
</tr>
</table>
<!-- 重要表 ------------------------------------------------------------------>
</td>
<td rowspan="2"><img name="cx_r2_c3" src="images/cx_r2_c3.gif" width="5" height="423" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="418" border="0"></td>
</tr>
<tr>
<td><img name="cx_r3_c2" src="images/cx_r3_c2.gif" width="609" height="5" border="0"></td>
<td><img src="images/spacer.gif" width="1" height="5" border="0"></td>
</tr>
</table>
<div class="drag" id="Layer2" style="position:absolute; left:2px; top:1px; width:596px; height:22px; z-index:2"></div>
</body>
</html>
<%end if%>
<%'=关闭数据库============================
conn.close'关闭数据库
set conn=nothing
%>
<html><script language="JavaScript"> </script></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -