?? contactreport.asp
字號:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "report","read"
set objcheck=nothing
if Request.Form("selusername")<>"" then
strwhere =strwhere&" and owner='"&Request.Form("selusername")&"'"
else
strwhere =strwhere &"and (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"
end if
strwhere=strwhere&" and contact like '%"&Request.Form("Contain")&"%'"
if Request.Form("contacttype")<>"" then
strwhere=strwhere&" and contacttype='"&Request.Form("contacttype")&"'"
end if
if Request.Form("disable")<>"" then
strwhere=strwhere&" and disable='"&Request.Form("disable")&"'"
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_contact where 1=1 "&strwhere&" order by owner,contact"
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="12%" height="18" align=center><font color="#FFFFFF">聯系人</font></td>
<td width="10%" 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="10%" height="18" align=center><font color="#FFFFFF">狀態</font></td>
</tr>
<%
set ownername=rs("ownername")
set contact=rs("contact")
set contacttype=rs("contacttype")
set title=rs("title")
set workphone=rs("workphone")
set account=rs("account")
set createdate=rs("createdate")
set disable=rs("disable")
set account=rs("account")
i=1
do while not rs.EOF
if ownername <> previous then
response.write "<tr bgcolor=#FFFFFF height=20><td align=center>"&ownername&"</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><%=contact%></td>
<td align=center><%=contacttype%></td>
<td align=center><%=title%></td>
<td align=center><%=workphone%></td>
<td align=center><%=account%></td>
<td align=center><%=createdate%></td>
<td align=center><%if disable=true then response.write "<img src=../images/enabled.jpg>" else response.write "<img src=../images/disabled.jpg>" end if%></td>
</tr>
<%
i=i+1
previous=ownername
rs.MoveNext
if rs.eof then
contactrecord=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>"&contactrecord&"</td><td align=center></td><td align=center colspan=6></td></tr>"
elseif ownername<> previous then
contactrecord=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>"&contactrecord&"</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> </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")%> <%=getfieldvalue("company","id","1","address")%></div></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -