?? admin_userlist.asp
字號:
<%Admin="UserSee"%>
<!--#include file="check.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/inc.asp"-->
<!--#include file="inc/md5.asp"-->
<%if request.QueryString("hx66")="Modifyinfo" then
Password=trim(request.Form("Password"))
Password2=trim(request.Form("Password2"))
Answer=trim(request.Form("Answer"))
userid=trim(request.QueryString("userid"))
if request("password")=request("pswpassword") then
password=request("password")
else
password=md5(request("password"))
end if
if request("psw")="" then
psw=request("pswpassword")
else
psw=md5(request("psw"))
end if
if request("answer")=request("oldanswer") then
answer=request("answer")
else
answer=md5(request("answer"))
end if
if password<>psw then
response.write"<SCRIPT language=JavaScript>alert(' 兩 次 輸 入 的 密 碼 不 一 致, 請 返 回 ! ');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
sql="select * from [User] where userid=" & userid &""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("Password")=Password
rs("Question")=trim(request.Form("Question"))
rs("Answer")=Answer
rs("Email")=trim(request.Form("Email"))
rs("sex")=request.Form("sex")
rs("Homepage")=trim(request.Form("Homepage"))
rs("QQ")=trim(request.Form("QQ"))
rs("points")=trim(request.Form("points"))
rs.update
rs.close
set rs=nothing
response.Write"<script language=javascript>alert(' 恭 喜 您 ! 資 料 修 改 成 功 !');this.location.href='admin_userlist.asp';</script>"
end if
if request.QueryString("hx66")="deluser" then
uid=request.QueryString("id")
sql="select * from [User] where userid="&uid&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
sql="select * from allcount"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("usercount")=rs("usercount")-1
rs.update
rs.close
set rs=nothing
end if
dim keyword,hx66
keyword=Trim(Request("keyword"))
hx66=Trim(Request("hx66"))
if not isnull(keyword) and keyword<>"" then
sql="select * from [User] where "&hx66&" like '%"&keyword&"%' order by LoginTimes desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
else
sql="select * from [User] order by LoginTimes desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
end if
'sql="select * from [User] order by LoginTimes desc"
'set rs=server.createobject("adodb.recordset")
'rs.open sql,conn,1,3
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<tr class=lanyuss>
<td width="100%" height="23">
<b>普通會員管理</b></td>
</tr>
</table>
<%if request.QueryString("hx66")="adminedit" then%>
<table width="98%" height="250" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="<%=border%>" frame="vsides" rules="none" bgcolor="FFFFFF">
<tr>
<td align="center"><%call Modifyinfo()%></td>
</tr>
</table>
<%else
sub userlist()%>
<SCRIPT LANGUAGE=javascript>
//實現反向選擇
<!--
function SelectAll() {
for (var i=0;i<document.selform.selUserID.length;i++) {
var e=document.selform.selUserID[i];
e.checked=!e.checked;
}
}
//-->
</script>
<%
dim totalPut
dim CurrentPage
dim TotalPages
dim pubUserName,j,selUserID
if not isempty(request("selUserID")) then
selUserID=request("selUserID")
if request("action")="刪除" then
Conn.execute("delete from [User] where UserID in ("&selUserID&")")
set rs=server.createobject("adodb.recordset")
elseif request("action")="激活" then
Conn.execute("update [User] set userlock=0 where UserID in ("&selUserID&")")
set rs=server.createobject("adodb.recordset")
elseif request("action")="鎖定" then
Conn.execute("update [User] set userlock=1 where UserID in ("&selUserID&")")
set rs=server.createobject("adodb.recordset")
elseif request("action")="設為普通用戶" then
Conn.execute("update [User] set UserGrade=0 where UserID in ("&selUserID&")")
set rs=server.createobject("adodb.recordset")
elseif request("action")="設為VIP用戶" then
Conn.execute("update [User] set UserGrade=1 where UserID in ("&selUserID&")")
set rs=server.createobject("adodb.recordset")
else
response.write "無效參數!"
response.end
end if
response.Write"<script language=javascript>alert(' 恭 喜 您 ! 設 置 成 功 !');this.location.href='admin_userlist.asp';</script>"
end if
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<form name="keyword" method="POST" action="admin_userlist.asp" target="main">
<tr>
<td align="center" height="50" bgcolor="#FFFFFF">
用戶搜索:<input type="radio" name="hx66" value="username" checked class='inuptCG'>名稱 <input type="radio" name="hx66" value="UserGrade" class='inuptCG'>等級 <input type='radio' name='hx66' value='LastLoginIP' class='inuptCG'>IP <input type='radio' name='hx66' value='userlock' class='inuptCG'>狀態 <input type="text" name="keyword" size="25"> <input type="submit" value="搜索用戶" name="submit"> <BR><BR>*注:等級搜索輸入數字,0為普通用戶;1為VIP用戶。狀態搜索輸入數字,0為正常狀態;1為鎖定狀態。*
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" frame="vsides" rules="none" bgcolor="FFFFFF">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<!--DWLayoutTable-->
<tr align="center" bgcolor="#FFFFFF">
<td width="5%">選擇</td>
<td width="15%" height="23">用戶名</td>
<td width="5%">等級</td>
<td width="5%">性別</td>
<td width="10%">注冊日期</td>
<td width="8%">登錄次數</td>
<td width="5%">E-mail</td>
<td width="5%">主頁</td>
<td width="5%">QQ</td>
<td width="20%">最后登錄時間</td>
<td colspan="2">操作</td>
<td width="5%">狀態</td>
</tr>
<%if not rs.eof then
rs.Movefirst
rs.pagesize=adperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totaldiary=rs.recordcount
if currentpage<>1 then
if(currentpage-1)*adperpage<totaldiary then
rs.move(currentpage-1)*adperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totaldiary mod adperpage)=0 then
totalpages=totaldiary\adperpage
else
totalpages=totaldiary\adperpage+1
end if
i=0
do while not rs.eof and i<adperpage%>
<form name="selform" method="post" action="">
<tr align="center" bgcolor="#FFFFFF">
<td align="center"><input type="checkbox" name="selUserID" id="selUserID" value="<%=rs("UserID")%>" style="border:0PX "></td>
<td height="21"><a href="#" Title="最后登錄IP:<%=rs("LastLoginIP")%>"><%=rs("UserName")%></td>
<td width="5%">
<%if rs("UserGrade")=0 then%>
普通
<%end if%>
<%if rs("UserGrade")=1 then%>
<font color=red>VIP</font>
<%end if%>
</td>
<td><%=rs("sex")%></td>
<td><%=rs("RegDate")%></td>
<td><%=rs("LoginTimes")%></td>
<td><a href="mailto:<%=rs("email")%>"><img src="img/mail.gif" width="11" height="11" border="0" alt="<%=rs("username")%>的E-mail是<%=rs("email")%>"></a></td>
<td><a href="<%=rs("Homepage")%>"><img src="img/web.gif" width="11" height="11" border="0" alt="<%=rs("username")%>的主頁是<%=rs("Homepage")%>"></a></td>
<td><a href="http://friend.qq.com/cgi-bin/friend/user_show_info?ln=<%=rs("QQ")%>" target="_blank"><img src="img/qq.gif" width="16" height="16" border="0" alt="<%=rs("username")%>的QQ號碼是<%=rs("QQ")%>"></a></td>
<td><%=rs("LastLoginTime")%></td>
<td width="36"><a href="?hx66=deluser&id=<%=rs("userid")%>">刪除</a></td>
<td width="36"><a href="?hx66=adminedit&id=<%=rs("userid")%>">修改</a></td>
<td width="36">
<%if rs("userlock")=0 then%>
正常
<%end if%>
<%if rs("userlock")=1 then%>
<font color=red>鎖定</font>
<%end if%>
</td>
</tr>
<%i=i+1
rs.movenext
loop
else
If rs.EOF And rs.BOF Then%>
<tr align="center" bgcolor="#FFFFFF">
<td height="21" colspan="11">現在還沒有用戶!</td>
</tr>
<%end if
end if%>
<tr bgcolor="#FFFFFF">
<td colspan="13" height="30"> 管理操作:全選
<input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()" style="border:0PX ">
<input onClick="{if(confirm('確定刪除選定的用戶嗎?')){this.document.selform.submit();return true;}return false;}" type=submit value=刪除 name=action>
<input onClick="{if(confirm('確定激活選定的用戶嗎?')){this.document.selform.submit();return true;}return false;}" type=submit value=激活 name=action>
<input onClick="{if(confirm('確定鎖定選定的用戶嗎?')){this.document.selform.submit();return true;}return false;}" type=submit value=鎖定 name=action>
<input onClick="{if(confirm('確定用戶為普通用戶嗎?')){this.document.selform.submit();return true;}return false;}" type=submit value=設為普通用戶 name=action>
<input onClick="{if(confirm('確定用戶為VIP用戶嗎?' )){this.document.selform.submit();return true;}return false;}" type=submit value=設為VIP用戶 name=action>
</td>
</tr>
</form>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form2" method="post" action="">
<tr>
<td align="right" height="30"><%=currentpage%>/<%=totalpages%>頁,<%=totaldiary%>條記錄/<%=adperpage%>條每頁.
<%
i=1
dy10=false
showye=totalpages
if showye>10 then
dy10=true
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="?page=<%=i%>"><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="?page=<%=page%>" title="下一頁">>></a>
<%end if%> </td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<%end sub
sub Modifyinfo()
userid=request.QueryString("id")
sql="select * from [user] where userid="&userid&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="520" height="344" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form name="form2" method="post" action="?hx66=Modifyinfo&userid=<%=userid%>"><tr align="center" bgcolor="#FFFFFF">
<td height="30" colspan="2"><p class="style1"><strong>修改用戶資料</strong></p></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="95"> 用 戶 名:</td>
<td width="322">
<span class="style1"><%=rs("username")%></span> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td> 密 碼:</td>
<td>
<input type="password" name="password" size=20 value="<%=rs("password")%>">
<input type=hidden name="pswpassword" value="<%=rs("password")%>">
</tr>
<tr bgcolor="#FFFFFF">
<td> 新密碼確認:</td>
<td>
<input type="password" name="psw" value="" size=20 maxlength=13>
<span class="style1"> 不修改密碼請留空</span> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td> 密碼提示問題:</td>
<td>
<input name="Question" type="text" class="lanyu" id="Question2" value="<%=rs("Question")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> 密碼提示答案:</td>
<td>
<input type=text name="answer" size=20 value="<%=rs("answer")%>">
<input type=hidden name="oldanswer" value="<%=rs("answer")%>">
<span class="style1">答案采用了MD5加密,如要修改可直接填寫。</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> E-mail:</td>
<td>
<input name="Email" type="text" class="lanyu" id="Email2" value="<%=rs("Email")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> 性 別:</td>
<td>
<input type="radio" name="sex" value="男" <%if rs("sex")="男" then response.Write"checked" end if%>>
男
<input name="sex" type="radio" value="女" <%if rs("sex")="女" then response.Write"checked" end if%>>
女</td>
</tr>
<tr bgcolor="#FFFFFF">
<td> 個人主頁:</td>
<td>
<input name="Homepage" type="text" class="lanyu" id="Homepage2" value="<%=rs("Homepage")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> QQ:</td>
<td>
<input name="QQ" type="text" class="lanyu" id="QQ2" value="<%=rs("QQ")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> 用戶積分:</td>
<td>
<input name="points" type="text" class="lanyu" id="points2" value="<%=rs("points")%>"></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td colspan="2"><input type="submit" name="Submit" value=" 修改 " class="button">
<input type="reset" name="Submit2" value=" 重填 " class="button">
</td>
</tr></form>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<%end sub
if session("adminlogin")<>sessionvar then%>
<%
if session("userlogin")="" then%>
<table width="760" height="250" border="1" align="center" cellpadding="0" cellspacing="0" frame="vsides" rules="none">
<tr>
<td align="center"><%call guesterror()%></td>
</tr>
</table>
<%else
call userlist()
end if
else
call userlist()
end if
end if
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -