plus_tools_user.asp

来自「现在好了」· ASP 代码 · 共 544 行 · 第 1/2 页

ASP
544
字号
<!--#include file =../conn.asp-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="../inc/dv_clsother.asp" -->
<!-- #include file="../Dv_plus/Tools/plus_Tools_const.asp" -->
<%

	Head()
	dim admin_flag
	admin_flag=",36,"
	If Not Dvbbs.master or instr(","&session("flag")&",",admin_flag)=0 then
		Errmsg=ErrMsg + "<BR><li>本页面为管理员专用,请<a href=../admin_login.asp target=_top>登录</a>后进入。<br><li>您没有管理本页面的权限。"
		dvbbs_error()
	Else
		Main_head()

		Select Case Request("action")
		Case "paylist"
			UserList(2)
		Case "paylist1"
			UserList(3)
		Case "EditInfo"
			EditInfo()
		Case "SaveEdit"
			SaveEdit()
		Case "Not_Apply_Sale"
			Not_Apply_Sale()
		Case "Del_UserTools"
			Del_UserTools()
		Case "SendTools"
			SendTools()
		Case "SaveSend"
			SaveSend()
		Case Else
			UserList(1)
		End Select

		If founderr then call dvbbs_error()
		footer()
	End If

'顶部标题
Sub Main_head()
%>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
<tr><th height=24>道具中心用户信息管理</th></tr>
<tr><td class="forumRowHighlight"><B>说明</B>:<BR>
1、列表中的金币和点券指用户的总拥有量,而不是道具价格,查看相关用户道具信息请点击用户名进入<BR>
2、关键字搜索内容:用户名模糊搜索
</td></tr>
<tr><td class="forumRow"><B>操作</B>:<a href="plus_Tools_User.asp">用户道具管理首页</a> | <a href="?action=paylist">出售中的用户道具</a> <!-- | <a href="?action=paylist1">低于系统售价的出售道具</a> --> | <a href="?action=SendTools">给用户添加道具或金币</a>
</td></tr>
</table><br>
<%
End Sub

Sub UserList(ListType)
	Dim ToolsType,KeyWord,DataDesc,DataDescStr,UpDesc
	Dim ToolsValues_1,SearchStr
	Dim Rs,Sql,i
	Dim Page,MaxRows,Endpage,CountNum,PageSearch,SqlString
	Endpage = 0
	MaxRows = 20
	Page = Request("Page")
	ToolsType = Request("ToolsType")
	KeyWord = Request("keyword")
	DataDesc = Request("DataDesc")
	UpDesc = Request("UpDesc")
	If IsNumeric(Page) = 0 or Page="" Then Page=1
	Page = Clng(Page)
	Response.Write "<script language=""JavaScript"" src=""../inc/Pagination.js""></script>"
	If Not IsNumeric(ToolsType) Or ToolsType = "" Then ToolsType = 0
	ToolsType = Clng(ToolsType)
	If KeyWord <> "" Then KeyWord = Replace(KeyWord,"'","''")
	If ToolsType > 0 Then SearchStr = " ToolsID="&ToolsType&" "
	If Not IsNumeric(DataDesc) Or DataDesc = "" Then DataDesc = 0
	DataDesc = Clng(DataDesc)

	PageSearch = "action="&Request("action")&"&keyword="&KeyWord&"&ToolsType="&ToolsType&"&DataDesc="&DataDesc&"&UpDesc="&UpDesc
	
	Select Case DataDesc
	Case 1
		DataDescStr = " SaleMoney"
		ListType = 2
	Case 2
		DataDescStr = " SaleTicket"
		ListType = 2
	Case 3
		DataDescStr = " ToolsCount"
	Case 4
		DataDescStr = " SaleCount"
		ListType = 2
	Case Else
		DataDescStr = " ID"
	End Select

	If UpDesc="1" Then
		DataDescStr = DataDescStr & " Desc"
	End If

	If ListType > 1 Then ToolsValues_1 = "价格"

	If ListType = 3 Then
		If SearchStr <> "" Then
			SearchStr = SearchStr & " And (Not SaleCount=0)"
		Else
			SearchStr = " (Not SaleCount=0)"
		End If
	ElseIf ListType = 2 Then
		If SearchStr <> "" Then
			SearchStr = SearchStr & " And (Not SaleCount=0)"
		Else
			SearchStr = " (Not SaleCount=0)"
		End If
	End If
	If SearchStr<>"" Then
		If KeyWord<>"" Then SearchStr = SearchStr & " And UserName Like '%"&KeyWord&"%'"
	Else
		If KeyWord<>"" Then SearchStr = SearchStr & " UserName Like '%"&KeyWord&"%'"
	End If
	If SearchStr <> "" Then SearchStr = "Where " & SearchStr
%>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
<tr>
<FORM METHOD=POST ACTION="plus_Tools_User.asp">
<td class="forumRowHighlight" colspan=5>
用户名 : <input type=text size=15 name="keyword">
<input type=hidden value="<%=ToolsType%>" name="ToolsType">
<input type=hidden value="<%=DataDesc%>" name="DataDesc">
<input type=hidden value="<%=Request("action")%>" name="action">
<input type=submit name=submit value="搜索">
</td>
</FORM>
<FORM METHOD=POST ACTION="plus_Tools_User.asp">
<input type=hidden value="<%=ToolsType%>" name="ToolsType">
<input type=hidden value="<%=Request("action")%>" name="action">
<td class="forumRowHighlight" colspan=2 align=right>
<Select Name="DataDesc" Size=1 onchange='javascript:submit()'>
<Option value="0" Selected>列表排序</Option>
<Option value="1" <%If DataDesc = 1 Then Response.Write "Selected"%>>出售金币数</Option>
<Option value="2" <%If DataDesc = 2 Then Response.Write "Selected"%>>出售点券数</Option>
<Option value="3" <%If DataDesc = 3 Then Response.Write "Selected"%>>拥有数</Option>
<Option value="4" <%If DataDesc = 4 Then Response.Write "Selected"%>>出售数</Option>
</Select>
<Select Name="UpDesc" Size=1 onchange='javascript:submit()'>
<Option value="0" <%If UpDesc = "0" Then Response.Write "Selected"%>>升序</Option>
<Option value="1" <%If UpDesc = "1" Then Response.Write "Selected"%>>降序</Option>
</Select>
</td>
</FORM>
<FORM METHOD=POST ACTION="plus_Tools_User.asp">
<input type=hidden value="<%=Request("action")%>" name="action">
<input type=hidden value="<%=DataDesc%>" name="DataDesc">
<td class="forumRowHighlight" align=right>
<Select Name="ToolsType" size=1 onchange='javascript:submit()'>
<Option value="0" Selected>拥有某道具用户列表</option>
<%
	SQL = "Select ID,ToolsName From Dv_Plus_Tools_Info Order By ID"
	Set Rs = Server.CreateObject ("adodb.recordset")
	If Cint(Dvbbs.Forum_Setting(92))=1 Then
		If Not IsObject(Plus_Conn) Then Plus_ConnectionDatabase
		Rs.Open Sql,Plus_Conn,1,1
	Else
		If Not IsObject(Conn) Then ConnectionDatabase
		Rs.Open Sql,conn,1,1
	End If
	Do While Not Rs.Eof
		Response.Write "<Option value="""&Rs(0)&""" "
		If ToolsType=Rs(0) Then Response.Write "Selected"
		Response.Write ">"&Rs(1)&"</Option>"
	Rs.MoveNext
	Loop
	Rs.Close
	Set Rs=Nothing
%>
</Select>
</td>
</FORM>
</tr>
<tr>
<th width="20%" height=24>用户名</th>
<th width="8%">金币<%=ToolsValues_1%></th>
<th width="8%">点券<%=ToolsValues_1%></th>
<th width="15%">道具名</th>
<th width="7%">拥有数</th>
<th width="7%">出售数</th>
<th width="15%">操作时间</th>
<th width="21%">最后登录</th>
</tr>
<%
	'T.ToolsName=0,T.ToolsCount=1,T.SaleCount=2,U.UserName=3,U.UserMoney=4,U.UserTicket=5,U.UserLastIP=6,U.LastLogin=7,T.ID=8

	SQL = "Select ToolsName,ToolsCount,SaleCount,UserName,SaleMoney,SaleTicket,UpdateTime,UpdateTime,ID From Dv_Plus_Tools_Buss "&SearchStr&" Order By " & DataDescStr

	'Response.Write SQL
	Set Rs = server.CreateObject ("adodb.recordset")
	If Cint(Dvbbs.Forum_Setting(92))=1 Then
		If Not IsObject(Plus_Conn) Then Plus_ConnectionDatabase
		Rs.Open Sql,Plus_Conn,1,1
	Else
		If Not IsObject(Conn) Then ConnectionDatabase
		Rs.Open Sql,conn,1,1
	End If

	If Not (Rs.Eof And Rs.Bof) Then
		CountNum = Rs.RecordCount
		If CountNum Mod MaxRows=0 Then
			Endpage = CountNum \ MaxRows
		Else
			Endpage = CountNum \ MaxRows+1
		End If
		Rs.MoveFirst
		If Page > Endpage Then Page = Endpage
		If Page < 1 Then Page = 1
		If Page >1 Then 				
			Rs.Move (Page-1) * MaxRows
		End if
		SQL=Rs.GetRows(MaxRows)
	Else
		Response.Write "<tr><td class=""forumRow"" colspan=""8"" align=center>还未有信息!</td></tr></table>"
		Exit Sub
	End If
	Rs.close:Set Rs = Nothing
	For i=0 To Ubound(SQL,2)
%>
<tr>
<td class="forumRow" align=center><a href="?action=EditInfo&ID=<%=SQL(8,i)%>"><%=SQL(3,i)%></a></td>
<td class="forumRow" align=center><%=SQL(4,i)%></td>
<td class="forumRow" align=center><%=SQL(5,i)%></td>
<td class="forumRow" align=center><%=SQL(0,i)%></td>
<td class="forumRow" align=center><%=SQL(1,i)+SQL(2,i)%></td>
<td class="forumRow" align=center><%=SQL(2,i)%></td>
<td class="forumRow" align=center><%=SQL(6,i)%></td>
<td class="forumRow" align=center><%=SQL(7,i)%></td>
</tr>
<%
	Next

	PageSearch=Replace(Replace(PageSearch,"\","\\"),"""","\""")
	Response.Write "<SCRIPT>PageList("&Page&",3,"&MaxRows&","&CountNum&","""&PageSearch&""",1);</SCRIPT>"
End Sub

Sub EditInfo()
	Dim ID
	ID=Request("ID")
	If Not IsNumeric(ID) Or ID="" Then
		Errmsg=ErrMsg + "<BR><li>非法的参数。"
		founderr=True
	Else
		ID=Clng(ID)
	End If
	If founderr Then Exit Sub
	Set Rs=Dvbbs.Plus_Execute("Select * From Dv_Plus_Tools_Buss Where ID=" & ID)

	If Rs.Eof And Rs.Bof Then
		Errmsg=ErrMsg + "<BR><li>没有找到相关的数据。"
		founderr=True
	End If
	If founderr Then Exit Sub
%>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
<FORM METHOD=POST ACTION="?action=SaveEdit">
<input type=hidden value="<%=ID%>" name="ID">
<tr><th height=24 colspan=2><%=Rs("UserName")%> 的论坛道具 <%=Rs("ToolsName")%> 管理</th></tr>
<tr><td class="forumRow" colspan=2><B>操作</B>:
<a href="plus_Tools_Info.asp?action=Editinfo&EditID=<%=Rs("ToolsID")%>">查看该道具资料</a> | <a href="?action=Not_Apply_Sale&ID=<%=Rs("ID")%>">取消该道具销售状态</a> | <a href="?action=Del_UserTools&ID=<%=Rs("ID")%>" onclick="{if(confirm('删除此用户该道具信息,操作将不可恢复,确定吗?')){return true;}return false;}">删除此用户该道具信息</a>
</td></tr>
<tr>
<td class="forumRow" width="20%" align=right><B>道具名</B>:</td>
<td class="forumRow" width="80%"><%=Rs("ToolsName")%></td>
</tr>
<tr>
<td class="forumRow" width="20%" align=right><B>所属用户</B>:</td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?