?? admin_add.asp
字號(hào):
<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<!--#include file=../inc/md5.asp-->
<link href="inc_style.css" rel="stylesheet" type="text/css">
<p align="center">
<img src="img/list_bo.gif"></p>
<%if request.cookies("admincnmai")("max")<>1 then
dim UserName
UserName=request.cookies("admincnmai")("username")
cnmai=request("cnmai")
password2=trim(request("password2"))
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from admin where UserName='"&UserName&"'"
rs.open sql,conn,1,3
if cnmai="editchk1" then
if password2="" then
response.write"<SCRIPT language=JavaScript>alert('請(qǐng)?zhí)顚?xiě)新的密碼');javascript:history.go(-1)</SCRIPT>"
response.end
end if
rs("password")=md5(password2)
rs.update
response.write"<SCRIPT language=JavaScript>alert('密碼修改成功');</SCRIPT>"
response.write "<meta http-equiv=refresh content=""1;URL=index.asp"">"
response.end
end if
%>
<div align="center">
<table border="1" width="45%" cellspacing="1" style="border-collapse: collapse" bordercolor="#CCCCCC" height="102">
<tr>
<td align="center" height="25" bgcolor="#FEEEBC"><b>修改<%=rs("username")%>(二級(jí)管理員)密碼</b></td>
</tr>
<tr>
<td height="75">
<form method="POST" action="admin_add.asp?cnmai=editchk1" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<p align="center" style="line-height: 200%; ">
新密碼:<input name="password2" size="20" maxlength="20" type="password"></p>
<p align="center" style="line-height: 200%; ">
<input type="submit" value="確定修改" name="editchk"></p>
</form>
</td>
</tr>
</table>
</div>
<%
else
%>
<div align="center">
<form method="POST" action="admin_addchk.asp">
<center>
<table style="BORDER-COLLAPSE: collapse" borderColor="#cccccc" height="68" cellSpacing="0" cellPadding="0" width="45%" border="1">
<tr>
<td bgColor="#FEEEBC" height="25">
<p align="center"><b>增加管理員</b></td>
</tr>
<tr>
<td style="BORDER-BOTTOM: medium none" align="middle" height="21"><br>
用戶名:<input name="username" size="20" maxlength="20"></td>
</tr>
<tr>
<td style="BORDER-TOP: medium none; BORDER-BOTTOM: medium none" align="middle" height="25">密 碼:<input name="password" size="20" maxlength="20"></td>
</tr>
<tr>
<td style="BORDER-TOP: medium none" height="25">
<p align="center">
<input type="submit" value="確定添加" name="B1"></td>
</tr>
</table>
</center>
</form>
</div>
<div align="center">
<%
dim username2,password2,max
username2=trim(request("username2"))
password2=trim(request("password2"))
max=request("R1")
cnmai=request("cnmai")
id=request("id")
if cnmai="editchk" then
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [admin] where id="&cstr(id)
rs.open sql,conn,1,3
if password2="" then
response.write"<SCRIPT language=JavaScript>alert('請(qǐng)?zhí)顚?xiě)新的密碼');javascript:history.go(-1)</SCRIPT>"
response.end
end if
rs("username")=username2
rs("password")=md5(password2)
rs("max")=max
rs.update
response.write"<SCRIPT language=JavaScript>alert('修改成功');</SCRIPT>"
response.write "<meta http-equiv=refresh content=""1;URL=admin_add.asp"">"
response.end
end if
if cnmai="del" then
call del()
else
if cnmai="edit" then
call edit()
else
%>
</div>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#CCCCCC" width="45%">
<tr>
<td width="46" height="24" align="center"><font color="#990000">編號(hào)</font></td>
<td width="221" height="24" align="center"><font color="#990000">管理帳號(hào)</font></td>
<td width="65" height="24" align="center"><font color="#990000">操作</font></td>
<td width="65" height="24" align="center"><font color="#990000">修改</font></td>
</tr>
<%
dim rs,sql,i,id,cnmai
i=1
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select id,username from [admin]"
rs.open sql,conn,1,1
do while not rs.eof
%>
<tr>
<td width="46" height="24" align="center"><%=i%></td>
<td width="221" height="24" align="center"><%=rs("username")%></td>
<td width="65" height="24" align="center"><a href="?cnmai=del&id=<%=rs("id")%>">刪除</a></td>
<td width="65" height="24" align="center">
<a href="?cnmai=edit&id=<%=rs("id")%>">修改</a></td>
</tr>
<%
i=i+1
rs.movenext
loop
rs.close
set rs=nothing
sub del()
id=request("id")
set rs = Server.CreateObject("ADODB.RecordSet")
sql="delete from [admin] where id="&cstr(id)
rs.open sql,conn,1,3
response.write "<font size=2>帳號(hào)刪除成功!</font><br>"
response.end
end sub
%>
</table>
<%sub edit()
id=request("id")
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [admin] where id="&cstr(id)
rs.open sql,conn,1,3
%>
<table border="1" width="45%" cellspacing="1" style="border-collapse: collapse" bordercolor="#CCCCCC" height="102">
<tr>
<td align="center" height="25" bgcolor="#FEEEBC"><b>修改管理員信息</b></td>
</tr>
<tr>
<td height="75">
<form method="POST" action="admin_add.asp?cnmai=editchk&id=<%=id%>" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<p align="center" style="line-height: 200%; margin-top: 0; margin-bottom: 0">用戶名:<input name="username2" size="20" maxlength="20" value="<%=rs("username")%>"></p>
<p align="center" style="line-height: 200%; margin-top: 0; margin-bottom: 0">
密 碼:<input name="password2" size="20" maxlength="20" type="password"></p>
<p align="center" style="line-height: 200%; margin-top: 0; margin-bottom: 0">
<input type="radio" value="1"<%if rs("max")=1 then %> checked <%end if%> name="R1">特級(jí)管理員 <input type="radio" value="0" <%if rs("max")=0 then %> checked <%end if%> name="R1">二級(jí)管理員</p>
<p align="center" style="line-height: 200%; margin-top: 0; margin-bottom: 0">
<input type="submit" value="確定修改" name="editchk"></p>
</form>
</td>
</tr>
</table>
<%
end sub
end if
end if
set rs=nothing
closedb%>
</center>
</div>
<%end if%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -