
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!-- #include file="Inc/Head.asp" -->
<html>
<link href="../images/css.css" rel="stylesheet" type="text/css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<body topmargin="0" leftmargin="0" rightmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="52"><img src="images/main_1.jpg" width="52" height="55"></td>
        <td background="images/main_2.jpg" class="title1">新闻类别设置</td>
        <td width="52"><img src="images/main_3.jpg" width="52" height="55"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" background="images/main_4.gif">&nbsp;</td>
        <td class="td">
 
<%
dim Action,BigClassName,rs,FoundErr,ErrMsg
Action=trim(Request("Action"))
BigClassName=trim(request("BigClassName"))
if Action="Add" then
	if BigClassName="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>文章大类名不能为空！</li>"
	end if
	if FoundErr<>True then
		Set rs=Server.CreateObject("Adodb.RecordSet")
		rs.open "Select * From BigClass_New Where BigClassName='" & BigClassName & "'",conn,1,3
		if not (rs.bof and rs.EOF) then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>文章大类“" & BigClassName & "”已经存在！</li>"
		else
    	 	rs.addnew
     		rs("BigClassName")=BigClassName
    	 	rs.update
     		rs.Close
	     	set rs=Nothing
    	 	call CloseConn()
			Response.Redirect "News_ClassManage.asp"  
		end if
	end if
end if
if FoundErr=True then
	call WriteErrMsg()
else
%>
<script language="JavaScript" type="text/JavaScript">
function checkBig()
{
  if (document.form1.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.BigClassName.focus();
    return false;
  }
}
</script>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="25" align="center" valign="top"><form name="form1" method="post" action="News_ClassAddBig.asp" onSubmit="return checkBig()">
              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
                <tr bgcolor="#A4B6D7" class="title"> 
                  <td height="25" colspan="2" align="center"><strong>添加大类</strong></td>
                </tr>
                <tr bgcolor="#E3E3E3" class="tdbg"> 
                  <td width="126" height="22" bgcolor="#E3E3E3"> <div align="right"><strong>大类名称：</strong></div></td>
                  <td width="218" bgcolor="#E3E3E3"> <input name="BigClassName" type="text" size="20" maxlength="30"> 
                  </td>
                </tr>
                <tr bgcolor="#C0C0C0" class="tdbg"> 
                  <td height="22" align="center" bgcolor="#E3E3E3">&nbsp; </td>
                  <td height="22" align="center" bgcolor="#E3E3E3"> <div align="left"> 
                      <input name="Action" type="hidden" id="Action" value="Add">
                      <input name="Add" type="submit" value=" 添 加 ">
                    </div></td>
                </tr>
              </table>
            </form></td>
        </tr>
      </table>
      <%
end if
%> </td>
  </tr>
</table>

  <!--#include file="foot.asp"--></td>
        <td width="15" background="images/main_5.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" background="images/main_4.gif">&nbsp;</td>
        <td background="images/main_9.gif">&nbsp;</td>
        <td width="15" background="images/main_5.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="52"><img src="images/main_6.gif" width="52" height="16"></td>
        <td background="images/main_7.gif" width="100%"></td>
        <td width="52"><img src="images/main_8.gif" width="52" height="16"></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
