<%

if Request.Cookies("admindj")<>"1" then
   Response.Write "<BR><BR><BR><BR><center>权限不足，你没有此功能的管理权限"
   Response.end
end if

Function finddir(filepath)
	finddir=""
	for i=1 to len(filepath)
	if left(right(filepath,i),1)="/" or left(right(filepath,i),1)="\" then
	  abc=i
	  exit for
	end if
	next
	if abc <> 1 then
	finddir=left(filepath,len(filepath)-abc+1)
	end if
end Function

%>
<!--#include file = admin_chk.asp -->
<!--#include file = admin_conn.asp -->
<!--#include file = language.asp -->

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type="text/css">
<!--
a:link {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited {text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline}
body {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000}
TD {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;table-layout:fixed;word-break:break-all}
p {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
input {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
body {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select {FONT-SIZE: 9PT;font-family: 宋体}
option {FONT-SIZE: 9pt;font-family: 宋体}
textarea {FONT-SIZE: 9pt;font-family: 宋体}
-->
</STYLE>
</head>

<body>

<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="600" id="table1">
		<tr>
			<td>　</td>
		</tr>
		<tr>
			<td>　<a href="admin_ztAdd.asp">新增专题</a></td>
		</tr>
		<tr>
			<td>　</td>
		</tr>
	</table>
</div>

<div align="center">
	<table border="1" cellpadding="3" width="600" id="table2" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td bgcolor="#FFFFCC" height="30" align="center"><b>专题</b></td>
			<td bgcolor="#FFFFCC" height="30" align="center"><b>文章数量</b></td>
			<td bgcolor="#FFFFCC" height="30" align="center"><b>操作</b></td>
		</tr>
<%
delid=trim(Request("delid"))
if delid<>"" then
	conn.Execute "delete from [NewsZt] where ID="&CInt(delid)
end if
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select id,title from [NewsZt] order by id desc",conn,1,1
if rs.recordcount<>0 then

page=int(request("page"))
rs.PageSize=20
pagecount=rs.pagesize
if page<=0 then page=1
if request("page")="" then page=1
rs.AbsolutePage=page

for i=1 to pagecount
 id=rs("id")
%>		
		<tr>
			<td><a href="News_zt.asp?ztid=<%=id%>" target=_blank><%=rs("title")%><font color="#808080">(ID:<%=rs("id")%>)</font></a></td>
			<td align="center">
				<%
					set rs2 = Server.CreateObject("ADODB.RecordSet")
					rs2.Open "select id,ztid from [News] where ztid="&ID&" order by id desc",conn,1,1
					Response.Write rs2.recordcount
					rs2.close:set rs2=nothing
				%>
			</td>
			<td align="center"><a href="admin_ztAdd.asp?editid=<%=id%>">修改</a> <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复！")){return true;}return false;}' href="?delid=<%=id%>">删除</a></td>
		</tr>
<%
rs.movenext
if rs.eof then exit for
next

end if
%>		
	</table>
</div>
<br>
<center>
<%if rs.recordcount<>0 then
	if page>1 then
		response.write "<a href="&request.servervariables("URL")&"?page=1&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">首页</a>　"
		response.write "<a href="&request.servervariables("URL")&"?page="&page-1&"&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">上一页</a>　"
	end if
	if page<rs.pagecount then
		response.write "<a href="&request.servervariables("URL")&"?page="&page+1&"&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">下一页</a>　"
		response.write "<a href="&request.servervariables("URL")&"?page="&rs.pagecount&"&id="&id&"&lm="&lm&"&lb="&lb&"&word="&word&">尾页</a>　"
	end if
	response.write "共"&rs.recordcount&"条　每页显示"&pagecount&"条　共"&rs.pagecount&"页　"
	%>
	<script language="JavaScript">
		<!--
		function FP_jumpMenu(el,frm,sel) {//v1.0
		var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
		if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
		}
		// -->
	</script>
	<select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
	<%for i=1 to rs.pagecount%>
		<option value="<%=request.servervariables("URL")%>?page=<%=i%>&id=<%=id%>&lm=<%=lm%>&lb=<%=lb%>&word=<%=word%>" <%if page=i then response.write "selected"%> style="font-size: 9pt">第<%=i%>页</option>
	<%next%>
	</select>
<%end if%>
</center>
<br>
<div align="center">
	<table border="1" cellpadding="3" width="700" id="table3" style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr>
			<td>JS调用：<br>
			<font color="#FF0000">&lt;script TYPE=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;<%=finddir(request.servervariables("URL"))%>newscodeztjs.asp?ztid=</font><font color="#0000FF">ID</font><font color="#FF0000">&amp;list=10&amp;icon=1&amp;tj=0&amp;font=9&amp;hot=0&amp;new=1&amp;line=2&amp;lmname=0&amp;open=1&amp;n=20&amp;more=1&amp;t=0&amp;week=0&amp;zzly=0&amp;hit=0&amp;pls=0&quot;&gt;&lt;/script&gt;</td>
		</tr>
	</table>
</div>
</body>

</html>

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