<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=1
%>
<!--#include file="flag.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	dim action,admin,adminid
	action=Trim(Request.QueryString("action"))
	adminid=Trim(Request.QueryString("id"))
	admin=Trim(Request.Form("admin"))
	select case action
	'//修改数据
	case "edit"
		set rs=server.CreateObject("adodb.recordset")
		rs.Open "select * from admin where adminid="&adminid,conn,2,3
		rs("admin")=admin
		if Trim(Request.Form("password"))<>"" then
			rs("password")=md5(Trim(Request.Form("password")))
		end if
		rs("flag")=int(Trim(Request.Form("flag")))
		rs("locked")=int(Trim(Request.Form("locked")))
		rs.Update
		rs.Close
		set rs=nothing
		response.Write "<script language=javascript>alert('管理员修改成功！');window.location.reload('manageadmin.asp')</script>"
		response.End
	'//添加新数据
	case "add"
		set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from admin",conn,2,3
		rs.addnew
		rs("admin")=trim(Trim(Request.Form("admin2")))
		rs("password")=md5(Trim(Request.Form("password2")))
		rs("flag")=int(Trim(Request.Form("flag2")))
		rs.update
		rs.close
		set rs=nothing
		response.Write "<script language=javascript>alert('管理员添加成功！');window.location.reload('manageadmin.asp')</script>"
		response.End
	'//删除数据
	case "del"
		conn.execute ("delete from admin where adminid="&Trim(Request.QueryString("id")))
		response.Redirect "manageadmin.asp"
	end select
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="Include/Admin_Style.css" type=text/css rel=stylesheet>
</head>
<body>
<table width="100%" border="1" align="center" cellpadding="5" cellspacing="1" class="sortbutton">
  <tr> 
    <td height="16" align="center"><font color="#000000"><b>后台用户管理</b></font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
        <tr> 
          <td width="9%" align="center">管理员</td>
          <td width="9%" align="center">密 码</td>
          <td width="29%" align="center">权 限</td>
          <td width="8%" align="center">登陆次数</td>
          <td width="15%" align="center">最后登陆时间</td>
          <td width="13%" align="center">登陆IP</td>
          <td width="6%" align="center">是否锁定</td>
          <td width="11%" align="center">操 作</td>
        </tr>
<%
	set rs=server.CreateObject("adodb.recordset")
	rs.Open "select * from admin order by adminid desc",conn,1,1
	do while not rs.EOF
%>
        <form name="form1" method="post" action="?action=edit&id=<%=int(rs("adminid"))%>">
          <tr> 
            <td bgcolor="#FFFFFF"><input name="admin" type="text" size="8" value="<%=trim(rs("admin"))%>"></td>
            <td bgcolor="#FFFFFF"><input name="password" type="text" size="8"></td>
            <td align="center" bgcolor="#FFFFFF">
<%
select case rs("flag")
case "1"
	response.Write "<input type='radio' name='flag' value='1' checked>超管<input name='flag' type='radio' value='2'>帐户<input type='radio' name='flag' value='3'>帐号<input type='radio' name='flag' value='4'>新闻<input type='radio' name='flag' value='5'>广告"
case "2"
	response.Write "<input type='radio' name='flag' value='1'>超管<input name='flag' type='radio' value='2' checked>帐户<input type='radio' name='flag' value='3'>帐号<input type='radio' name='flag' value='4'>新闻<input type='radio' name='flag' value='5'>广告"
case "3"
	response.Write "<input type='radio' name='flag' value='1'>超管<input name='flag' type='radio' value='2'>帐户<input type='radio' name='flag' value='3' checked>帐号<input type='radio' name='flag' value='4'>新闻<input type='radio' name='flag' value='5'>广告"
case "4"
	response.Write "<input type='radio' name='flag' value='1'>超管<input name='flag' type='radio' value='2'>帐户<input type='radio' name='flag' value='3'>帐号<input type='radio' name='flag' value='4' checked>新闻<input type='radio' name='flag' value='5'>广告"
case "5"
	response.Write "<input type='radio' name='flag' value='1'>超管<input name='flag' type='radio' value='2'>帐户<input type='radio' name='flag' value='3'>帐号<input type='radio' name='flag' value='4'>新闻<input type='radio' name='flag' value='5' checked>广告"
end select
%></td>
            <td align="center" bgcolor="#FFFFFF"><%=trim(rs("num"))%></td>
            <td align="center" bgcolor="#FFFFFF"><%=trim(rs("lasttime"))%></td>
            <td align="center" bgcolor="#FFFFFF"><%=trim(rs("lastloginip"))%></td>
            <td align="center" bgcolor="#FFFFFF">
			<select name="locked">
			<option value="0" <% if rs("locked")=0 then Response.Write("selected") %>>正常</option>
			<option value="1" <% if rs("locked")=1 then Response.Write("selected") %>>锁定</option>
			</select></td>
            <td bgcolor="#FFFFFF" align="center"><input type="submit" name="Submit" value="修 改">&nbsp;<a href="?id=<%=int(rs("adminid"))%>&action=del" onClick="return confirm('您确定要删除此用户吗？')"><font color=red>删除</font></a></td>
          </tr>
        </form>
<%
	rs.movenext
	loop
	rs.close
	set rs=nothing
%>
      </table>
    </td>
  </tr>
</table>
<br>
<table width="100%" border="1" align="center" cellpadding="5" cellspacing="1" class="sortbutton">
  <tr> 
    <td height="16" align="center"><font color="#FFFFFF"><b><font color="#000000">后台用户添加</font></b></font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> 
      <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
        <tr> 
          <td width="18%" align="center">管理员</td>
          <td width="19%" align="center">密 码</td>
          <td width="44%" align="center">权 限</td>
          <td width="19%" align="center">操 作</td>
        </tr>
        <form name="form1" method="post" action="?action=add">
          <tr> 
            <td bgcolor="#FFFFFF" align="center"><input name="admin2" type="text" size="12"></td>
            <td bgcolor="#FFFFFF" align="center"><input name="password2" type="text" size="12"></td>
            <td bgcolor="#FFFFFF" align="center"><input type="radio" name="flag2" value="1">超管<input name="flag2" type="radio" value="2" checked>帐户<input type="radio" name="flag2" value="3">帐号<input name="flag2" type="radio" value="4">新闻<input type="radio" name="flag2" value="5">广告</td><td bgcolor="#FFFFFF" align="center"><input type="submit" name="Submit2" value="添 加"></td>
          </tr>
        </form>
      </table>
    </td>
  </tr>
</table>
<br>
<table width="100%" border="1" align="center" cellpadding="5" cellspacing="1" class="sortbutton">
  <tr>
    <td align="center"><font color="#000000">操作注意事项及说明</font></td>
  </tr>
  <tr>
    <td height="38" bgcolor="#FFFFFF">
	<table width="80%" border="0" align="center" cellpadding="5" cellspacing="0">
      <tr>
        <td height="48"><p><font color="#FF0000">·后台管理用户与前台用户毫无牵连。<br><br>
              ·<b><font color="#000000">注意：被锁定的用户无法再正常登陆后台，直到被解锁为止。</font></b> <br><br>
          ·超级管理员拥有本站所有管理权限。</font><font color="#FF0000"><br><br>
            ·帐户管理员仅拥有对本站会员的帐户信息,本站的计费标准,系统群发短信的设置权限。</font><font color="#FF0000"><br><br>
              ·帐号管理员仅拥有对本站会员信息,招聘信息状态,系统群发短信的设置权限。<br><br>
            ·新闻管理员拥有对站点新闻,公告,猎头信息与委托招聘信息的发布与维护，系统群发短信的管理权限。<br><br>
              ·广告管理员拥有对本站的广告系统,站点友情链接,系统群发短信的权限。<br><br>
              ·登陆密码采用MD5不可逆转方式加密，如不修改密码，请留空。</font></p></td>
      </tr>
    </table>
	</td>
  </tr>
</table>
</body>
</html>
