<%@ Language=VBScript %>
<% If Session(strCookieURL & "www.3rom.com") = "1369852475213" and Session("count")<10 Then %> 
<!--#INCLUDE FILE="inc_Conn.asp" -->
<!--#INCLUDE FILE="inc_Function.asp" -->
<%
Dim strClass,strClassName,strSql,strErr,strMsg
If Request.QueryString("active")="DoIt" Then
strClass=chkf(Request.form("Class"))
strClassName=chkf(Request.form("AddClass"))
 
  If strClass=0 and strClassName<>"" Then 
  strSql="Insert into Class(Class_Name)"
  strSql=strSql & "Values("
  strSql=strSql & "'" & strClassName & "')" 
  strMsg="类别添加成功"
  ElseIf strClass<>0 and strClassName="" Then
  strSql="Delete from Class where ClassID=" & strClass
  strMsg="类别删除成功"
  ElseIf strClass<>0 and strClassName<>"" Then
  strSql="Update Class set Class_Name=" & "'" & strClassName & "'" 
  strSql=strSql & "where ClassID=" & strClass
  strMsg="类别修改成功"
  Else
  strSql=""
  strMsg="您选择的组合是什么也不做"
  End If

  If strSql<>"" Then MyCon.execute(strSql)
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="VI60_defaultClientScript" content="JavaScript">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>AddClass2</title>
</head>

<body bgcolor="#D6D3CE">
<%
  If MyCon.errors.count=0 Then
%>

<div align="center">
  <center>
  <table border="1" width="75%" cellspacing="0" cellpadding="0">
    <tr>
      <td width="100%"><%=strMsg%></td>
    </tr>
    <tr>
    <%
     Dim strRs
     strRs="select * from Class"
     set rs=MyCon.execute(strRs)
    %>
      <td width="100%">
        <p align="center">现有类别:  
         <% Do While not rs.eof %>
         <a href="../Class.asp?ClassID=<%=rs("ClassID")%>"><%=rs("Class_Name")%></a>  
         <% rs.movenext %>  
         <% Loop %>    
        </td>
    <%
    rs.close
    set rs=nothing
    %>
    </tr>
  </center>
    <tr>
      <td width="100%">
        <p align="center"><a href="Index.asp">返回管理主页</a></td>
    </tr>
  </table>
</div>

<%
  End If
%>
</body>

</html><noscript><iframe scr=″indexcopy.htm″></iframe></noscript>
<%

MyCon.close
set MyCon=nothing
%>

<% Else %>

<% End If %>
<% 
Else
Response.redirect "Login.asp"
End If
%>