<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="setup.asp"-->
<!--#include file="conn.asp"-->
<%yiid=getsaferequest(trim(request("yiid")))
erid=getsaferequest(trim(request("erid")))
if yiid="" then
	response.write "错误!版面编号不能为空!<a href=# onclick='javascript:window.history.go(-1)'>返回</a>"
	response.end
end if

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=site_name%></title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="top.asp"-->
<div id="box">
<div id="left">
<%if erid="" then
			set rs1=server.createobject("ADODB.recordset")
sql="select * from erkind where show=true and yiid="&yiid
rs1.open sql,conn,1,1
do while not rs1.eof
%>
<%

rs1.movenext
loop
rs1.close
end if			

if yiid<>"" then
set rsbig=server.createobject("ADODB.recordset")
rsbig.open "select yiname from yikind where yiid=" & cstr(yiid) & "",conn,1,1
yiname_show=rsbig("yiname")
rsbig.close
set rsbig=nothing
end if

if erid<>"" then
set rssmall=server.createobject("ADODB.recordset")
rssmall.open "select ername from erkind where erid=" & cstr(erid) & "",conn,1,1
ername_show=rssmall("ername")
rssmall.close
set rssmall=nothing
end if

%>
<div id="nav4">栏目导航</div>
  <div id="nav_content">
  <ul class="cannel2">
<%
set rs1=server.createobject("ADODB.recordset")
sql="select * from erkind where yiid="&yiid&"  order by erorder asc"
rs1.open sql,conn,1,1
do while not rs1.eof
%>
<li><a class="ertitle" href="list2.asp?yiid=<%=yiid%>&amp;erid=<%=rs1("erid")%>"><%=rs1("ername")%></a></li>
<%
rs1.movenext
loop
rs1.close
if yiid<>"" then
set rsbig=server.createobject("ADODB.recordset")
rsbig.open "select yiname from yikind where yiid=" & cstr(yiid) & "",conn,1,1
yiname_show=rsbig("yiname")
rsbig.close
set rsbig=nothing
end if
%>
</ul>
</div>
<div id="nav4">点击排行</div>
<div id="nav_content">
<ul>
<%
 Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open "select top 6 * from news order by hit desc",conn,1,1
if rs.eof and rs.bof then
response.Write("")
else
do while not rs.eof
%>
<li>·<a href="list.asp?yiid=<%=rs("yiid")%>"><%=rs("title")%></a></li>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
 %>
</ul>
</div>

</div>

<div id="right">
<div id="address">您的位置：本站首页→ <%if yiid<>"" then response.Write("→"&yiname_show) end if%>
            <%if erid<>"" then response.Write("→"&ername_show) end if%>
          </div>

<div id="big_content">
<div id="content">
<%
set rs=server.createobject("ADODB.recordset")
if erid="" then
sql="select * from news where yiid=" & cstr(yiid) & " order by id DESC"
else
er="ok"
sql="select * from news where yiid=" & cstr(yiid) & " and erid=" &cstr(erid)&" order by id DESC"
end if

rs.open sql,conn,1,1
if rs.eof then
response.write "暂无相关信息"
else
number=san_lanmu_no  '设置梅页显示条数
if request("page")="" then
curpage = 1
else
curpage = cint(getsaferequest(request("page")))
end if

rs.pagesize=cint(number)
rs.absolutepage = curpage
for i= 1 to rs.pagesize
response.Write "<table width='100%'cellSpacing=0 cellPadding=0 border=0><tr><td width='15'><img src='img/arrow.gif'></td><td  style='font-size:12px; line-height:28px;border-bottom: 1px dotted #cccccc; width:88%'><a href='show.asp?id=" & rs("id") & "' target='_blank'  title='"& rs("title") & "  [" & rs("newstime")& "]" & "'>"
'rs("title")
response.write rs("title")
if date()<rs("newstime")+2 then
						response.write  "<img src='img/news2.gif' border=0>"
end if
response.write "</a></td><td style='font-size:12px; line-height:28px;border-bottom: 1px dotted #cccccc;'>["&Gettime(rs("newstime"))&"]</td></tr></table>"

rs.movenext
if rs.eof then
           i=i+1
           exit for
       end if
next
%>
</div>
<div id="page"><%     response.Write "当前<b>"&curpage&"</b>页/总共<b>"&rs.pagecount&"</b>页&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
     if curpage = 1 then 
		response.write "首页 前页 "
	else
		if er="ok" then response.write "<a class='xiahua' href='?erid="& cstr(erid) &"&yiid="& cstr(yiid) &"&page=1'>首页</a> <a class='xiahua' href='?erid="& cstr(erid) &"&yiid="& cstr(yiid) &"&page=" & cstr(curpage-1) & "'>前页</a> " else response.write "<a class='xiahua' href='?yiid="& cstr(yiid) &"&page=1'>首页</a> <a class='xiahua' href='?yiid="& cstr(yiid) &"&page=" & cstr(curpage-1) & "'>前页</a> " end if
	end if
	if  curpage = rs.pagecount then
		response.write "后页 末页"
	else
	    if er="ok"	then response.write "<a class='xiahua' href='?erid="& cstr(erid) &"&yiid="& cstr(yiid) &"&page=" & cstr(curpage+1) & "'>后页</a> <a class='xiahua' href='?erid="& cstr(erid) &"&yiid="& cstr(yiid) &"&page=" & cstr(rs.pagecount) & "'>末页</a>" else response.write "<a class='xiahua' href='?yiid="& cstr(yiid) &"&page=" & cstr(curpage+1) & "'>后页</a> <a class='xiahua' href='?yiid="& cstr(yiid) &"&page=" & cstr(rs.pagecount) & "'>末页</a>" end if
	end if
	response.write "(总共<b>"&rs.recordcount&"</b>条新闻)"
''''''''设置上一页,下一页功能////////////////////////////////////////////////////////////////////////////////////
end if
%>
</div>
</div>
</div>
</div>
<!--#include file="bottom.asp"-->
</body>
</html>
<%

rs.close
set rs=nothing
conn.close
set conn=nothing
%>