<!--#include file="../siteconfig/conn.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
%>
<!--#include file="Admin_ClassFunction.asp"-->
<HTML>
<HEAD>
<TITLE>子分类管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<link href="./images/admincp/admincp.css" rel="stylesheet" type="text/css" />

</HEAD>

<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>
<h3>子分类管理</h3>
<%dim Class_Id
Class_Id=Request("Class_Id")
rs.open"select * from UrlClass where UrlClass_ClassId="&Class_Id,conn,1,3
dim UrlClassCount,pn
pn=Request("pn")
if pn="" then pn=1
UrlClassCount = int(rs.recordcount)
redim UrlClassArray(UrlClassCount,4)
dim j,i
j=0
while not rs.eof and not rs.bof
   UrlClassArray(j,0)=rs("UrlClass_Id")
   UrlClassArray(j,1)=rs("UrlClass_Name")
   UrlClassArray(j,2)=Left(rs("UrlClass_Memo"),6)
   UrlClassArray(j,3)=rs("UrlClass_ClassId")
   UrlClassArray(j,4)=rs("UrlClass_SkinId")
   j=j+1
rs.movenext
wend
rs.close%>
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" class="tb tb2 fixpadding">
  <tr>
    <td class="vtop lineheight">ID</td>
    <td class="vtop lineheight">子分类名称</td>
    <td class="vtop lineheight">描术</td>
    <td class="vtop lineheight">主分类</td>
    <td class="vtop lineheight">样式</td>
    <td class="vtop lineheight">查看该分类下网址</td>
    <td class="vtop lineheight">编辑</td>
    <td class="vtop lineheight">删除</td>
  </tr>
<%dim UrlClassPageCount,UrlClassPageSize
UrlClassPageSize=15
UrlClassPageCount=int(UrlClassCount/UrlClassPageSize)+1
if pn=1 then 
  i=0
else
  i=UrlClassPageSize*pn-UrlClassPageSize
end if
for i=i to int(pn*UrlClassPageSize)-1
if i=UrlClassCount then exit for
%>
  <tr>
    <td class="vtop lineheight"><%=UrlClassArray(i,0)%></td>
    <td class="vtop lineheight" title="<%=UrlClassArray(i,1)%>"><%=Left(UrlClassArray(i,1),6)%></td>
    <td class="vtop lineheight"><%=UrlClassArray(i,2)%></td>
    <td class="vtop lineheight">
	<%rs.open"select Class_Id,Class_Name from Class where Class_Id="&UrlClassArray(i,3),conn,1,3
	  if not rs.eof and not bof then
	     response.write rs("Class_Name")
	  else
	     response.write "没有主分类"
	  end if
	rs.close
    %></td>
	<td class="vtop lineheight"><%=UrlClassArray(i,4)%></td>
	<td class="vtop lineheight"><a href="Admin_Url.asp?Url_UrlClassId=<%=UrlClassArray(i,0)%>"><font color="#669900">查看该分类下网址</font></a></td>
    <td class="vtop lineheight"><a href="#" onClick="javascript:DivOpenClose('Admin_UrlClassUp.asp?UrlClass_Id=<%=UrlClassArray(i,0)%>',1,450,350);return false">编辑</a></td>
    <td class="vtop lineheight"><a href="#" onClick="javascript:DivOpenClose('Admin_UrlClassDel.asp?UrlClass_Id=<%=UrlClassArray(i,0)%>',1,400,200);return false">删除</a></td>
  </tr>
<%
next%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div align="center"><a href="#" onClick="javascript:DivOpenClose('Admin_UrlClassAdd.asp?Class_Id=<%=Class_Id%>',1,450,350);return false"><font color="#669900">添加子分类</font></a> 
  <%if pn=1 then%>
<font color="#999999">首页</font> <font color="#999999">上一页</font> <a href='?Class_Id=<%=Class_Id%>&pn=2'>下一页</a> <a href='?Class_Id=<%=Class_Id%>&pn=<%=ClassPageCount%>'>未页</a>
<%else
   if ClassPageCount<>int(pn) then%>
      <a href='?pn=1'>首页</a> <a href='?Class_Id=<%=Class_Id%>&pn=<%=pn-1%>'>上一页</a> <a href='?Class_Id=<%=Class_Id%>&pn=<%=pn+1%>'>下一页</a> <a href='?<%=Class_Id%>&pn=<%=ClassPageCount%>'>未页</a>
     <%else%>
      <a href='?pn=1'>首页</a> <a href='?Class_Id=<%=Class_Id%>&pn=<%=ClassPageCount-1%>'>上一页</a> <font color="#999999">下一页</font> <font color="#999999">未页</font>
     <%end if
end if%>
每页<%=ClassPageSize%>条 当前第<%=pn%>页 共<%=ClassPageCount%>页
</div></td>
    <td><form name="GoFrom" method="post" action="?" id="GoFrom" onSubmit="return GoCheck();" style="margin-bottom:0px;"><input name="pn" type="text" value="<%=pn%>" size="3" style="color: #669900;    background-color: #FFFFFF; border: #006699; border-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px"><input name="submit" type="submit" value="跳到" style="color: #669900;    background-color: #FFFFFF; border: #006699; border-style: dashed; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px">
</form></td>
  </tr>
</table>

<div id="DivMenu" style="position:absolute; width:100%; height:100%; z-index:1; left: 0px; top: 0px; filter:Alpha(opacity=50); background-color: #E8E8E8; layer-background-color: #E8E8E8; border: 1px none #000000; visibility: hidden;"></div>
<div id="DivIframe" style="position:absolute; width:0px; height:0px; z-index:1; visibility: hidden; overflow: visible; filter:Alpha(opacity=80);"><iframe id=OpenIframe name=OpenIframe src=londing.html width=100% height=100% frameborder=0 scrolling=no>修改分类</iframe>
</div>
</BODY>
</HTML>

