<!--#include file="geditop.asp"-->
<%function HTMLEncode(fString)
if not isnull(fString) then
    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")
    fString = Replace(fString, CHR(32), "&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#39;")
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
    fString = Replace(fString, CHR(10), "<BR> ")
    HTMLEncode = fString
end if
end function
dim lei,y,r,t1,t2,d
dim ThisPage,Pagesize,Allrecord,Allpage,tj
lei=trim(request("lei"))
if trim(request("y"))="" then
y=month(now())
else
y=trim(request("y"))
end if
r=trim(request("r"))
t1=trim(request("t1"))
t2=trim(request("t2"))
d=trim(request("d"))

if request("page")="" then
  ThisPage=1		
else
  ThisPage=request("page")
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>DM直投广告--<%=title%>--<%=web%></title>
</head>

<body>

<div align="center">
<table cellSpacing="0" cellPadding="0" width="930" border="0" id="table1">
		<tr>
			<td  height="25" class="tdtop"><b>&nbsp;&gt;&gt; 您的位置  
			<font color="#FFFFFF">-></font> <a class="scap1" href="index.htm"><%=title%></a>
			<font color="#FFFFFF">-></font> <a class="scap1" href="dmindex.asp">DM直投广告频道</a>：</b><font color="#FFFFFF"> -></font>
			<font color="#FF0000"></td>
		</tr>
		
		<tr>
			<td  height="25" bgcolor="#FFFFFF" valign="top">
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td>
		</td>
	</tr>
	</table>
  
 			<table border="0" width="100%" id="table171" cellspacing="0" cellpadding="0" class="table2">
				<tr>
					<td width="288" valign="top">
<table class="table2" width="288" cellspacing="2" cellpadding="2">
<tr><td class="tdbottom">
	<table border="0" width="100%" id="table601" cellspacing="0" cellpadding="0">
<tr><td width="73" height="24" align="center"><font color="#FF0000"><b><%=year(now)%>年</b></font></td>
	<td class="tdbg1" width="6">　</td>
	<td width="209"><%=webname%><b><font color="#008000">D</font><font color="#000080">M</font><font color="#800000">直</font><font color="#008080">投</font><font color="#00FF00">广</font><font color="#FF0000">告</font></b></td></tr>
	</table>
	</td></tr>
<%dim aej,rsfox,sqlfox
set rsfox=server.createobject("adodb.recordset")
sqlfox="select top 12 * from FOX_dml order by l asc"
rsfox.open sqlfox,conn,1,1
if rsfox.eof then
response.write "还没有月份DM广告."
else
do while not rsfox.eof
%><tr><td height="24">
<table border="0" width="100%" class="table2">
	<tr>
		<td rowspan="3" width="80" align="center"><A href="?y=<%=rsfox("l")%>"><img border="0" src="dmimages/<%=rsfox("l")%>.gif"></a><br>
本期：<A href="?y=<%=rsfox("l")%>">查看</a>
		<br><%dim j0
		j0=conn.Execute("SELECT COUNT(ID) FROM [FOX_dm] WHERE y="&rsfox("l")&"")(0)%>投<font color="#FF0000"><%=j0%></font>条</td>
		<td rowspan="3" width="0"></td>
		<td width="60"><img border="0" src="dmimages/01.gif"></td>
		<td><%dim j1
		j1=conn.Execute("SELECT COUNT(ID) FROM [FOX_dm] WHERE y="&rsfox("l")&" and r<=10")(0)%><font color="#008080">投：</font><font color="#FF0000"><%=j1%></font></td>
		<td><font color="#008080">条</font></td>
	</tr>
	<tr>
		<td width="60"><img border="0" src="dmimages/02.gif"></td>
		<td><%dim j2
		j2=conn.Execute("SELECT COUNT(ID) FROM [FOX_dm] WHERE y="&rsfox("l")&" and r>10 and r<=20")(0)%><font color="#008080">投：</font><font color="#000080"><%=j2%></font></td>
		<td><font color="#008080">条</font></td>
	</tr>
	<tr>
		<td width="60"><img border="0" src="dmimages/03.gif"></td>
		<td><%dim j3
		j3=conn.Execute("SELECT COUNT(ID) FROM [FOX_dm] WHERE y="&rsfox("l")&" and r>20")(0)%><font color="#008080">投：</font><font color="#008000"><%=j3%></font></td>
		<td><font color="#008080">条</font></td>
	</tr>
</table>
</td></tr><%
aej=aej+1
if aej>=12 then exit do
rsfox.movenext
loop
end if
rsfox.close
set rsfox=nothing
%></table>
</td>
					<td width="35">　</td>
					<td valign="top">
<table border="0" width="100%" id="table170" cellspacing="0" cellpadding="0" class="tdbg2">
	<tr>
		<td height="24">&nbsp; <b>DM直投广告列表</b> (请交易双方妥善检验双方证件,本DM广告不作为承担法律依据的责任)</td>
	</tr>
</table>

<%dim rsfoxf,sqlfoxf
tj=0
set rsfoxf=server.createobject("adodb.recordset")
 sqlfoxf="SELECT * FROM FOX_dm where yz=1 and"
 If y<>"" Then sqlfoxf=sqlfoxf&" y="&y&" and"
 If t1<>""  and t2<>"" Then sqlfoxf=sqlfoxf&" "&t1&"=<r<="&t2&" and"
 If d<>"" Then sqlfoxf=sqlfoxf&" lei like '%"&d&"%' and"
' if right(sqlfoxf,5)="where" then sqlfoxf=left(sqlfoxf,clng(len(sqlfoxf))-5)
 if right(sqlfoxf,3)="and" then sqlfoxf=left(sqlfoxf,clng(len(sqlfoxf))-3)
 sqlfoxf=sqlfoxf&" order by sj desc"
 rsfoxf.Open sqlfoxf,conn,1,3
 rsfoxf.Pagesize=30
Pagesize=rsfoxf.Pagesize
Allrecord=rsfoxf.Recordcount
Allpage=rsfoxf.Pagecount
if ThisPage<1 then                           
ThisPage=1                           
end if
On Error Resume Next
rsfoxf.move (ThisPage-1)*Pagesize
if rsfoxf.eof then
response.write "暂时没有！"
else
%>					
					<table border="0" width="100%" id="table603" class="table2" cellspacing="1">
						<tr>
							<td style="word-spacing:8pt;font-size:10pt; line-height:300%">

<%do while not rsfoxf.eof%>	
<font class="z3" style="font-size:14px;height:14px;color:red;filter:glow(color=yellow,strength=1);"><%=rsfoxf("lei")%></font> <%if rsfoxf("z")=1 then%><b><a target="_blank" href="<%=rsfoxf("ht")%>"><%=rsfoxf("bt")%></a></b><%else%><font class="z3"><b><%=rsfoxf("bt")%></b>&nbsp;<%=rsfoxf("nr")%></font>&nbsp;<font class="z1">电话：</font><font color="#FF0000"><%=rsfoxf("tel")%></font>&nbsp;<%=rsfoxf("name")%><%end if%>				
			<%
        tj=tj+1
        if tj>=Pagesize then exit do
        rsfoxf.movenext
        loop
        %> 							</td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
  
 </td>
		</tr>
		
		<tr>
			<td  height="25" valign="top" align="center">


				<table width="100%" border="0" cellpadding="0" bordercolor="#111111" style="border-collapse: collapse" id="table170" class="tdbg2">
                <tr>
                  <td height="25" width="163" class="p9t"><p align="center"> 
					<font color="#CC5200"><%=Pagesize%></font> 条/页 &nbsp;共 <font color="#CC5200"><%=Allrecord%></font> 条记录</td>
                  <td height="25" width="103" class="p9t"><p align="center">共 <font color="#CC5200"><%=Allpage%></font> 页</td>
                  <td height="25" width="78" class="p9t"><p align="center">第 <font color="#CC5200"><%=ThisPage%></font> 页</td>
                  <td height="25" width="187" class="p9t"><p align="center">
 <%
if ThisPage<2 then     
response.write "<font color=""#808080"">首页</font>&nbsp;"
response.write "<font color=""#808080"">上一页</font>&nbsp;"     
else     
response.write "<a href=?page=1&y="&y&"&t1="&t1&"&t2="&t2&"&d="&d&">首页</a>&nbsp;"
response.write "<a href=?page="&ThisPage-1&"&y="&y&"&t1="&t1&"&t2="&t2&"&d="&d&">上一页</a>&nbsp;"     
end if
if Allpage-ThisPage<1 then     
response.write "<font color=""#808080"">下一页</font>&nbsp;"
response.write "<font color=""#808080"">尾页</font>&nbsp;"  
else     
response.write "<a href=?page="&(ThisPage+1)&"&y="&y&"&t1="&t1&"&t2="&t2&"&d="&d&">下一页</a>&nbsp;"   
response.write "<a href=?page="&Allpage&"&y="&y&"&t1="&t1&"&t2="&t2&"&d="&d&">尾页</a>&nbsp;"     
end if
%>  
                    </td>
                </tr>
              </table>


 <%end if
 rsfoxf.close
 set rsfoxf=nothing%>  
 　</td>
		</tr>
		
</table>
</div>

</body>
<!--#include file="ffbottom.asp"-->
