?? admin_modiuser.asp
字號:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file=inc/char.asp-->
<!--#include file=inc/grade.asp-->
<!--#include file=chkuser.asp-->
<!--#include file=md5.asp-->
<title><%=ForumName%>--管理頁面</title>
<link rel="stylesheet" type="text/css" href="forum.css">
<BODY <%=ForumBody%>>
<%
if instr(session("flag"),"11")=0 then
Errmsg=Errmsg+"<br>"+"<li>本頁面為管理員專用,請<a href=admin_index.asp target=_top>登陸</a>后進入。<br><li>您沒有管理本頁面的權(quán)限。"
call Error()
else
call main()
set rs=nothing
conn.close
set conn=nothing
end if
sub main()
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebackcolor%> align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr bgcolor='<%=Tabletitlecolor%>'>
<td><font color="<%=TablefontColor%>">歡迎<b><%=membername%></b>進入管理頁面</font>
</td>
</tr>
<tr bgcolor=<%=tablebodycolor%>>
<td width="100%" valign=top><font color="<%=TableContentColor%>">
<%
if request("action")="save" then
call update()
else
call userinfo()
end if
%></font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
sub userinfo()
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where username='"&trim(request("name"))&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>該用戶名不存在。"
call error()
exit sub
else
%>
<form method="POST" action=admin_modiuser.asp?action=save>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align=center bordercolor=<%=aTablebackcolor%>>
<tr bgcolor=<%=aTabletitlecolor%>>
<td height="11" colspan="2" ><font color="<%=TableContentColor%>"><b><%=htmlencode(rs("username"))%>的個人資料</b></font></td>
</tr>
<tr >
<td height="11" ><font color="<%=TableContentColor%>">用戶頭銜(管理員設(shè)定)</font></td>
<td height="11" >
<input type="text" name="title" size="35" value="<%=rs("title")%>">
</td>
</tr>
<tr>
<td width="41%" height="18"><font color="<%=TableContentColor%>">用戶名</font></td>
<td width="59%" height="18">
<input type="text" name="userName" size="35" value="<%=htmlencode(rs("username"))%>">
<input type="hidden" name="Name" size="35" value="<%=request("name")%>">
</td>
</tr>
<tr>
<td width="41%" height="18"><font color="<%=TableContentColor%>">用戶密碼</font></td>
<td width="59%" height="18">
<input type="text" name="password" size="35" value="<%=htmlencode(rs("userpassword"))%>">
</td>
</tr>
<tr>
<td width="41%" height="18"><font color="<%=TableContentColor%>">郵件地址</font></td>
<td width="59%" height="18">
<input type="text" name="userEmail" size="35" value="<%=rs("userEmail")%>">
</td>
</tr>
<tr>
<td width="41%" height="18"><font color="<%=TableContentColor%>">個人主頁</font></td>
<td width="59%" height="18">
<input type="text" name="homepage" size="35" value="<%=rs("homepage")%>">
</td>
</tr>
<tr>
<td width="41%" height="8"><font color="<%=TableContentColor%>">發(fā)表文章</font></td>
<td width="59%" height="-2">
<input type="text" name="article" size="35" value="<%=rs("article")%>">
</td>
</tr>
<tr>
<td width="41%" height="9"><font color="<%=TableContentColor%>">財產(chǎn)總數(shù)</font></td>
<td width="59%" height="0">
<input type="text" name="userWealth" size="35" value="<%=rs("userWealth")%>">
</td>
</tr>
<tr>
<td width="41%" height="8"><font color="<%=TableContentColor%>">經(jīng) 驗 值</font></td>
<td width="59%" height="8">
<input type="text" name="userEP" size="35" value="<%=rs("userEP")%>">
</td>
</tr>
<tr>
<td width="41%" height="9"><font color="<%=TableContentColor%>">魅 力 值</font></td>
<td width="59%" height="9">
<input type="text" name="userCP" size="35" value="<%=rs("userCP")%>">
</td>
</tr>
<tr>
<td width="41%" height="18"><font color="<%=TableContentColor%>">用戶等級</font></td>
<td width="59%" height="18">
<select name="userclass">
<%
dim userclass
userclass=(rs("userclass"))
%>
<option value="1" <%if grade(userclass)=(grade(1)) then%>selected<%end if%>><%=grade(1)%>
<option value="2" <%if grade(userclass)=(grade(2)) then%>selected<%end if%>><%=grade(2)%>
<option value="3" <%if grade(userclass)=(grade(3)) then%>selected<%end if%>><%=grade(3)%>
<option value="4" <%if grade(userclass)=(grade(4)) then%>selected<%end if%>><%=grade(4)%>
<option value="5" <%if grade(userclass)=(grade(5)) then%>selected<%end if%>><%=grade(5)%>
<option value="6" <%if grade(userclass)=(grade(6)) then%>selected<%end if%>><%=grade(6)%>
<option value="7" <%if grade(userclass)=(grade(7)) then%>selected<%end if%>><%=grade(7)%>
<option value="8" <%if grade(userclass)=(grade(8)) then%>selected<%end if%>><%=grade(8)%>
<option value="9" <%if grade(userclass)=(grade(9)) then%>selected<%end if%>><%=grade(9)%>
<option value="10" <%if grade(userclass)=(grade(10)) then%>selected<%end if%>><%=grade(10)%>
<option value="11" <%if grade(userclass)=(grade(11)) then%>selected<%end if%>><%=grade(11)%>
<option value="12" <%if grade(userclass)=(grade(12)) then%>selected<%end if%>><%=grade(12)%>
<option value="13" <%if grade(userclass)=(grade(13)) then%>selected<%end if%>><%=grade(13)%>
<option value="14" <%if grade(userclass)=(grade(14)) then%>selected<%end if%>><%=grade(14)%>
<option value="15" <%if grade(userclass)=(grade(15)) then%>selected<%end if%>><%=grade(15)%>
<option value="16" <%if grade(userclass)=(grade(16)) then%>selected<%end if%>><%=grade(16)%>
<option value="17" <%if grade(userclass)=(grade(17)) then%>selected<%end if%>><%=grade(17)%>
<option value="18" <%if grade(userclass)=(grade(18)) then%>selected<%end if%>><%=grade(18)%>
<option value="19" <%if grade(userclass)=(grade(19)) then%>selected<%end if%>><%=grade(19)%>
<option value="20" <%if grade(userclass)=(grade(20)) then%>selected<%end if%>><%=grade(20)%>
</select>
</td>
</tr>
<tr>
<td width="41%" height="18"><font color="<%=TableContentColor%>">鎖定用戶</font></td>
<td width="59%" height="18">
<select name="lockuser">
<option value="0" <%if rs("lockuser")=0 then%>selected<%end if%>>否
<option value="1" <%if rs("lockuser")=1 then%>selected<%end if%>>是
</select>
</td>
</tr>
<tr bgcolor=<%=aTabletitlecolor%>>
<td height="23" colspan="2" >
<input type="submit" name="Submit" value="更 新">
</td>
</tr>
</table>
</form>
<%
end if
rs.close
set rs=nothing
end sub
sub update()
set rs=server.createobject("adodb.recordset")
sql="Select * from [User] where username='"&trim(request("name"))&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
errmsg=errmsg+"<br>"+"<li>該用戶名不存在。"
call error()
exit sub
else
rs("title")=request.form("title")
rs("username")=request.form("username")
if rs("userpassword")<>request.form("password") then
rs("userpassword")=md5(request.form("password"))
end if
rs("useremail")=request.form("useremail")
rs("homepage")=request.form("homepage")
rs("article")=request.form("article")
rs("userclass")=request.form("userclass")
rs("lockuser")=request.form("lockuser")
rs("userWealth")=request.form("userWealth")
rs("userEP")=request.form("userEP")
rs("userCP")=request.form("userCP")
rs.update
if request.form("username")<>rs("username") then
conn.execute("update bbs1 set username='"&request.form("username")&"' where username='"&rs("username")&"'")
conn.execute("update message set sender='"&request.form("username")&"' where sender='"&rs("username")&"'")
conn.execute("update message set incept='"&request.form("username")&"' where incept='"&rs("username")&"'")
end if
rs.close
end if
set rs=nothing
%><center><p><b>更新用戶數(shù)據(jù)成功!</b>
<%
end sub
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -