<!--#include file="head.asp"-->
<!-- 这里是主题 -->

<%thename=HtmlEncode(trim(request("name")))
if thename="" then
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"
response.end
end if

Function PageSplit(currentpage,totalpage,pagename)                            
if currentpage mod 10 = 0 then                            
Sp = currentpage \ 10                            
else                            
Sp = currentpage \ 10 + 1                            
end if                            
Pagestart = (Sp-1)*10+1                            
Pageend = Sp*10                            
strSplit = "<a href="&pagename&"?name="&thename&"&pageid=1><font face=webdings title=第一页>9</font></a>&nbsp;"                            
if Sp > 1 then strSplit = strSplit & "<a href="&pagename&"?name="&thename&"&pageid="&Pagestart-10&"><font face=webdings title=前十页>7</font></a>&nbsp;"                            
for j=PageStart to Pageend                            
if j > totalpage then exit for                            
if j <> currentpage then                            
strSplit = strSplit & "<a href="&pagename&"?name="&thename&"&pageid="&j&">["&j&"]</a>&nbsp;"			                            
else                            
strSplit = strSplit & "<font color=red>["&j&"]</font>&nbsp;"                            
end if                            
next                            
if Sp*10  < totalpage then strSplit = strSplit & "<a href="&pagename&"?name="&thename&"&pageid="&Pagestart+10&"><font face=webdings title=后十页>8</font></a>"                             
strSplit = strSplit & "<a href="&pagename&"?name="&thename&"&pageid="&totalpage&" ><font face=webdings title=""最后一页"">:</font></a>"                            
PageSplit = strSplit                            
End Function%>


<%dim sql,rs,thepage,currentpage,pagename,totalpage,n,page
sql="select * from data where type ='"&thename&"' and mark='yes' and stop >= date() order by top desc,money desc,time desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1 
if rs.eof then %>                        
<TABLE WIDTH=778 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
  <TR>
	 
    <td width="100%" height="20" style="BORDER-RIGHT: #91b9dd 1px dotted; BORDER-TOP: #91b9dd 1px dotted; BORDER-LEFT: #91b9dd 1px dotted; BORDER-BOTTOM: #91b9dd 1px dotted" colspan="4" align="center"> 
      <%=thename%>分类中暂无广告信息！ </td>
  </tr>
</TABLE>
<%rs.close  
set rs=nothing                                                                                     
'response.end                             
else  
thepage=request("pageid")
if isnumeric(thepage)=false then
response.write "<script>alert('参数错误，关闭窗口！');window.close();</script>"
response.end
end if
currentpage = cLng(thepage)            
if currentpage <= 0 then currentpage=1       
const maxperpage=70                        
rs.Pagesize = maxperpage  
pagename="type.asp"                     
totalpage = rs.PageCount 
rs.absolutepage = currentpage 
n=rs.recordcount                    
page = PageSplit(currentpage,totalpage,pagename)%>
<TABLE WIDTH=778 BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
  <TR>
	 
    <td width="100%" height="30" colspan="4" align="center" background="upload/tzzy_bkg.gif" bgColor="#CAF046" style="BORDER-RIGHT: #91b9dd 1px dotted; BORDER-TOP: #91b9dd 1px dotted; BORDER-LEFT: #91b9dd 1px dotted; BORDER-BOTTOM: #91b9dd 1px dotted"> 
      <font style="font-size:14px" color="#0000BF"><%=thename%></font>&nbsp;&nbsp;页次：<b><%=currentpage%>/<%=totalpage%></b>&nbsp;&nbsp;每页<b><%=maxperpage%></b>条&nbsp;&nbsp;共刊登<b><%=n%></b>条广告&nbsp;&nbsp;&nbsp;&nbsp; 
      <%response.write page%>
    </td>
  </tr>
</TABLE> 
<TABLE WIDTH=778 height="231" BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
<%i=0 
do while i < maxperpage and not rs.eof%> 

    <td width="25%" height="117"> 
      <table width="100%" height="117" border="0" cellpadding="1" cellspacing="2">
        <tr> 
          <td width="100%" height="24" align="center" background="upload/beijinggao.gif" bgcolor="#F9F168" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted" <%if rs("bgcolor1")<>"" then%>bgcolor="<%=rs("bgcolor1")%>"<%else%>bgColor="#ffe8e8"<%end if%>> 
            <a href="show.asp?id=<%=rs("adid")%>" target="_blank"> 
            <%if rs("cu")="yes" then%>
            <b><font style="font-size:12px" <%if rs("color")<>"" then%>color="<%=rs("color")%>"<%end if%>><%=left(rs("title"),10)%></font></b> 
            <%else%>
            <font style="font-size:12px" <%if rs("color")<>"" then%>color="<%=rs("color")%>"<%end if%>><%=left(rs("title"),10)%></font> 
            <%end if%>
            </a> </td>
        </tr>
        <tr> 
          <script language=JavaScript>
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
function statusOut() {
self.status = '';
}
</script>
          <td width="100%" height="87" align="center" valign="top" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted;cursor: hand" ;> 
            <%if rs("ispic")<>"yes" then%>
            <%else%>
            <a href="<%=rs("url")%>" target="_blank"><img src="adpic/<%=rs("pic")%>" border="0" width="105" height="80"></a> 
            <%end if%>
          </td>
        </tr>
      </table></td>

<%i=i+1
if i mod 7=0 then%>
</tr><tr>
<%    
end if
rs.movenext
loop  
if (n mod 7) <> 0 and not i mod maxperpage = 0 Then 
for i = 1 to (7 - (n mod 7))%>
    <td width="25%" height="114"> 
      <table border="0" width="100%" cellpadding="1" cellspacing="2">
        <tr> 
          <td width="100%" height="24" align="center" background="upload/beijinggao.gif" bgColor="#F9F168" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted"> 
            <b><font style="font-size:14px" ><font color="#000000">招商信息</font></font></b></td>
        </tr>
        <tr> 
          <td width="100%" height="84" style="BORDER-RIGHT: #dd91a5 1px dotted; BORDER-TOP: #dd91a5 1px dotted; BORDER-LEFT: #dd91a5 1px dotted; BORDER-BOTTOM: #dd91a5 1px dotted"> 
            <div align="center"> 
              <table width="105" height="80" border="0" cellpadding="0" cellspacing="0">
                <tr> 
                  <td width="100%" height="72"> 
                    <p style="margin-top: 2" align="center"><font color="red">茫茫商海<br>
                      处处商机</font><br></br>
                      本栏目诚征广告</p></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table></td>
<%next                                                  
end if                                                                            
rs.close                                                   
set rs=nothing                                                 
conn.close                                                    
set conn=nothing%> 

</tr> 

</table>
 

<%end if%>
<!-- 这里是主题结束 -->
<!--#include file="foot.asp"-->
