<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/Lebi_Config.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_payment_inform.asp
'* 最后更新 2011-06-22 by 56770.kingdge
'*****************************************
Dim admin_flag
admin_flag=",1.7,"
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_payment.inc"
CurrentId = 2
CurrentUrl = "admin_payment_inform.asp"
LB_Head()
LB_Menu()
Response.Write("<div class=""mainbody"">")
Response.Write("<div class=""mainbody2"">")
If Eshop_Lebi_name="" Or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 Then
		adminflag()
Else
		If OutSubmit = 1 Then CheckOutSubmit()
		Select Case request("action")
			   case"list": list()
			   case"del" : del()
			   case"modi" : modi()
			   Case Else
					main()
		End Select
End If
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

Sub del()
        If OnlyRead = 1 Then OnlyReadMessage()
		id=safereplace(request("id"))
		if id="" then
			   response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
			   response.end
		end if
		conn.execute("Delete from [Lebi_payment_inform] where id in("&id&")")
		ManageLog Lang_Payment(1) &" ["&id&"]"
		m_u = "?page="& request("page") &"&pagenum="& request("pagenum") &"&state="& request("state") &"&keyword="& request("keyword") &"&DateFrom="& request("DateFrom") &"&DateTo="& request("DateTo")
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
End Sub

Sub modi()
        If OnlyRead = 1 Then OnlyReadMessage()
		id = CheckNum(request("id"),0)
		payment_state = CheckNum(request("payment_state"),0)
		Set rs = server.CreateObject("adodb.recordset")
		rs.open "select payment_state,payment_type,payment_money,user_id,payment_info from [Lebi_payment_inform] where id ="&id,conn,1,3
		rs(0) = payment_state
		payment_info = rs(4)
		rs.update
				Set rsuser = conn.execute("Select user_name,user_mobile,LangTxt from [lebi_User] where user_id = '"& rs(3) &"'")
				If Not rsuser.eof Then
						user_name = rsuser(0)
						user_mobile = rsuser(1)
						LangTxt = rsuser(2)
				End If
				rsuser.close : Set rsuser = Nothing
				If SMS_State = "1" Then
						If CheckMobile(user_mobile) And payment_state = 1 Then
								If InStr(","& SMS_SendMode &",",",5,") > 0 Then
										Dim LoadSMSInfo,SMSMsg
										LoadSMSInfo = LoadStyle("../include/lebi_data/SMS"& LangTxt &".data")
										SMSMsg = splits(Split(LoadSMSInfo,"@@@")(4))
										ReplaceStyle "user_id",rs(3),SMSMsg
										ReplaceStyle "user_name",user_name,SMSMsg
										ReplaceStyle "time",Now(),SMSMsg
										ReplaceStyle "paymentype",rs(1),SMSMsg
										ReplaceStyle "money",rs(2),SMSMsg
										Call RedirectSendSMS(user_mobile,SMSMsg,"payment_info_success","",sms_sendtype)
		'								code = newclient.getCode()
		'								If code <> "2000" Then
		'										m_s = m_s &"<br/>·手机短信发送失败！"
		'								Else
		'										m_s = m_s &"<br/>·手机短信发送成功！"
		'								End If
								End If
						End If
				End If
		rs.close : Set rs= Nothing
		ManageLog Lang_Payment(2) &" ["&payment_info&"]"
	    Call Up_mes(Lang_sys(69),"·"& Lang_sys(68),0,m_u,0,0,2,1)
End Sub

Sub main()
		state = safeReplace(request("state"))
		pagenum = CheckNum(request("pagenum"),15)
		datefrom = safeReplace(request("datefrom"))
		dateto = safeReplace(request("dateto"))
		keyword = safeReplace(request("keyword"))
		page = checknum(request("page"),1)
		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="id"
		.Field="id,orders_id,user_id,payment_type,payment_money,payment_time,payment_state"
		.Table="[Lebi_payment_inform]"
		sql = "1=1"
		if keyword<>"" then sql=sql&" and (orders_id like '%"&keyword&"%' or user_id like '%"&keyword&"%' or payment_type like '%"&keyword&"%' )"
		If state<>"" Then sql=sql&" and payment_state="& CLng(state)
		If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,payment_time,'"& datefrom &"')<=0 and DateDiff(d,payment_time,'"& dateto &"')>=0"
		If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',payment_time,'"& datefrom &"')<=0 and DateDiff('d',payment_time,'"& dateto &"')>=0"
		.Condition=sql
		.OrderBy="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="Lebi" method="get" action="?">
<td height="30" align="left" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
	<select name="state">
	<option value="">┌ <%=Lang_Payment(3)%></option>
	<option value="0"<%=judge2(0,state)%>>├ <%=Lang_Payment(4)%></option>
	<option value="1"<%=judge2(1,state)%>>├ <%=Lang_Payment(5)%></option>
	<option value="2"<%=judge2(2,state)%>>├ <%=Lang_Payment(6)%></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" type="text" title="<%=Lang_Payment(7)%>" class="form_query" size="15"><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 class="classhead" align="right">
<%=QuickMenu("Admin_sh.asp|"& Lang_Menu(99) &"","Admin_Ship.asp|"& Lang_Menu(100) &"")%>
</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" colspan="2">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('<%=Lang_sys(64)%>')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="hidden" name="page" value="<%=page%>">
<input type="hidden" name="state" value="<%=state%>">
<input type="hidden" name="keyword" value="<%=keyword%>">
<input type="hidden" name="dateFrom" value="<%=dateFrom%>">
<input type="hidden" name="dateTo" value="<%=dateTo%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
<td class="classhead" align="right" colspan="6"><%=ors.ShowPageHead(page)%></td>
</tr>
  <tr>
     <td width="5%" height="30" class="classtop" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
     <td width="15%" class="classtop"><%=Lang_Payment(8)%></td>
     <td width="15%" class="classtop"><%=Lang_Payment(9)%></td>
     <td width="20%" class="classtop"><%=Lang_Payment(10)%></td>
	 <td width="10%" class="classtop"><%=Lang_Payment(11)%></td>
     <td width="15%" class="classtop"><%=Lang_Payment(12)%></td>
	 <td width="10%" class="classtop"><%=Lang_Payment(3)%></td>
     <td width="6%" class="classtop"><%=Lang_Payment(13)%></td>
  </tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
  <tr class="classrow">
    <td height="30" class="classrow"><input type="checkbox" name="id" value="<%=DataList(0,i)%>"></td>
    <td class="classrow"><a href="?action=list&id=<%=DataList(0,i)%>"><%=DataList(1,i)%></a></td>
    <td class="classrow"><%=DataList(2,i)%></td>
	<td class="classrow"><%=DataList(3,i)%></td>
	<td class="classrow"><%=DataList(4,i)%></td>
    <td class="classrow"><%=DataList(5,i)%></td>
	<td class="classrow"><%
	Select Case DataList(6,i)
		   Case "0" response.write Lang_Payment(4)
		   Case "1" response.write Lang_Payment(5)
		   Case "2" response.write Lang_Payment(6)
	End Select
	%></td>
	<td class="classrow"><a href="?action=list&id=<%=DataList(0,i)%>"><img src="images/icon_edit.gif" width="16" height="16" title="<%=Lang_sys(51)%>" border="0"></a></td>
  </tr>
<%
        Next
End If
%>
</form>
<tr>
	<td height="30" class="classfooter" colspan="2"><%=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%>

<%
Sub list  'WangLei 2008-1-15
id = CheckNum(request("id"),0)
set rs = conn.execute("select * from [Lebi_payment_inform] where id="&id&" ")
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="view" class="classtable">
<form method="POST" action="?action=modi&id=<%=id%>">
<tr>
	<td height="30" align="left" class="classhead">
	<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
	</td>
	<td class="classhead" align="right">
	<%=QuickMenu("","")%>
	</td>
</tr>
<tr>
 <td height="30" class="classtop" colspan="2"><%=Lang_Menu(55)%></td>
</tr>
<%
If rs.eof then
       response.write"<tr><td colspan='2' align='center' height='30' bgcolor='#FFFFFF'>ERROR</td></tr>"
Else
%>
		<tr class="classrow">
		  <td width="15%" height="30" class="classrow"><%=Lang_Payment(14)%></td>
		  <td class="classrow"><%=rs("orders_id")%> </td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_Payment(15)%></td>
		  <td class="classrow"><%=rs("user_id")%></td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_Payment(16)%></td>
		  <td class="classrow"><%=rs("payment_type")%></td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_Payment(17)%></td>
		  <td class="classrow"><%=rs("payment_money")%></td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_Payment(18)%></td>
		  <td class="classrow"><%=rs("payment_time")%></td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_Payment(19)%></td>
		  <td class="classrow"><%=rs("payment_info")%></td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_Payment(20)%></td>
		  <td class="classrow">
			<input type="radio" name="payment_state" value="0" <%if rs("payment_state")=0 then response.write "checked" end if%>>
			<%=Lang_Payment(4)%>
			<input type="radio" name="payment_state" value="1" <%if rs("payment_state")=1 then response.write "checked" end if%>>
			<%=Lang_Payment(5)%>
			<input type="radio" name="payment_state" value="2" <%if rs("payment_state")=2 then response.write "checked" end if%>>
			<%=Lang_Payment(6)%>
		  </td>
		</tr>
		<tr>
			<td height="30" colspan="2" align="left" class="classfooter">
			<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
			</td>
		</tr>
		</form>
</table>
<script>tdshow("view");</script>
<%
End If
rs.close:Set rs=Nothing
%>
<%End sub%>