⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qttj_pjtj.asp

📁 asp+Access开发的客户资源管理系统,用户名:admin,密码:
💻 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="#F4F4E8"
		else
			color="#F8F4E0"
		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

		'计算该业务员的总洽谈数
		count_user=0
		SET rs3=CONN.EXECUTE("select worker from talk")
		SET rs1=CONN.EXECUTE("SELECT first FROM quanxian where user='admin'")
		Do while not rs3.eof
			count=count+1
			rs3.MoveNext 
		loop 

			'检查系统至今运行天数
		tian=DateDiff("d",rs1("first"),date())+1

		'计算总平均值
		total=formatnumber(count/tian,2,-1)
'============================================================================		
		
		'发送一条查询每个业务员平均值的指令
		
			'检查有多少洽谈记录
			SET rs4=CONN.EXECUTE("select worker from talk where worker='"&rs("name")&"' and check='1' ")
		counter_user=0
		while not rs4.eof
				counter_user=counter_user+1
				rs4.movenext
		wend

			'检查此业务员工作时间
			tian_user=DateDiff("d",rs("dat"),date())+1

			'计算此业务员的平均值
			total_user=formatnumber(counter_user/tian_user,1,-1)

		'决定颜色
		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'>"&counter_user&"</td>"
			response.write "<td class='small'>"&tian_user&"</td>"
			response.write "<td class='small'>"&total_user&"</td>"
			'判断是否为零
			'if total=0 then
			'jpeg=0
			'else
			jpeg=total_user*10
			'end if
			response.write "<td class='small'><img src='images/red.jpg' height='12' width="& jpeg&"></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_pjtj.asp?page=1 class='01'>最前页</a>]"
		Response.Write "[<a href=qttj_pjtj.asp?Page="&Page-1&" class='01'>上一页</a>]"
	End If

	'如果是最后一页
	If Page <> rs.PageCount Then
		Response.Write "[<A HREF=qttj_pjtj.asp?Page="&Page+1&" class='01'>下一页</a>]"
		Response.Write "[<A HREF=qttj_pjtj.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="ywyzl_zlxg_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">&nbsp;&nbsp;&nbsp;『晨景软体』-客户统计-按业务员统计
      <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">&nbsp; </td>
        </tr>
        <tr> 
          <td height="319" colspan="2"> 
            <table width="100%" cellspacing="1" bgcolor="#666666">
              <tr bgcolor="#657cb1" class="big_b"> 
                <td width="15%" height="6"> 
                  <div align="center">业务员姓名</div>
                </td>
                <td width="15%" height="6" align="center"> 
                  <div align="center">洽谈次数</div>
                </td>
                <td width="14%" height="6" align="center">工作天数</td>
                <td width="18%" height="6" align="center">平均洽谈次数</td>
                <td height="6" width="38%"> 
                  <div align="center">统&nbsp;计&nbsp;图</div>
                </td>
              </tr>
              <%
				'显示数据的子程序
				call showdata
				%>
            </table>
          </td>
        </tr>
        <tr> 
          <td class="small" width="54%" > 
            <div align="left">[<%=(page-1)*rs.pagesize+1%> - <%=page_end%>] 共<%=recno%>记录&nbsp;&nbsp;&nbsp;</div>
          </td>
          <td class="small" width="46%" > 
            <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 + -