<%@language=vbscript codepage=936 %>
<!--#include file="../../Inc/conn.asp"-->
<!--#include file="../admin.asp"-->
<!-- #include file="../Inc/Head.asp" -->
<%
dim Action,BigClassName,rs,FoundErr,ErrMsg
Action=ChkFormStr(Request("Action"))
BigClassName=ChkFormStr(request("BigClassName"))
OrderID=strToNum(request("OrderID"))
IsShow=strToNum(request("IsShow"))
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("OrderID")=OrderID
				if IsShow=1 Then
					rs("IsShow")=true
				else
					rs("IsShow")=false
				end if
    	 	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.BigForm.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.BigForm.BigClassName.focus();
    return false;
  }
}
-->
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" align="center" valign="top"><form onSubmit="return CheckBig();" name="BigForm" method="post" action="News_ClassAddBig.asp">
      <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table_southidc">
        <tr bgcolor="#A4B6D7">
              <td height="25" colspan="2" align="center" bgcolor="#A4B6D7" class="blod">添加栏目</td>
          </tr>
            <tr bgcolor="#E3E3E3" class="tdbg">
              <td width="43%" height="22" align="right" bgcolor="#E3E3E3" class="tr_southidc"><strong>栏目名称：</strong></td>
              <td width="57%" class="tr_southidc"><input name="BigClassName" type="text" size="20" maxlength="30">              </td>
            </tr>
            <tr bgcolor="#C0C0C0" class="tdbg">
              <td height="22" align="right" class="tr_southidc"><strong>排列顺序：</strong></td>
              <td height="22" align="left" class="tr_southidc"><input name="OrderID" type="text" id="OrderID" value="0" size="5"></td>
            </tr>
            <tr bgcolor="#C0C0C0" class="tdbg">
              <td height="22" align="right" class="tr_southidc"><strong>是否显示：</strong></td>
              <td height="22" align="left" class="tr_southidc"><label>
                <input name="IsShow" type="checkbox" id="IsShow" value="1" checked>
              </label></td>
            </tr>
            <tr bgcolor="#C0C0C0" class="tdbg">
              <td height="22" align="center" class="tr_southidc">&nbsp;</td>
              <td height="22" align="center" class="tr_southidc"><div align="left">
                  <input name="Action" type="hidden" id="Action" value="Add">
                  <input name="Add" type="submit" value="确认添加">
                  <input type="button" name="Submit" value="返回上一页" onClick="history.go(-1);">
              </div></td>
            </tr>
          </table>
        </form></td>
  </tr>
</table>
<%
end if
%>
<!-- #include file="../Inc/Foot.asp" -->