📄 usmanagement.asp
字号:
<!-- #include file="setup.asp" -->
<%
if Request.ServerVariables("request_method")="POST" then
UseID=Trim(Request("UsID"))
Grade=Trim(Request.Form("Grade"))
UsID=Split(UseID,",")
Select Case Request.Form("Submit")
Case "提交"
if UseID="" Then Error 2,"用户号码不能为空",""
if Grade="" Then Error 2,"设定等级不能为空!",""
For i=0 to Ubound(UsID)
if IsNumEric(UsID(i))=False Then Error 2,"错误的用户号码!",""
if Trim(Request.Cookies("Product")) >= Trim(conn.execute("Select UserGrade from UserInfo where UserID="&UsID(i))(0)) Then
if conn.execute("Select count(UserID) from UserInfo where UserID="&UsID(i))(0)=0 Then Error 2,UsID(i)&" 无此会员号!",""
if Grade="44" Then
conn.execute("update UserInfo set DelThis=true where UserID="&UsID(i))
Else
conn.execute("update UserInfo Set UserGrade="&Grade&" where UserID="&UsID(i))
End if
Else
badName=badName&conn.execute("Select UserName_1 from UserInfo where UserID="&UsID(i))(0)&"\n"
End if
Next
if badName<>"" Then Response.write "<script language=javascript>alert('您没有权限为以下用户设置权限!\n"&badName&"');</script>"
Case "打开查看用户资料"
if Trim(UseID)="" OR UseID="," OR IsNumEric(UseID)=False Then Error 2,"非法的用户号码",""
UsN=""
L=1
if Ubound(UsID)>=20 Then Error 2,"请勿打开同时超过20个用户资料\n否则将可能严重耗消您的系统资源而导致死机!",""
For i=0 to Ubound(UsID)
if instr(UID,UsID(i))=0 Then
UsN=UsN&L&"."&conn.execute("Select UserName_1 from UserInfo where UserID="&UsID(i))(0)&"\n"
Response.write "<script language=JavaScript>window.open('ShowUserInfo.asp?UsId="&UsID(i)&"')</script>"
L=L+1
End if
UID=UID&UsID(i)&"'"
Next
UID=""
Error 3,"成功打开以下用户资料:\n\n"&UsN,"UsManagement.asp?menu="&Request.QueryString("menu")
Response.end
Case "确定"
DelUser=Request.Form("DelUser")
if DelUser="null"Then
Error 2,"请选择您要删除用户的条件",""
Elseif DelUser="along" Then
conn.execute("update UserInfo set DelThis=True where UserLastT Is Null")
Else
conn.execute("update UserInfo set DelThis=True where DateDiff('d',UserLastT,Now) <= "&DelUser&" and DelThis=False" )
End if
Case "确 定"
validate "Login.asp",5
AdMoney=Request.Form("AdMoney")
textarea=Trim(Request.Form("textarea"))
if Trim(UseID)="" Then Error 2,"请输入正确的用户号码",""
if conn.execute("Select count(UserID)from UserInfo where UserID="&UseID)(0)=0 Then Error 2,"请输入正确的用户号码",""
if IsNumEric(AdMoney)=False Then Error 2,"请输入正确的金额!",""
if Grade="" Then Error 2,"请做出操作选择!",""
if Len(textarea) > 50 Then Error "备注请勿超过25个中文字符或50个英文字符!"
if textarea="" Then textarea="--"
if IsNumEric(UseID)=false Then Error 2,"错误的用户号码!",""
if Grade= "add" Then
conn.execute("update UserInfo set UserMoney=UserMoney+"&AdMoney&" where UserID="&UseID)
FinanceOperation="入账"
FinanceReason="增加预付款"
Else
conn.execute("update UserInfo set UserMoney=UserMoney-"&AdMoney&" where UserID="&UseID)
FinanceOperation="支出"
FinanceReason="人工销帐"
End if
FinanceID=UseID
FinanceRemarks=textarea
FinanceMoney=AdMoney
Conn.Execute("insert into Finance(FinanceID,FinanceOperation,FinanceMoney,FinanceReason,FinanceRemarks)values("&FinanceID&",'"&FinanceOperation&"',"&FinanceMoney&",'"&FinanceReason&"','"&FinanceRemarks&"')")
End Select
Conn.Close
Set Conn = Nothing
response.redirect "UsManagement.asp?menu="&Request.QueryString("menu")
Response.end
End if
Call Top
Call table()
Menu=Request.QueryString("menu")
%>
<style>
<!--
TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}
-->
</style>
<script>
function emoticon(theSmilie){
if (document.form1.UsID.value==""){
document.form1.UsID.value = theSmilie;
}else{
document.form1.UsID.value += ','+theSmilie ;
}
}
</script>
<%Select case Menu
Case "Adv"
validate "Login.asp",6%><br>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
<tr>
<td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none">
<b> ■ </b><%=Community%> [点击用户名后进行操作]</td>
</tr>
</table>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">商城管理员信息: <font color=Red><b><%= conn.execute("Select count(UserID)from UserInfo Where UserGrade >= 4")(0) %></b></font> 条
</TD>
</TR>
<TR>
<TD height=13 ><% UsList 6,1 %><% UsList 5,1 %><% UsList 4,1 %></TD>
</TR>
</TABLE>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">社区管理员信息: <font color=Red><b><%= conn.execute("Select count(UserID)from UserInfo Where UserGrade=3")(0) %></b></font> 条
</TD>
</TR>
<TR>
<TD height=13 ><% UsList 3,1 %></TD>
</TR>
</TABLE>
<%Usztgg
Htmlend
Case "Vip"
validate "Login.asp",5
%><br>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
<tr>
<td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none">
<b> ■ </b><%=Community%> [点击用户名后进行操作]</td>
</tr>
</table>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">商城VIP会员信息: <font color=Red><b><%= conn.execute("Select count(UserID)from UserInfo Where UserGrade=2")(0) %></b></font> 条
</TD>
</TR>
<TR>
<TD height=13 ><% UsList 2,1 %></TD>
</TR>
</TABLE>
<%Usztgg
Htmlend
Case "RegUs"
validate "Login.asp",4
%>
<br>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
<tr>
<td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none">
<b> ■ </b><%=Community%> [点击用户名后进行操作]</td>
</tr>
</table>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">社区普通会员信息: <font color=Red><b><%= conn.execute("Select count(UserID)from UserInfo Where UserGrade=1")(0) %></b></font> 条
</TD>
</TR>
<TR>
<TD height=13 >
<form name="form" method="get"><input name="menu" type="hidden" value="RegUs">
<div align="center">列出
<select name="Sort">
<option value="UserName_1">会员名称</option>
<option value="UserName_2">会员昵称</option>
<option value="UserTel">会员电话</option>
<option value="UserCphone">会员手机</option>
<option value="UserAddr">注册地区</option>
</select> 包含 <input name="Keytext" type="text" size="8" maxlength="20">
的所用普通用户。<input type="submit" name="Send" value="确定">
</div></form><form name="form" method="post" action="">
<div align="center">删除 <select name="DelUser">
<option value="null">选择</option>
<option value="along">从来</option>
<option value="30">30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
</select> 没有登陆过的普通用户资料到社区回收站。
<input type="submit" name="Submit" value="确定"></div></form>
</TD></TR></TABLE>
<% if Request("Send")="确定" Then%>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">以下是根据条件搜索出来的会员列表:
</TD>
</TR>
<TR>
<TD height=13 ><% UsList 2,2 %></TD>
</TR>
</TABLE>
<%Else%>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">以下是最后注册的100名会员列表:
</TD>
</TR>
<TR>
<TD height=13 ><% UsList 2,3 %></TD>
</TR>
</TABLE>
<%End if
Usztgg
Htmlend
Case "Target"
validate "Login.asp",4
%>
<br>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
<tr>
<td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none">
<b> ■ </b><%=Community%> [点击用户名后进行操作]</td>
</tr>
</table>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">商城锁定用户信息: <font color=Red><b><%= conn.execute("Select count(UserID)from UserInfo Where UserGrade=0")(0) %></b></font> (所有锁定用户将失去在商城定购的权限!)
</TD>
</TR>
<TR>
<TD height=13 ><% UsList 0,1 %></TD>
</TR>
</TABLE>
<%
Usztgg
Htmlend
Case "UsMoney"
validate "Login.asp",5%>
<br>
<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
<tr>
<td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none">
<b> ■ </b><%=Community%> [输入用户名号码后进行操作]</td>
</tr>
</table>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
<TR>
<TD height=12 width="75%" > <img src="images/2.gif" width="60" height="9">在您收到用户给您汇的预付款后,可以直接打入该用户帐号。
</TD>
</TR>
<TR>
<TD height=13 ><table width="100%" border="0"><form name="form1" method="post" action="">
<tr>
<td> <div align="center">用户号码
<input name="UsID" type="text" size="10" maxlength="10" onkeyup="if(isNaN(this.value)) this.value='';">
<select name="Grade">
<option selected value="">操作</option>
<option value="add">增加</option>
<option value="allay">减少</option>
</select>
金额 <input name="AdMoney" type="text" size="10" maxlength="9" onkeyup="if(isNaN(this.value)) this.value='';">
备注 <textarea name="textarea" Title="请输入备注"></textarea>
<input type="submit" name="Submit" value="确 定">
</div></td>
</tr></form>
</table><br><center>输入多个用户号码,请用","号隔开!</center></TD>
</TR>
</TABLE>
<%
Htmlend
End Select
Sub Usztgg%>
<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse"><form name="form1" method="post">
<TR><TD width="75%" > <div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td rowspan="2"> <div align="right"></div>
<div align="right">将 <textarea name="UsID"></textarea>
</div></td><td width="47%" height="26">
<input type="submit" name="Submit" value="打开查看用户资料"></td>
</tr><tr><td> 设为
<select name="Grade">
<option value="">等级分配</option>
<option value="5">总管理员</option>
<option value="4">商城管理员</option>
<option value="3">社区管理员</option>
<option value="2">商城VIP会员</option>
<option value="1">商城普通用户</option>
<option value="0">商城锁定用户</option>
<option value="44">回收站</option>
</select> <input type="Submit" name="Submit" value="提交"></td>
</tr>
</table>
<br>如果您知道用户号码的话,也可以直接输入号码。然后用","号隔开!</div>
</TD></TR></form></TABLE>
<%End sub
'-----------------用户列表
Sub UsList(Grade,Sor)
Response.write "<table border=0 cellpadding=0 cellspacing=0 width=100% >"&_
"<tr><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=8% ></td><td width=4% ></td></tr>"
Select case Sor
Case 1
Sql="Select UserID,UserName_1 From UserInfo where DelThis=False and UserGrade="&Grade
Case 2
Sort1=Request("Sort")
Keytext=server.htmlencode(Trim(Request("Keytext")))
if instr(Keytext," ")>0 Then Error 2,"关键字请勿输入空格!",""
Sql="Select UserID,UserName_1 From UserInfo where DelThis=False and UserGrade=1 and "&Sort1&" like '%"&Keytext&"%'"
Case 3
Sql="Select Top 100 UserID,UserName_1 From UserInfo where DelThis=False and UserGrade=1 Order By UserAddtime Desc,UserID "
End Select
Set Rs = Conn.Execute(Sql)
o=1
do while not rs.eof
Response.write "<tr>"
For o=o to o+11
Response.write "<td width=8% >"
Response.write "<a href=javascript:emoticon('"&Rs("UserID")&"')>"&Rs("UserName_1")&"</a>"
Rs.movenext
if rs.EOF Then Exit For
Next
Response.write "</tr>"
loop
Rs.Close
Set Rs = Nothing
Response.write "</table>"
End sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -