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

📄 carnews.asp

📁 模块及功能: 1.汽车新闻 分类.查询.翻页 2.出售信息 搜索.评估.地区展示.发布.展示.固顶.刷新 3.求购信息 发布.展示.固顶.刷新 3.加盟商家管理 注册.登录.信
💻 ASP
字号:
<!--数据库链接文件-->
<!--#include file="byshop_conn.asp"-->
<!--网站头文件-->
<!--#include file="webhead.asp"--><title>汽车新闻<%set rs2news=server.createobject("adodb.recordset")
       classid=trim(request("class"))
        if  classid="" then
    sql="select * from News  order by adddate desc"
    else
        if  classid=1 then
        sql="select * from News where class=1  order by adddate desc"
        response.write "-二手车新闻"
        class1="二手车新闻"
        end if 
         if  classid=2 then
        sql="select * from News where class=2  order by adddate desc"
                response.write "-行内标准"
                       class1="行内标准"
        end if 
         if  classid=3 then
        sql="select * from News where class=3  order by adddate desc"
                response.write "-行内政策"
                       class1="行内政策"
        end if 
         if  classid=4 then
        sql="select * from News where class=4  order by adddate desc"
                response.write "-二手车贷款"
                       class1="二手车贷款"
        end if 
         	 
    end if
    rs2news.open sql,conn,1,1
		%>-<%=webname%></title>
<SCRIPT language=javaScript>
<!--
function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)) { 
		src.style.cursor = 'hand'; 
		src.bgColor = clrOver; 
	}
}
function mOut(src,clrIn)  { 
	if (!src.contains(event.toElement)) { 
		src.style.cursor = 'default'; 
		src.bgColor = clrIn; 
	}
} 
//-->
</SCRIPT>
<div align="center">
<table border="0" width="779" id="table3" cellspacing="0" cellpadding="0">
	<tr>
		<td>您的位置:<a href="default.asp">网站首页</a> &gt; 
		<a href="carnews.asp">汽车新闻</a><%if  class1<>"" then%> <%="&nbsp;&gt;&nbsp;"&class1%><%end if%></td>
	</tr>
</table>
<table border="0" width="779" id="table1" cellpadding="0" style="border-collapse: collapse">
	<tr>
		<td width="175" valign="top"><!--网站左面-->
	  <div align="center">
		<table width="100%" border="0" cellspacing="1" cellpadding="0" id="table1">
       
 <tr> 
          <td  align="center" valign="top" height="2"></td>
        </tr> <tr> 
          <td  align="center" valign="top">
			<!--新闻--><!--#include file="in_news.asp"-->
			<!--二手车收索--><!--#include file="in_newssearch.asp"-->
			<!--广告--><!--#include file="in_ads2.asp"-->

       
		  </td>
        </tr>
       
      </table>
    
		</div>

		 </td>
		<td width="4" valign="top">
		 &nbsp;&nbsp;</td>
		<td valign="top">
	
		<div align="right">
			<table border="0"  id="table2" cellspacing="0" cellpadding="0">
				<tr>
					<td align="center"><table cellSpacing="0" cellPadding="0" width="100%" bgColor="#ffffff" border="0" id="table64">
				<tr>
					<td vAlign="top" align="middle">
					<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table65">
						<tr vAlign="top">
							<td>
							<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table66">
								<tr>
									<td vAlign="top">
									<table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table67">
										<tr>
											<td width="6">
											<p align="left">
											<img height="6" src="images/didi_001.gif" width="6"></td>
											<td background="images/didi_005.gif">
											<p align="left">
											<img height="6" src="images/didi_005.gif" width="6"></td>
											<td width="6">
											<p align="left">
											<img height="6" src="images/didi_002.gif" width="6"></td>
										</tr>
										<tr>
											<td background="images/didi_007.gif">
											<p align="left"> </td>
											<td vAlign="top">
											<table height="1" cellSpacing="0" cellPadding="0" width="100%" bgColor="#ffffff" border="0" id="table68">
												<tr>
													<td bgcolor="#BDDBE9">
													<p align="left"> <span lang="zh-cn">汽车新闻</span></td>
												</tr>
											</table>
											<table cellSpacing="0" cellPadding="5" width="100%" border="0" id="table69">
												<tr>
													<td class="didibaba_l17" vAlign="top">
            <table border="0" width="555" id="table2" cellspacing="0" cellpadding="0">
				<tr>
					<td align="center"></td>
				</tr>
				<tr>
					<td>
					<p align="right">『<a href="carnews.asp?class=1">二手车新闻</a>』 『<a href="carnews.asp?class=2">行内标准</a>』 
					『<a href="carnews.asp?class=3">行内政策</a>』 『<a href="carnews.asp?class=4">二手车贷款</a>』</td>
				</tr>
				<%
		if rs2news.recordcount=0 then 
		
		%>
				<tr>
					<td>暂无信息
					 </td>
				</tr>
				<%else%>
				<tr>
					<td>
					<%

	  		rs2news.PageSize =24 '每页记录条数
			iCount=rs2news.RecordCount '记录总数
			iPageSize=rs2news.PageSize
    		maxpage=rs2news.PageCount 
    		page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs2news.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	%>
        <table width="555" border="0" style="border-collapse: collapse" bordercolor="#BDDBE9" cellpadding="4">
         
          <%
			
			byshop_i=1
			For i=1 To x
			%>
          <tr onmouseout="mOut(this,'#FFFFFF');" onmouseover="mOvr(this,'#e4f3fa');"> 
		    <td  width="538" ><a href="news.asp?id=<%=rs2news("newsid")%>" title="<%=trim(rs2news("newsname"))%>"><%=trim(rs2news("newsname"))%></a><a title="<%=rs2news("adddate")%>"><font color="#ff9900">&nbsp;&nbsp;[ 
			<%=year(rs2news("adddate"))%>-<%=month(rs2news("adddate"))%>-<%=day(rs2news("adddate"))%> 浏览:<%=rs2news("viewcount")%> ]</font></a></td>
          </tr>
         <%if   byshop_i mod 10 = 0 then%>
          <tr > 
		    <td  width="538" > </td>
          </tr>
         <%end if%>
         
          <%
          byshop_i=byshop_i+1
			rs2news.movenext
		    next
			%>
        </table>
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td align="right">&nbsp;<%call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>")%></td>
			</tr>
		</table>
        <%
		
		end if
		rs2news.close
		set rs2news=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
 Response.Write(" 共有" & iCount & "条信息" &"&nbsp;"&   vbCrLf)
     Response.Write(" 共:" & pageCount & "页" &"&nbsp;"&   vbCrLf)
      Response.Write(" 每页" & iPageSize & "篇" &"&nbsp;"&  vbCrLf)
       Response.Write(" 当前第:" & page & "页" &"&nbsp;"&  vbCrLf)
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上一页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下一页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%></td>
				</tr>
				<tr>
					<td></td>
				</tr>
			</table><%rs2newsb.close
set rs2newsb=nothing%><table border="0" width="100%" id="table72" cellspacing="0" cellpadding="0">
				<tr>
					<td>
          
          			</td>
				</tr>
			</table>
													</td>
												</tr>
											</table>
											</td>
											<td background="images/didi_008.gif">
											<p align="left"> </td>
										</tr>
										<tr>
											<td>
											<p align="left">
											<img height="6" src="images/didi_003.gif" width="6"></td>
											<td background="images/didi_006.gif">
											<p align="left">
											<img height="6" src="images/didi_006.gif" width="6"></td>
											<td>
											<p align="left">
											<img height="6" src="images/didi_004.gif" width="6"></td>
										</tr>
									</table>
									</td>
							
									
								</tr>
							</table>
							</td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
					</td>
				</tr>
				</table>
		</div>
	
		</td>
	</tr>
</table>
<%rs2newsb.close
set rs2newsb=nothing%>

			
			<!--网站尾文件-->
		<!--#include file="webfoot.asp"-->
		
		</div> 
  

⌨️ 快捷键说明

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