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

<div style="width:100%"><div id="left"><!--#include file="include/menu_left.asp"--></div>
<div id="right" class="right">
<form name="form1" action="news_action.asp?action=cl_add" method="post" style="margin:1px">
	<div id="newslb"><font color=red style="font-size:13px"><%=session("msg")%></font><%session("msg")=""%></div>
	<div id="newslb">请输入你要设置的分类名称:<input name="dl" type="text" class="input" id="dl" size="30" maxlength="25">&nbsp;<input name="Submit" type="submit" id="Submit" value="提交"></div>
	<div class="newslb0">
		<div class="newslb1" style="background:#4E91E8; color:#FFFFFF;">序号</div><div class="newslb2" style="background:#4E91E8; color:#FFFFFF;">类别名称</div><div class="newslb1" style="background:#4E91E8; color:#FFFFFF;">编辑</div><div class="newslb1" style="background:#4E91E8; color:#FFFFFF;">删除</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_lb  order by lb_id desc"
		rs.open sql,conn,1,1
		if rs.eof then
		msg="数据库中无任何纪录"
		%>
		<div id="newslb"><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 
		nid=rs("lb_id")
		nmc=rs("lb_mc")
		
		sql1="select * from xld_news where news_type="&nid&""		
		set rs1=server.CreateObject("adodb.recordset")
		rs1.open sql1,conn,1,1
		if rs1.eof then
		sl=0
		else
		sl=1
		end if			
		rs1.close
		set rs1=nothing
		%> 
		<div class="newslb1"><%=rs("lb_id")%></div><div class="newslb2"><%=rs("lb_mc")%></div><div class="newslb1"><a href="?mc=<%=nmc%>&id=<%=nid%>"><img src="images/edit.gif" width="17" height="16" border="0"></a></div><div class="newslb1"><%if sl=0 then
%><a href="news_action.asp?id=<%=nid%>&amp;action=cl_del"><img src="images/del.gif" width="18" border="0"></a><%else%><a href="javascript:alert(&quot;该分类下有新闻，请删除新闻后再删除该类别&quot;);"><img src="images/del.gif" width="18" border="0"></a><%end if%></div>
		<%
		rs.movenext
		how=how+1
		loop
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
		end if
		%>
	</div>
</form>
<form name="formgo" action="<%=pathinfo%>" method="get" style="margin:0px">
<div id="newslb">共<font color=red><%=totalrows%></font>条信息，<font color=red><%=totalpages%></font>页，页次:<font color="#0000FF"><%=page%></font>/<font color="#FF0000"><%=totalpages%></font>页&nbsp;
<%if page<>1 then%>
<a href="<%=pathinfo%>?dl=<%=request.querystring("dl")%>&kw=<%=request.querystring("kw")%>&page=1">首 页</a> <a href="<%=pathinfo%>?dl=<%=request.querystring("dl")%>&kw=<%=request.querystring("kw")%>&page=<%=page-1%>">上一页</a>
<%else%>首 页 上一页
<%end if%>
<%if page<>TotalPages then%>
<a href="<%=pathinfo%>?dl=<%=request.querystring("dl")%>&kw=<%=request.querystring("kw")%>&page=<%=page+1%>">下一页</a> <a href="<%=pathinfo%>?dl=<%=request.querystring("dl")%>&kw=<%=request.querystring("kw")%>&page=<%=TotalPages%>">末 页</a>
<%else%>下一页 末 页
<%end if%>
&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">
<input name="dl" type="hidden" value="<%=request.querystring("dl")%>">
<input name="kw" type="hidden" value="<%=request.querystring("kw")%>">
</div></form>
<br><br><br>
<form name="form1" action="news_action.asp?action=cl_modify&id=<%=request.querystring("id")%>" method="post" style="margin:1px">
	<div id="newslb">请输入你要设置的大类名称:<input name="dl" type="text" class="input" id="dl" value="<%=request.querystring("mc")%>" size="30" maxlength="25">&nbsp;<input name="Submit" type="submit" class="bt_main" value="提交"></div>
</form>
</div></div>

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