<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_user_log.asp
'* 最后更新 2011-08-23 by 56770.kingdge
'*****************************************
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_user.inc"
CurrentId = 3
CurrentUrl = "admin_user_log.asp"
LB_Head()
LB_Menu()
action = request("action")
user_id = SafeReplace(request("user_id"))
If user_id <> "" Then
%>
		<div class="tabmenu mainwidth">
			  <ul>
				<li><a href="admin_user.asp"><span><%=Lang_Menu(56)%></span></a></li>
				<li><a href="Admin_user.asp?action=view&user_id=<%=server.urlencode(user_id)%>"><span><%=user_id%></span></a></li>
				<li><a href="Admin_orders.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(58)%></span></a></li>
				<li class="current"><a href="Admin_user_log.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(59)%></span></a></li>
				<li><a href="Admin_user_account.asp?user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(154)%></span></a></li>
				<li><a href="Admin_msg.asp?action=add&user_id=<%=server.urlencode(user_id)%>"><span><%=Lang_User(47)%></span></a></li>
			  </ul>
		</div>
<%
		Response.Write("<div class=""tab-mainbody"">")
		Response.Write("<div class=""tab-mainbody2"">")
Else
		Response.Write("<div class=""mainbody"">")
		Response.Write("<div class=""mainbody2"">")
End If
If OutSubmit = 1 Then CheckOutSubmit()
Select Case action
		Case "del" : del()
		Case Else
		list()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub del()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",4.4,"
	    user_id=safereplace(request("user_id"))
	    If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
	            adminflag()
	    Else
	            If user_id<>"" Then
			            conn.execute("delete from [Lebi_money_log] where m_zt=0 and m_user_id='"&user_id&"'")
						ManageLog Lang_User(13) &" ["&user_id&"]"
		        Else
			            conn.execute("delete from [Lebi_money_log] where m_zt=0")
						ManageLog Lang_User(13)
			    End If
                m_u="?user_id="& user_id &"&pagenum="& request("pagenum")
                Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
	    End If
End Sub

sub list()
		admin_flag=",4.4,"
		If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
				adminflag()
		End If
		page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		keyword = safereplace(request("keyword"))
		datefrom = safeReplace(request("datefrom"))
		dateto = safeReplace(request("dateto"))
		state = safeReplace(request("state"))
		user_id = safeReplace(request("user_id"))
		Dim ors
		Set ors=new Cls_vbsPage
		Set ors.Conn=conn
		With ors
		.PageSize=pagenum
		.PageName="Page"
		If IsSqlDataBase = 0 Then
				.DbType="AC"
		Else
				.DbType="MSSQL"
		End If
		.RecType=-1
		.Pkey="m_id"
		.Field="m_order_num,m_user_id,m_price,m_type,m_sj,m_zt,m_content"
		.Table="[Lebi_money_log]"
		sql = "1=1"
		If user_id <> "" Then sql=sql + " and m_user_id = '"& user_id &"'"
        if keyword <>"" then sql=sql + " and (m_user_id like '%"& keyword &"%' or m_order_num like '%"& keyword &"%' or m_content like '%"& keyword &"%')"
		If state <> "" Then sql = sql &" and m_zt = "& CLng(state) &""
		If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,m_sj,'"& datefrom &"')<=0 and DateDiff(d,m_sj,'"& dateto &"')>=0"
		If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',m_sj,'"& datefrom &"')<=0 and DateDiff('d',m_sj,'"& dateto &"')>=0"
		.Condition=sql
		.OrderBy="m_id desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" src="inc/js/MyCalendar.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
	<form name="form" action="?" method="post">
	<td height="30" align="left" class="classhead">
	<table border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td>
	<select name="state"><option value="">┌ <%=Lang_User(64)%></option><option value="0"<%=judge2(0,state)%>>├ <%=Lang_User(65)%></option><option value="1"<%=judge2(1,state)%>>├ <%=Lang_User(66)%></option></select></td>
	<td style="padding-left:5px;"><input type="text" name="dateFrom" value="<%=dateFrom%>" size="12" class="form_calendar" onclick="setday(this)" /> - <input type="text" name="dateTo" value="<%=dateTo%>" size="12" class="form_calendar" onclick="setday(this)" /></td>
	<td style="padding-left:5px;"><input name="keyword" value="<%= keyword %>" type="text" class="form_query" size="10"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="pagenum" value="<%= pagenum %>"></td>
	</tr>
	</table>
	</td>
	</form>
	<td height="30" align="right" class="classhead">
	<%=QuickMenu("Home_users.asp|"& Lang_Menu(105) &"","Admin_user_account.asp|"& Lang_Menu(106) &"")%>
	</td>
</tr>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="list" class="classtable2">
<tbody>
<form name="Lebi" method="post" action="?action=del">
<tr>
<td height="30"class="classhead" align="left">
<input type="button" value="<%=Lang_User(67)%>" onClick="location.href='?action=del&user_id=<%=user_id%>&pagenum=<%=pagenum%>'" class="button" />
</td>
<td height="30" class="classhead" align="right" colspan="5"><%=ors.ShowPageHead(page)%></td>
</tr>
<tr>
<td class="classtop" width="20%" height="30"><%=Lang_User(68)%></td>
<td class="classtop" width="15%"><%=Lang_User(45)%></td>
<td class="classtop" width="10%"><%=Lang_User(69)%></td>
<td class="classtop" width="30%"><%=Lang_User(70)%></td>
<td class="classtop" width="20%"><%=Lang_User(71)%></td>
<td class="classtop" width="5%"><%=Lang_User(64)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
<tr class="classrow">
<td height="30" class="classrow"><%=DataList(0,i)%></td>
<td class="classrow"><%=DataList(1,i)%></td>
<td class="classrow"><%=formatnumber2(DataList(2,i))%></td>
<td class="classrow"><%=DataList(3,i)%></td>
<td class="classrow"><%=DataList(4,i)%></td>
<td class="classrow"><%If DataList(5,i)=1 Then response.write"<strong><font color=red>√</font></strong>" Else response.write"<strong>×</strong>" End If %>
</td>
</tr>
<%If Trim(DataList(6,i))<>"" then%>
<tr class="classrow">
<td class="classrow" colspan="6"><%=Lang_User(72)%><%=DataList(6,i)%></td>
</tr>
<%
End if
        Next
End If
%>
</form>
<tr>
	<td height="30" class="classfooter"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="6"><%=ors.ShowPageFoot(page)%></td>
</tr>
</tbody>
</table>
<script>tdshow("list");</script>
<%
end Sub
%>