<!--#include file="conn.asp"-->
<%
if session("adminname") = "" or session("adminpassword") = "" then
%>
<script>alert('你没有登陆');history.back();</script>
<%
else
action = request.querystring("action")
%>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" href="images/style2.css">
<meta http-equiv="Content-category" content="text/html; charset=gb2312">
<title>激情电影网管理后台</title>
</head>

<body bgcolor="#DDDDDD" background="images/15.gif" topmargin="5" leftmargin="5">

<div align="center">
  <center>
  <table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#006D91" width="650">
    <tr>
      <td width="100%" bgcolor="#FFFFFF">
      <table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" >
        <tr>
          <td width="99%" valign="top">
          <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#006D91" width="100%">
                  <tr> <a href="admincenter.asp">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">管理首页</td>
                    </a>
                   <a href="classmanage.asp?action=class">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">分类管理</td>
                    </a> 
                  <a href="moviemanage.asp?action=movie">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">电影管理</td>
                    </a> 
                  <a href="tvmanage.asp?action=tv">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">电视管理</td>
                    </a> 
                  <a href="manage.asp?action=manage">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">公告管理</td>
                    </a> 
                  <a href="admincenter.asp?action=password">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">修改密码</td>
                    </a> 
                    </a> 
                  <a href="users.asp?action=user">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">会员管理</td>
                   <a href="admincenter.asp?action=logout">
                    <td width="12%" align="center" bgcolor="#EFEFEF" onmouseover="this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.backgroundColor='#EFEFEF'"><p style="margin-top: 2">退出管理</td>
                    </a> </tr>
                </table><br><br><center>
          <%
          if action = "modifycategory" then
          categoryid = request.querystring("categoryid")
          categoryname = request.querystring("categoryname")
          %>
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="300">
          <form method="post" action="classmanage.asp?action=categorymodify" name="categorymodify"><input type="hidden" name="categoryid" value="<%=categoryid%>">
            <tr>
              <td width="100" align="center"><p style="margin-top: 2">修改成为</td>
              <td width="100" align="center">
              <input category="text" size="20" name="name" style="width: 100; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" value="<%=categoryname%>"></td>
              <td width="100" align="center">
                  <a href="javascript:document.categorymodify.submit()">
              <img border="0" src="images/20.gif"></a></td>
            </tr>
            </form>
          </table>
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="3">
            <tr>
              <td width="100%"></td>
            </tr>
          </table>
          <%
          end if
          if action = "class" then
          %>
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="300">
          <form method="post" action="classmanage.asp?action=addcategory" name="addcategory">
            <tr>
              <td width="100" align="center"><p style="margin-top: 2">添加影片分类</td>
              <td width="100" align="center">
              <input category="text" size="20" name="name" style="width: 100; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'"></td>
              <td width="100" align="center">
                  <a href="javascript:document.addcategory.submit()">
              <img border="0" src="images/20.gif" alt="添加"></a></td>
            </tr>
          </form>
          </table>
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="3">
            <tr>
              <td width="100%"></td>
            </tr>
          </table>
          
          <%
          categorysql = "select * from [category]"
          set categoryrs = server.createobject("adodb.recordset")
          categoryrs.open categorysql,conn,1,1
          if categoryrs.eof or categoryrs.bof then
          categoryrs.close
          set categoryrs = nothing
          %>
          <p style="margin-top: 2">没有找到分类信息
          <%
          else
          %>
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="3">
            <tr>
              <td width="100%"></td>
            </tr>
          </table>
          <%
          do while not categoryrs.eof or categoryrs.bof
          %>
          <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#006D91" width="100%">
            <tr>
              <td width="80%" bgcolor="#5BBFFF"><p style="margin-top: 2">&nbsp;<img border="0" src="images/02.gif">&nbsp;<%=categoryrs("category")%></td>
              <td width="20%" bgcolor="#FBFBFB" align="center"><p style="margin-top: 2"><a href="classmanage.asp?action=modifycategory&categoryid=<%=categoryrs("id")%>&categoryname=<%=categoryrs("category")%>">修改</a>　<a href="classmanage.asp?action=delcategory&categoryid=<%=categoryrs("id")%>">删除</a></td>
            </tr>
          </table>
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="3">
            <tr>
              <td width="100%"></td>
            </tr>
          </table>

          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="3">
            <tr>
              <td width="100%"></td>
            </tr>
          </table>
          <%
          categoryrs.movenext
          loop
          categoryrs.close
          set categoryrs = nothing
          end if
          end if
          if action = "delcategory" then
          categoryid = request.querystring("categoryid")
          sql = "select * from [category] where id=" & categoryid
          set rs = server.createobject("adodb.recordset")
          rs.open sql,conn,3,3
          if rs.eof or rs.bof then
          rs.close
          set rs = nothing
          %>
          <script>alert('没有找到该分类');history.back();</script>
          <%
          else
          rs.delete
          rs.close
          set rs = nothing
          %>
          <script>alert('删除成功 请刷新页面');history.back();</script>
          <%
          end if
          end if
          if action = "addcategory" then
          category = request.form("name")
          sql = "select * from [category]"
          set rs = server.createobject("adodb.recordset")
          rs.open sql,conn,3,3
          rs.addnew
          rs("category") = category
          rs.update
          rs.close
          set rs = nothing
          %>
          <script>alert('添加成功 请刷新页面');history.back();</script>
          <%
          end if
          if action = "categorymodify" then
          categoryid = request.form("categoryid")
          categoryname = request.form("name")
          sql = "select * from [category] where id=" & categoryid
          set rs = server.createobject("adodb.recordset")
          rs.open sql,conn,3,3
          if rs.eof or rs.bof then
          rs.close
          set rs = nothing
          %>
          <script>alert('没有找到该分类');history.back();</script>
          <%
          else
          rs("category") = categoryname
          rs.update
          rs.close
          set rs = nothing
          %>
          <script>alert('修改成功 请刷新页面');history.go(-2);</script>
          <%
          end if
          end if
          %>
          </td>
        </tr>
      </table>
      </td>
    </tr>
  </table>
  </center>
</div>

</body>

</html>
<%
end if
conn.close
set conn = nothing
%>