<!--#include file="conn.asp"-->
<%
if session("adminname") = "" or session("adminpassword") = "" then
%>
<script>alert('你还没有登录呢');history.back();</script>
<%
else
action = request.querystring("action")
if action = "logout" then
session("adminname") = ""
session("adminpassword") = ""
conn.close
set conn = nothing
response.redirect "index.asp"
end if
 
         
          
          if action = "add" then
          name = request.form("name")
          password = request.form("password")
          repassword = request.form("repassword")
		  dengji=request("dengji")
          if name = "" or password = "" or repassword = "" then
          %>
          <script>alert('必填选项为空');history.back();</script>  
          <%  
          else  
          if not password = repassword then  
          %>  
          <script>alert('两次密码不同');history.back();</script>  
          <%  
          else  
          sql = "select * from admin where name='"&name&"'" 
		  set rs = server.createobject("adodb.recordset")  
          rs.open sql,conn,3,3 
		  if not rs.eof and rs.bof then 
		  %>  
          <script>alert('用户名重复！请选另外一个用户名！');history.back();</script>  
          <%  
		  else
		  rs.addnew
		  rs("dengji")=dengji
          rs("name") = name  
          rs("password") = password  
          rs.update  
          rs.close  
          set rs = nothing  
          session("adminname") = name  
          session("adminpassword") = password 
		  
          %>  
          <script>alert('用户添加成功');history.back();</script>  
          <% 
		  end if  
          end if  
          end if  
          end if  
          %>  
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" href="images/style2.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>jqdy.com</title>
</head>

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

<div align="center">
  <center>
  <table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF3300" 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="#FF3300" 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"><font color="#008000">管理首页</font></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"><font color="#008000">分类管理</font></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"><font color="#008000">电影管理</font></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"><font color="#008000">电视管理</font></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"><font color="#008000">公告管理</font></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"><font color="#008000">用户管理</font></td>
                    </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"><font color="#008000">会员管理</font></td>
                    </a>
                   <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"><font color="#008000">退出管理</font></td>
                    </a> </tr>
                </table><br><br>
          </td></tr><tr>
              <td width="75%" align="center" valign="top"> 
                <%
          if action = "" then
          %>
                欢迎来到激情电影网系统管理后台<br><br> 
                <br><br><br><br><br>
                
                <br> 
                <%
          end if
          if action = "password" then
		  %>
		  <table width="98%" height="21" border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#FF3300" style="border-collapse: collapse">
                  <tr> 
                    <td width="12%" background="images/12.gif" align="center"><p style="margin-top: 2">ID</td>
                    <td width="24%" background="images/12.gif" align="center">帐 
                      号</td>
                    <td width="24%" background="images/12.gif" align="center">密 
                      码</td>
                    <td width="19%" background="images/12.gif" align="center">修 
                      改</td>
                    <td width="21%" background="images/12.gif" align="center">删 
                      除</td>
                  </tr>
                  <%
         sql = "select * from admin  "
		 
          set rs = server.createobject("adodb.recordset")
          rs.open sql,conn,3,3
		  if not rs.eof and rs.bof then
          %>
                  <tr> 
                   <form action="muser.asp?id=<%=rs("id")%>" name="password&<%=rs("id")%>"> 
                      <td width="12%" bgcolor="#FBFBFB">
                        <%=rs("id")%>
                      </td>
                      <td width="24%" bgcolor="#FBFBFB"><input name="name" type="text" id="name" style="width: 150; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" value="<%=rs("name")%>" size="10"></td>
                    <td width="24%" bgcolor="#FBFBFB"><input name="password" type="password" id="password" style="width: 150; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" value="<%=rs("password")%>" size="10"></td>
                      <td width="19%" align="center" bgcolor="#FBFBFB"><a href="javascript:document.password.submit()"><img border="0" src="images/20.gif" alt="修改"></a></td>
                      <td width="21%" align="center" bgcolor="#FBFBFB"><a href="javascript:document.password1.reset()"><img border="0" src="images/17.gif" alt="重置"></a></td>
					</form>
                  </tr>
                  <%
       else
          %>
                  <tr> 
                    <td colspan="5" bgcolor="#FBFBFB">暂时没有可管理的用户！</td>
                  </tr>
                  <% 
				   rs.close
          set rs = nothing
				  
				  end if %>
                </table>
		  
		  
		  
<%		  
		  
		  
		  
          sql = "select * from admin where name='"&session("adminname")&"'"
          set rs = server.createobject("adodb.recordset")
          rs.open sql,conn,3,3
          %>    
                <table border="1" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF3300" width="300" height="21">
              <tr>
                <td width="100%" background="images/12.gif" align="center"><p style="margin-top: 2">修 改 密 码</td>
              </tr>
              <tr>
                <td width="100%" bgcolor="#FBFBFB">
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
                <form method="post" action="admincenter.asp?action=modify" name="password">
                  <tr>
                    <td width="25%" align="center"><p style="margin-top: 2">账号:</td>
                    <td width="75%" align="center">
                    <input type="text" size="20" name="name" style="width: 200; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" value="<%=rs("name")%>"></td>
                  </tr>
                  <tr>
                    <td width="25%" align="center"><p style="margin-top: 2">密码:</td>
                    <td width="75%" align="center">
                    <input type="password" size="20" name="password" style="width: 200; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" value="<%=rs("password")%>"></td>
                  </tr>
                  <tr>
                    <td width="25%" align="center"><p style="margin-top: 2">确认:</td>
                    <td width="75%" align="center">
                    <input type="password" size="20" name="repassword" style="width: 200; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" value="<%=rs("password")%>"></td>
                  </tr>
                  <tr>
                    <td width="100%" align="center" colspan="2">
                    <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
                      <tr>
                        <td width="50%" align="center">
                            <a href="javascript:document.password.submit()">
                        <img border="0" src="images/20.gif" alt="修改"></a></td>
                        <td width="50%" align="center">
                            <a href="javascript:document.password.reset()">
                            <img border="0" src="images/17.gif" alt="重置"></a></td>
                      </tr>
                    </table>
                    </td>
                  </tr>
                </form>
                </table>
                </td>
              </tr>
            </table>
                <br>
				<%if session("dengji")=1 then%>
                <table border="1" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF3300" width="300" height="21">
                  <tr> 
                    <td width="100%" background="images/12.gif" align="center"><p style="margin-top: 2">添加管理员</td>
                  </tr>
                  <tr> 
                    <td width="100%" bgcolor="#FBFBFB"> 
					<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
                        <form method="post" action="admincenter.asp?action=add" name="password1">
                          <tr> 
                            <td width="25%" align="center"><p style="margin-top: 2">账号:</td>
                            <td width="75%" align="center"> <input name="name" type="text" id="name" style="width: 200; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" size="20"></td>
                          </tr>
                          <tr> 
                            <td width="25%" align="center"><p style="margin-top: 2">密码:</td>
                            <td width="75%" align="center"> <input name="password" type="password" id="password" style="width: 200; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" size="20"></td>
                          </tr>
                          <tr> 
                            <td width="25%" align="center"><p style="margin-top: 2">确认:</td>
                            <td width="75%" align="center"> <input name="repassword" type="password" id="repassword" style="width: 200; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'" size="20"></td>
                          </tr>
						    <tr> 
                            <td width="25%" align="center"><p style="margin-top: 2">等级:</td>
                            <td width="75%" align="center">超级管理员： 
                              <input type="radio" name="dengji" value="1">
                              一般管理员
                              <input name="dengji" type="radio" value="2" checked> 
                            </td>
                          </tr>
						  
                          <tr> 
                            <td width="100%" align="center" colspan="2"> <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
                                <tr> 
                                  <td width="50%" align="center"> <a href="javascript:document.password1.submit()"> 
                                    <img border="0" src="images/20.gif" alt="修改"></a></td>
                                  <td width="50%" align="center"> <a href="javascript:document.password1.reset()"> 
                                    <img border="0" src="images/17.gif" alt="重置"></a></td>
                                </tr>
                              </table></td>
                          </tr>
                        </form>
                      </table></td>
                  </tr>
                </table> 
                <%end if%>
                <br>
                <br>
          <%
          rs.close
          set rs = nothing
          end if
          if action = "modify" then
           
          password = request.form("password")
          repassword = request.form("repassword")
          if name = "" or password = "" or repassword = "" then
          %>
          <script>alert('必填选项为空');history.back();</script>  
          <%  
          else  
          if not password = repassword then  
          %>  
          <script>alert('两次密码不同');history.back();</script>  
          <%  
          else  
          sql = "select * from admin   "  
          set rs = server.createobject("adodb.recordset")  
          rs.open sql,conn,3,3
		  if not rs.eof and rs.bof then  
          rs("name") = name  
          rs("password") = password  
          rs.update  
          rs.close  
          set rs = nothing  
          session("adminname") = name  
          session("adminpassword") = password  
          %>  
          <script>alert('用户管理成功');history.back();</script>  
          <%  
		  else
		   %>  
          <script>alert('找不到用户！');history.back();</script>  
          <%  
		  end if
          end if  
          end if  
          end if  
          %>  
          </td>  
        </tr>  
      </table>  
      </td>  
    </tr>  
  </table>  
  </center>  
</div>  
  
</body>  
  
</html>  


 




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