<!--#include file="sd_mdb.asp"-->
<%
if session("User")="" then
	response.write"<SCRIPT language=JavaScript>alert('您尚未登录！');location.href=""sd_admin_login.asp"";</SCRIPT>"
end if
%>
<%
'导航条
Set rs = Server.CreateObject("ADODB.RecordSet")
StrSql="select * from sd_class order by sd_topid desc"
rs.open StrSql,Conn,1,1
%>
<%
dim pn,delete
pn=request("pn")
delete=request("delete")
if delete<>"" and session("lastdeleted")<>delete then
conn.execute "delete from sd_class where classid="&delete
response.write "<script language=javascript>alert('已删除一条编号为[ "&delete&" ]的分类!');this.location.href='sd_class.asp';</script>"
session("lastdeleted")=delete
end if
%>
<%
page=Request("page")
if page=0 or page="" then
page=1
end if
RecordCount = 0 
do while not rs.Eof
RecordCount = RecordCount +1
rs.MoveNext 
loop
if not RecordCount=0 then
rs.MoveFirst
end if
pageCount=RecordCount/30
pageCount=int(pageCount)
if (RecordCount mod 30)>0 then
PageCount=PageCount +1
end if 
%>
<html>
<head>
<TITLE>雨过天晴工作室 www.zzcodes.net</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="images/Admin_css.css" type=text/css rel=stylesheet>
</head>
<body>
<table width="95%" border="0" cellspacing="2" cellpadding="3"  align=center class="admintable" style="margin-bottom:5px;">
    <tr>
      <td height="25" bgcolor="f7f7f7">
<input type="button" name="button" value="管理分类" class="bnt" onClick="window.location.href='sd_class.asp'" />
<input type="button" name="button" value="添加分类" class="bnt" onClick="window.location.href='sd_class_add.asp'" />
	</td>
    </tr>
</table>
<table height="1" border="0" cellpadding="5" cellspacing="1" bgcolor="#F2F9E8" class="admintable1">
  <tr>
    <td colspan="6" class="admintitle">分类管理</td>
  </tr>
  <tr bgcolor="E8FBD1" align="center">
    <td width="6%" height="30">ID</td>
    <td width="6%">排序</td>
    <td width="10%">分类名称</td>
    <td width="8%">修改</td>
    <td width="8%">删除</td>
    <td><font color="#ff0000"></font></td>
  </tr>
<%
do while pos<(page-1)*30
pos=pos+1
rs.MoveNext 
loop
i=1
x=0 
do while x<30 and not rs.eof
%>
  <tr align="center" <%If i/2=Cint(i/2) Then response.write "bgcolor=#F7FDEF" Else Response.write "bgcolor=#FFFFFF" End If %> >
   <td height="30"><%=Rs("classid")%></td>
   <td><%=Rs("sd_topid")%></td>
   <td><%=rs("sd_classname")%></td>
   <td><a href="sd_class_edit.asp?classid=<%=Rs("classid")%>">修改</a></td>
   <td><a href="?pn=<%=pn%>&delete=<%=Rs("classid")%>" onclick="return confirm('慎重！将同时删除该分类下的所有网站，你确认要继续吗？')">删除</a></td>
   <td></td>
  </tr>
<%
i=i+1
x=x+1
Rs.MoveNext
loop
rs.close
set rs=nothing
%>
<tr>
<td height="30" colspan="6"> 共有信息<font color="#FF0000"><%=RecordCount%></font>条，共 <font color="#FF0000"><%=pageCount%></font> 页，第 <font color="#FF0000"><%=page%></font> 页
<%y=1%>
<%do while y<pagecount+1%>
<a href="?page=<%=y%>">[<%=y%>]</a> 
<%
y=y+1 
loop
%>
</td></tr>
</table>
<!--#include file="sd_copy.asp"-->
</body>
</html>