<!--#include file="adminconn.asp"-->
<%
  if session("aleave")="" then
      response.redirect "admin_login.asp"
	  response.end
  end if
%>
<%
dim sql,rsyikind,rsSmallClass,ErrMsg
set rsyikind=server.CreateObject("adodb.recordset")
rsyikind.open "Select * From yikind",conn,1,3
%>
<script language="JavaScript" type="text/JavaScript">
function checkBig()
{
  if (document.form1.yikindName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.yikindName.focus();
    return false;
  }
}
function checkSmall()
{
  if (document.form2.yikindName.value=="")
  {
    alert("请先添加大类名称！");
	document.form1.yikindName.focus();
	return false;
  }

  if (document.form2.SmallClassName.value=="")
  {
    alert("小类名称不能为空！");
	document.form2.SmallClassName.focus();
	return false;
  }
}
function ConfirmDelBig()
{
   if(confirm("确定要删除此大类吗？删除此大类同时将删除所包含的小类和该类下的所有新闻，并且不能恢复！"))
     return true;
   else
     return false;
	 
}

function ConfirmDelSmall()
{
   if(confirm("确定要删除此小类吗？删除此小类同时将删除该类下的所有新闻，并且不能恢复！"))
     return true;
   else
     return false;
	 
}
</script>
<LINK href="../css.css" type=text/css rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"><br>
      <a href="ClassAddBig.asp"><strong><font color="#FF0000"><u>添加新闻一级分类</u></font></strong></a><br>
      <br> 
      <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
        <tr> 
          <td height="30" align="center" bgcolor="#0F7CA6"><span class="style1">栏目名称</span></td>
          <td height="30" align="center" bgcolor="#0F7CA6" class="style1">栏目编号</td>
          <td width="483" height="30" align="center" bgcolor="#0F7CA6"><span class="style1">操作选项</span></td>
        </tr>
        <%
	do while not rsyikind.eof
%>
        <tr bgcolor="#E3E3E3" class="tdbg"> 
          <td width="348" height="22" bgcolor="#D1DFFE"><img src="../img/+.gif" width="15" height="15"><%=rsyikind("ername")%></td>
          <td width="134" bgcolor="#D1DFFE">&nbsp;</td>
          <td align="right" bgcolor="#D1DFFE" style="padding-right:10"><a href="ClassAddSmall.asp?ername=<%=rsyikind("ername")%>"><font color="#FF0000">添加二级分类</font></a> 
            | <a href="ClassModifyBig.asp?yikindID=<%=rsyikind("yikindID")%>">修改</a> 
            | <a href="ClassDelBig.asp?yikindName=<%=rsyikind("yikindName")%>" onClick="return ConfirmDelBig();">删除</a></td>
        </tr>
        <%
	  set rsSmallClass=server.CreateObject("adodb.recordset")
	  rsSmallClass.open "Select * From SmallClass Where yikindName='" & rsyikind("yikindName") & "'",conn,1,1
	  if not(rsSmallClass.bof and rsSmallClass.eof) then
		do while not rsSmallClass.eof
	%>
        <tr bgcolor="#FFFFFF" class="tdbg"> 
          <td width="348" height="22">&nbsp;&nbsp;<img src="../img/-.gif" width="15" height="15"><%=rsSmallClass("SmallClassName")%></td>
          <td width="134" height="22">&nbsp;</td>
          <td align="right" style="padding-right:10"><a href="ClassModifySmall.asp?SmallClassID=<%=rsSmallClass("SmallClassID")%>">修改</a> 
            | <a href="ClassDelSmall.asp?SmallClassID=<%=rsSmallClass("SmallClassID")%>&SmallClassName=<%=rsSmallClass("SmallClassName")%>" onClick="return ConfirmDelSmall();">删除</a></td>
        </tr>
        <%
			rsSmallClass.movenext
		loop
	  end if
	  rsSmallClass.close
	  set rsSmallClass=nothing	
	  rsyikind.movenext
	loop
%>
      </table>
      <br>
    </td>
  </tr>
</table>
<%
rsyikind.close
set rsyikind=nothing
%>
