?? adminuser.asp
字號:
<!--#include file="adminsession.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<%action=request("action")%>
<html>
<head>
<title></title>
<link href="css.css" rel="stylesheet" type="text/css">
<script language=javascript>
function check1()
{
if(document.form3.password.value=="" || document.form3.password2.value=="")
{
alert("密碼不能為空!");
return false;
}
if(document.form3.password.value!=document.form3.password2.value)
{
alert("兩次輸入的密碼不相同!");
return false;
}
}
</script>
</head>
<body>
<table width="100%" height="100%" border="0" align="center" bgcolor="<%=tdbgcolor%>">
<tr>
<td width="780">
<%if action="add" then%>
<table width="530" border="0" align="center">
<tr>
<td width="780"><div align="center"><a href="?action=edit"><span class="name"><font color="#FFFFFF">修改密碼</font></span></a>
| <a href="?action=return"><span class="name"><font color="#FFFFFF">返 回</font></span></a></div></td>
</tr>
</table>
<br>
<br>
<table width="450" border="0" align="center" cellspacing="1" bgcolor="<%=tabbgcolor%>">
<tr>
<td width="40" bgcolor="<%=tdbgcolor%>">
<div align="center">序號</div></td>
<td width="122" bgcolor="<%=tdbgcolor%>">
<div align="center">用戶名</div></td>
<td width="239" bgcolor="<%=tdbgcolor%>">
<div align="center">權(quán)限</div></td>
<td width="116" bgcolor="<%=tdbgcolor%>">
<div align="center">操作</div></td>
</tr>
<%sql="select * from admin where flag>2 order by id"
set rs=conn.execute(sql)
do while not rs.eof%>
<form name="form2" method="post" action="edit.asp">
<tr>
<td bgcolor="<%=tdbgcolor%>"><div align="center"><%=rs("id")%></div></td>
<td bgcolor="<%=tdbgcolor%>"><div align="center"><%=rs("username")%>
<input name="username" type="hidden" id="username" value="<%=rs("username")%>">
</div></td>
<td bgcolor="<%=tdbgcolor%>"><div align="center">普通用戶
<input name="flag" type="checkbox" id="flag" value="2">
升為版主</div></td>
<td bgcolor="<%=tdbgcolor%>"> <div align="center">
<input name="Submit" type="submit" id="Submit" value="修改">
<input name="id" type="hidden" id="id" value="<%=rs("id")%>">
<input name="Submit" type="submit" id="Submit" value="刪除">
</div></td>
</tr>
</form>
<%rs.movenext
loop
rs.close%>
</table>
<%elseif action="edit" then%>
<table width="530" border="0" align="center">
<tr>
<td width="780"><div align="center"><a href="?action=return"><span class="name"><font color="#FFFFFF">返 回</font></span></a>
| <a href="?action=add"><span class="name"><font color="#FFFFFF">添加版主</font></span></a></div></td>
</tr>
</table>
<br>
<br>
<table width="450" border="0" align="center">
<tr>
<td><form name="form3" method="post" action="edit.asp" onsubmit="javascript:return check1();">
<div align="center">請選擇用戶:
<select name="username" id="username" onclick="">
<option selected>請選擇用戶</option>
<%sql="select username,flag,nickname from admin order by id"
set rs=conn.execute(sql)
do while not rs.eof
if rs("flag")>Session("flag") or rs("nickname")=Session("username") then%>
<option><%=rs("username")%></option>
<%end if
rs.movenext
loop
rs.close%>
</select>
<br>
<br>
請輸入密碼:
<input name="password" type="password" id="password" size="13">
<br>
<br>
再輸入一次:
<input name="password2" type="password" id="password2" size="13">
<br>
<br>
<input name="Submit" type="submit" id="Submit" value="更改">
</div>
</form></td>
</tr>
</table>
<%else%>
<table width="530" border="0" align="center">
<tr>
<td width="780"><div align="center"><a href="?action=edit"><span class="name"><font color="#FFFFFF">修改密碼</font></span></a>
| <a href="?action=add"><span class="name"><font color="#FFFFFF">添加版主</font></span></a></div></td>
</tr>
</table>
<br>
<br>
<table width="450" border="0" align="center" cellspacing="1" bgcolor="<%=tabbgcolor%>">
<tr>
<td width="28" bgcolor="<%=tdbgcolor%>"> <div align="center">序號</div></td>
<td width="75" bgcolor="<%=tdbgcolor%>"> <div align="center">用戶名</div></td>
<td width="249" bgcolor="<%=tdbgcolor%>"> <div align="center">權(quán)限</div></td>
<td width="85" bgcolor="<%=tdbgcolor%>"> <div align="center">操作</div></td>
</tr>
<%sql="select * from admin where flag>="&Session("flag")&" and flag<3 order by id"
set rs=conn.execute(sql)
do while not rs.eof
if rs("flag")>Session("flag") or rs("nickname")=Session("username") then%>
<form name="form1" method="post" action="edit.asp">
<tr>
<td bgcolor="<%=tdbgcolor%>"><div align="center"><%=rs("id")%></div></td>
<td bgcolor="<%=tdbgcolor%>"><div align="center">
<input name="username" type="text" id="username" value="<%=rs("username")%>" size="8">
</div></td>
<td bgcolor="<%=tdbgcolor%>"><div align="center">
<%if rs("flag")=2 then%>
版主
<input name="flag" type="checkbox" id="flag" value="1">
升為管理員
<input name="flag" type="checkbox" id="flag" value="3">
降為普通用戶
<%elseif rs("flag")=1 then%>
管理員
<%if session("flag")=0 then%>
<input name="flag" type="checkbox" id="flag" value="2">
降為版主
<%end if
end if%>
</div></td>
<td bgcolor="<%=tdbgcolor%>"><div align="center">
<input type="submit" name="Submit" value="修改">
<input name="id" type="hidden" id="id" value="<%=rs("id")%>">
<input name="Submit" type="submit" id="Submit" value="刪除">
</div></td>
</tr>
</form>
<%else%>
<tr>
<td bgcolor="<%=tdbgcolor%>"><div align="center"><%=rs("id")%></div></td>
<td bgcolor="<%=tdbgcolor%>"><div align="center"><%=rs("username")%></div></td>
<td bgcolor="<%=tdbgcolor%>"><div align="center">
<%if rs("flag")=2 then%>
版主
<%elseif rs("flag")=1 then%>
管理員
<%end if%>
</div></td>
<td bgcolor="<%=tdbgcolor%>"></td>
</tr>
<%end if
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set rs=nothing%>
</table>
<%end if%>
<br>
<br>
<br>
</td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -