<%tp=request.querystring("type")%>
<!--#include file="include/ht.asp"-->
<!--#include file="include/menu_top.asp"-->
<script src="js/del.js"></script>

<%
id=request.querystring("id")
zt=request.querystring("zt")
if zt=1 then
sql="update xld_news set zt=0 where news_id="&id&""
elseif zt=0 then
sql="update xld_news set zt=1 where news_id="&id&""
end if
conn.execute(sql)
%>

<div style="width:100%"><div id="left"><!--#include file="include/menu_left.asp"--></div>
<div id="right" style="padding:5px;">
	<%
	set rs=server.createobject("adodb.recordset")
	sql="select * from xld_news_lb where lb_id="&tp&""
	rs.open sql,conn,1,1
	do until rs.eof
	title=rs("lb_mc")	  
	rs.movenext
	loop
	rs.close
	set rs=nothing
	%>	  
	<div id="news" style="font-family:'黑体'; font-size:16px; color:#0066FF"><%=title%></div>
<form name="form1" action="news_action.asp?action=del&acdb=news&type=<%=tp%>" method="post" style="margin:1px" onSubmit="return OnDelete()">
	<div id="news"><p style="float:left; width:50%; text-align:right;"><font color=red style="font-size:13px"><%=session("msg")%></font><%session("msg")=""%></p><p style="float:right; text-align:right; padding-right:10px;"><a href="news_edit.asp?action=add&type=<%=tp%>"><img src="images/addnew.gif" width="89" height="22" border="0"></a>&nbsp;&nbsp;<input name="Submit2" type="image" value="删除信息"src="images/bt_del.gif" width="89" height="22"></p></div>
	<div id="news_id" class="news_id">ID</div><div id="news_title" class="news_title">信息标题</div><div id="news_category" class="news_category">信息类别</div><div id="news_date" class="news_date">发布日期</div><div id="news_click" class="news_click">点击</div><div id="news_modify" class="news_modify">修改</div><div id="news_delete" class="news_delete">删除</div>
          <%
			if request.querystring("page")="" then
			page=1
			else
			page=request.querystring("page")
			end if
			page=cint(page)
			Const adOpenKeyset = 1
			Const adLockReadOnly = 1
				   
			set rs=server.CreateObject("adodb.recordset")
			sql="select * from xld_news where news_type="&tp&" order by news_id desc"
			rs.open sql,conn,1,1
			if rs.eof then
			msg="数据库中无任何纪录"
			%>
			<div id="news"><font color=red><%=msg%></font></div>
			<%	
			else
			rs.pagesize=10
			TotalPages=rs.PageCount
			Pagesize=rs.pagesize
			rs.absolutepage=page
			totalrows = rs.RecordCount 
			how=0
			Do until rs.EOF or how= PageSize 
			id=rs("news_id")
			title=rs("news_title")
			rq=rs("news_rq")
			click=rs("news_click")
			tp=rs("news_type")
			zt=rs("zt")
			
			sql1="select * from xld_news_lb where lb_id="&tp&""
			set rs1=server.createobject("adodb.recordset")
			rs1.open sql1,conn,1,1
			if rs1.eof then
			response.write("无相关纪录")
			else
			
			do until rs1.eof
			tp1=rs1("lb_mc")
			rs1.movenext
			loop
			end if
			rs1.close
			set rs1=nothing
			%>
	<div id="news_id"><%=id%></div><div id="news_title"><%=title%></div><div id="news_category"><%=tp1%></div><div id="news_date">[ <%=rq%> ]</div><div id="news_click"><%=click%></div><div id="news_modify"><a href="news_edit.asp?action=modify&id=<%=id%>&type=<%=tp%>"><img src="images/edit.gif" height="14" border="0"></a></div><div id="news_delete"><input id="ck" type="checkbox" name="check<%=id%>" value="<%=id%>" style="height:14px;"></div>
			<%
			rs.movenext
			how=how+1
			loop
			rs.close
			set rs=nothing
			conn.close
			set conn=nothing
	%>
</form>
<form name="form" action="<%=pathinfo%>?type=<%=tp%>&page=<%=page%>" method="get" style="margin:1px">
    <input name="type" type="hidden" value="<%=tp%>">
	<div id="news">当前共有<font color=red><%=totalrows%></font>条信息，<font color=red><%=pagesize%></font>条/页，共<font color=red><%=totalpages%></font>页，页次:<font color="#0000FF"><%=page%></font>/<font color="#FF0000"><%=totalpages%></font>页 &nbsp;&nbsp;
	<%if page<>1 then%>
	<a href="<%=pathinfo%>?type=<%=tp%>&page=1" class="news">首 页</a> <a href="<%=pathinfo%>?type=<%=tp%>&page=<%=page-1%>" class="news">上一页</a>
	<%else%>首 页 上一页
	<%end if%>
	<%if page<>TotalPages then%>
	<a href="<%=pathinfo%>?type=<%=tp%>&page=<%=page+1%>" class="news">下一页</a> <a href="<%=pathinfo%>?type=<%=tp%>&page=<%=TotalPages%>" class="news">末 页</a>
	<%else%>下一页 末 页
	<%end if%>
	&nbsp;&nbsp;跳转到第
	<select name="page" size="1">
	<option value=<%=page%>><%=page%></option>
	<%
	for i=1 to totalpages
	if i=page then
	else
	%>
	<option value=<%=i%>><%=i%></option>
	<%
	end if
	next%>
	</select>
	<input type="submit" name="Submit" value="GO">
	<%end if%>
	</div>
</form>
</div></div>

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