<% userPageRights="{info}" %>
<!--#include file="check.asp"-->
<%
dim Action,BigClassName,rs,FoundErr,ErrMsg
Action=trim(Request("Action"))
BigClassName=trim(request("BigClassName"))
if Action="Add" then
	if BigClassName="" then
		FoundErr=True
		response.write"<SCRIPT language=JavaScript>alert('大类名不能为空！');"
        response.write"this.location.href='javascript:history.back();'</SCRIPT>"
        response.end 
	end if
	if FoundErr<>True then
		Set rs=Server.CreateObject("Adodb.RecordSet")
		rs.open "Select * From info_BigClass Where f_value='" & BigClassName & "'",conn,1,3
		if not (rs.bof and rs.EOF) then
			FoundErr=True
			
		response.write"<SCRIPT language=JavaScript>alert('此大类[" & BigClassName & "]已经存在！');"
        response.write"this.location.href='javascript:history.back();'</SCRIPT>"
        response.end 
		else
    	 	rs.addnew
     		rs("f_value")=BigClassName
    	 	rs.update
     		rs.Close
	     	set rs=Nothing
    	 	conn.close
			set conn=nothing
			Response.Redirect "admin_infoclass.asp"  
		end if
	end if
end if

%>
<script language="JavaScript" type="text/JavaScript">
function checkBig()
{
  if (document.form1.BigClassName.value=="")
  {
    alert("大类名称不能为空！");
    document.form1.BigClassName.focus();
    return false;
  }
}
</script>
<link href="Images/Style.css" rel="stylesheet" type="text/css">

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <br> <br>
      <strong>分类信息类别设置</strong> <br> <br> <br> <form name="form1" method="post" action="ClassAddBig.asp" onsubmit="return checkBig()">
        <table width="350" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
          <tr bgcolor="#f2f2f2" class="title"> 
            <td height="25" colspan="2" align="center"><strong>添加大类</strong></td>
          </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td width="126" height="22"> 
              <div align="right"><strong>大类名称：</strong></div></td>
            <td width="218"> 
              <input name="BigClassName" type="text" size="20" maxlength="30"> 
            </td>
          </tr>
          <tr bgcolor="f2f2f2" class="tdbg"> 
            <td height="22" align="center">&nbsp; </td>
            <td height="22" align="center"> 
              <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>

<%

conn.close
set conn=nothing
%>