<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include.jsp"%>
<%
String userName = (String) session.getAttribute("username");
if (!userName.equals("admin")){ 
	response.sendRedirect("error1.jsp");
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<meta http-equiv="refresh" content="60*30">
<title>欢迎光临<%=title%></title>
<link rel="stylesheet" href="../css/css.css" type="text/css" media="screen">
</head>
<body>
<TABLE bgColor=<%=tablebgcolor%> border=0 cellPadding=0 cellSpacing=1 width=100% align=CENTER>
	<TR><TD align=middle background=../img/index/topback.gif height=10>
	</TD></TR>
</TABLE>
<TABLE align=center border=0 cellPadding=6 cellSpacing=1 width=100% bgColor=<%=tablebgcolor%>>
	<TBODY>
	<TR>
		<TD bgColor=<%=tdbgcolor2%> colspan=3 align=center><FONT SIZE="3" COLOR="#ffffff"><B>栏目管理</B></FONT></TD>
	</TR>
	<TR>
		<TD bgColor=<%=tdbgcolor2%> colspan=3><A HREF="addclass.jsp">添加栏目</A>
		&nbsp;&nbsp;<A HREF="mastermanage.jsp">管理员管理</A>
		&nbsp;&nbsp;<A HREF="logout.jsp">退出</A>
		&nbsp;&nbsp;<A HREF="javascript:this.location.reload()">刷新</A>
		&nbsp;&nbsp;<A HREF="main.jsp">后台管理主页</A>
		&nbsp;&nbsp;<A HREF="../index.jsp">主页</A></TD>
	</TR>
	<TR>
		<TD bgColor=<%=tdbgcolor2%> colspan=2 width=70%>
		
		</TD>
		<TD align=center bgColor=<%=tdbgcolor2%> width=30%>
		<%CategoryMgr categoryMgr=new CategoryMgr();%>&nbsp;&nbsp;共有<FONT COLOR="red"><%=categoryMgr.getTotal()%></FONT>个栏目
		</TD>
	</TR>
	<TR align=center>
		<TD bgColor=<%=tdbgcolor4%> width=12%>栏目编号</TD>
		<TD bgColor=<%=tdbgcolor4%> width=64%>栏目名称</TD>
		<TD bgColor=<%=tdbgcolor4%> width=24%>操作</TD>
	</TR>

	<%	Collection c = categoryMgr.getAll();
	Iterator iterator = c.iterator();
	while (iterator.hasNext()) {
		Category category = (Category) iterator.next();
%>
	<TR>
		<TD bgColor=<%=tdbgcolor4%>><%=category.getId()%></TD>
		<TD bgColor=<%=tdbgcolor4%>><A HREF="editclass.jsp?id=<%=category.getId()%>"><%=category.getName()%></A></TD>
		<TD bgColor=<%=tdbgcolor4%> align=center><A HREF="editclass.jsp?id=<%=category.getId()%>">编辑栏目</A>
		&nbsp;<A HREF="delclass.jsp?id=<%=category.getId()%>">删除栏目</A></TD>
	</TR>
	<%}%>
	</TBODY>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" align=center>
	<TR bgColor=<%=trbgcolor2%>>
	<TD align=middle background=../img/index/botback.gif vAlign=bottom width="100%">
	<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" align=center>
	<TR>
	<TD width=1><IMG border=0 height=17 hspace=0 src="../img/index/left.gif" width=14></TD>
    <TD align=middle width="100%"></TD>
    <TD align=right width=1><IMG border=0 height=17 hspace=0 src="../img/index/right.gif"  width=14></TD>
	</TR>
	</TABLE>
	</TD>
	</TR>
</TABLE>
<%@ include file="foot.jsp"%>