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

📄 eventreport.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "report","read"
set objcheck=nothing%>
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "report","read"
set objcheck=nothing

if Request.Form("selusername")<>"" then
	strwhere =strwhere&" and UserName='"&Request.Form("selusername")&"'"
else
	strwhere =strwhere &"and (UserName='"&session("loginid")&"' or UserName in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"
end if

if Request.Form("relativetype")="其他" then
	if  Request.Form("EventType2")<>"" then
		strwhere=strwhere&" and Type="&Request.Form("EventType2")
	else
		strwhere=strwhere&" and relativetype = '其他'"		
	end if
elseif Request.Form("relativetype")="客户" then
	if  Request.Form("EventType1")<>"" then
		strwhere=strwhere&" and Type = '"&Request.Form("EventType1")&"'"
	else
		strwhere=strwhere&" and relativetype = '客户'"		
	end if
end if

if Request.Form("startdate")<>"" then
	strwhere=strwhere&" and createdate>='"&Request.Form("startdate")&"'"
end if

if  Request.Form("enddate")<>"" then
	strwhere=strwhere&" and createdate<='"&Request.Form("enddate")&"'"
end if

dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring

sql="select * from v_Event where 1=1 "&strwhere&" order by UserName,Subject"
'response.write "select * from v_Event where 1=1 "&strwhere&" order by UserName,Subject"
rs.Open sql,conn,1,1
%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>销售事件报表</title>
</head>
<script language="JavaScript">
function window_onload()
{
window.moveTo(-2,-2);
window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
<body leftmargin="10" rightmargin="10" topmargin="10" onload="window_onload()">
  <table align="center" width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
    <tr align="left"> 
      <td colspan=3> 
        <div align="left"><strong><em><font size="4" face="黑体">销售事件报表</font></em></strong></div></td>
    </tr>
	<tr><td  colspan="3" height=4></td></tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    <tr bgcolor="006699"> 
      <td width="8%" height=18 align=center><font color="#FFFFFF">待做者</font></td>
      <td width="20%" height=18 align=center><font color="#FFFFFF">主题</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">事件类型</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">事件时间</font></td>
      <td height="18" align=center><font color="#FFFFFF">相关</font></td>
      <td width="10%" height="18" align=center><font color="#FFFFFF">创建日期</font></td>
      <td width="15%" height="18" align=center><font color="#FFFFFF">事件目的</font></td>
      <td width="15%" height="18" align=center><font color="#FFFFFF">事件结果</font></td>
    </tr>
    <%
  set EventUser=rs("EventUser")
  set Subject=rs("Subject")
  set EventType=rs("EventType")
  set EventDate=rs("EventDate")
  set createdate=rs("createdate")
  set relativetype=rs("relativetype")
  set account=rs("account")
  set description=rs("description")
  set result=rs("result")
  i=1
  do while not rs.EOF

	if EventUser <> previous then
		response.write "<tr bgcolor=#FFFFFF height=20><td align=center>"&EventUser&"</td><td colspan=7></td></tr>"
		response.write "<tr bgcolor=#000000><td colspan=8></td></tr>"
	end if
%>
    <tr bgcolor="#FFFFFF"> 
      <td align=center></td>
      <td height=18 align=center><%=Subject%></td>
      <td align=center><%=EventType%></td>
      <td align=center><%=EventDate%></td>
      <td align=center><%if relativetype="其他" then response.write relativetype else response.write account end if%></td>
      <td align=center><%=createdate%></td>
      <td align=center><%=description%></td>
      <td align=center><%=result%></td>
    </tr>

    <%
  i=i+1
  previous=EventUser
  rs.MoveNext
if rs.eof then
	Eventrecord=i-1
	response.write "<tr ><td height=2 colspan=8 bgcolor=#000000></td></tr>"
	response.write "<tr  bgcolor=ffffff valign=top><td align=center  height=30>汇总</td><td align=center>"&Eventrecord&"</td><td align=center></td><td align=center colspan=6></td></tr>"
elseif EventUser<> previous then
	Eventrecord=i-1
	i=1
	response.write "<tr ><td height=2 colspan=8 bgcolor=#000000></td></tr>"
	response.write "<tr bgcolor=ffffff valign=top><td align=center height=30>汇总</td><td align=center>"&Eventrecord&"</td><td align=center></td><td align=center colspan=6></td></tr>"
else
	response.write "<tr ><td></td><td colspan=7 bgcolor=#000000></td></tr>"
end if

  loop
  
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
  %>
  </table>
  
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
  <tr> 
    <td width="10%"> <div align="right"><em>创建时间(从):</em></div></td>
    <td width="10%"> <%=request.form("startdate")%> <div align="left"></div></td>
    <td width="4%"><div align="center"><em>(至)</em></div></td>
    <td width="10%"><%=request.form("enddate")%> <div align="right"></div></td>
    <td>&nbsp;</td>
   </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr> 
    <td height=2 bgcolor="#4A699C"></td>
  </tr>
  <tr>
    <td><div align="left"><%=getfieldvalue("company","id","1","company")%>&nbsp;&nbsp;<%=getfieldvalue("company","id","1","address")%></div></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -