⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_payment.asp

📁 正版创力4.1SQL商业版!!!ASP版。
💻 ASP
字号:
<!--#include file="Inc/Const.asp"-->
<%
if Cl.Admin_Purview(0)<>1 then Cl.ShowErr("<li>您无此操作权限!</li>")
const PageSize=20
dim Action,PaymentID,SearchType,Field,Keyword
Action		= Trim(request("Action"))
PaymentID	= Trim(request("PaymentID"))
CurrentPage	= Cl.GetClng(request("page"))
SearchType	= Cl.GetClng(request("SearchType"))
Field		= Trim(request("Field"))
Keyword		= Trim(request("Keyword"))
FileName = "Admin_Payment.asp?SearchType="&SearchType&"&Field="&Field&"&Keyword="&Keyword&""
Header
%>
<script language="JavaScript" type="text/javascript">
function unselectall(){
    if(document.myform.chkAll.checked){
 document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    }
}
function CheckAll(form){
  for (var i=0;i<form.elements.length;i++){
    var e = form.elements[i];
    if (e.name != 'chkAll'&&e.disabled==false)
       e.checked = form.chkAll.checked;
    }
  }
function ConfirmDel(){
 if(document.myform.Action.value=='Del'){
     if(confirm('确定要删除选中的在线支付记录吗?'))
         return true;
     else
         return false;
 }
}
</script>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">  
	<tr class="title">     
		<td height="22" colspan="2" align="center"><b>在 线 支 付 记 录 管 理</b></td>  
	</tr>    
	<tr class="tdbg" height="30">
	<form action="Admin_Payment.asp" method="get" name="form1" id="form1">
		<td>快速查找:
		<select size="1" name="SearchType" id="SearchType" onChange="javascript:submit()">
		<option value="1">所有在线支付记录</option>
		<option value="2">今 天 的支付记录</option>
		<option value="3">本 周 的支付记录</option>
		<option value="4">本 月 的支付记录</option>
		<option value="5">三个月内的支付记录</option>
		<option value="6">支 付 失败的记录</option>
		<option value="7" selected="selected">支 付 成功的记录</option>
		</select>&nbsp;&nbsp;&nbsp;&nbsp;<a href="Admin_Payment.asp">在线支付记录首页</a></td>
	</form>
	<form action="Admin_Payment.asp" method="post" name="form2" id="form2">
		<td>高级查询:
		<select name="Field" id="Field">
		<option value="PaymentID">支付ID</option>
		<option value="PaymentNum" selected="selected">支付编号</option>
		<option value="UserID">用户ID</option>
		<option value="UserName">用户名</option>
		</select>
		<input name="Keyword" type="text" id="Keyword" size="20" maxlength="30" />
		<input type="submit" name="Submit2" value=" 查 询 " />
		<input name="SearchType" type="hidden" id="SearchType" value="8" /> 
		</td>
	</form>
	</tr>
</table>
<script language="JavaScript" type="text/javascript">
CheckSel('SearchType','<%=SearchType%>');
</script>
<br />
<%
Select Case Action
Case "Del"
   Call DelPayment()
Case "Success"
   Call Success()
Case "NoSuccess"
   Call NoSuccess()
Case else
   Call Main()
end Select
if FoundErr=True then Cl.ShowErr(ErrMsg)
%>
<p>&nbsp;&nbsp;<b><font color="blue">支付成功说明:</font></b>
①--常规支付接口处理的结果,
②--自动对账接口处理的结果,
③--手动设置成功处理的结果。</p>
<%
Footer
Sub Main()
	SQL="Select PaymentID,UserID,UserName,OrderID,PaymentNum,eBankID,PayMoney,TrueMoney,PayTime,Status,eBankInfo,Remark from Cl_Payment "
	Select Case SearchType
	Case 0
		SQL=SQL & " where Status=1 order by PaymentID Desc"
	Case 1
		SQL=SQL & " order by PaymentID Desc"
	Case 2
		If IsSqlDataBase=1 Then
			SQL=SQL & " where datediff(d,PayTime," & SqlNowString & ")<1 order by PaymentID Desc"
		else
			SQL=SQL & " where datediff('d',PayTime," & SqlNowString & ")<1 order by PaymentID Desc"
		end if
	Case 3
		If IsSqlDataBase=1 Then
			SQL=SQL & " where datediff(week,PayTime," & SqlNowString & ")<1 order by PaymentID Desc"
		else
			SQL=SQL & " where datediff('w',PayTime," & SqlNowString & ")<1 order by PaymentID Desc"
		end if
	Case 4
		If IsSqlDataBase=1 Then
			SQL=SQL & " where datediff(month,PayTime," & SqlNowString & ")<1 order by PaymentID Desc"
		else
			SQL=SQL & " where datediff('m',PayTime," & SqlNowString & ")<1 order by PaymentID Desc"
		end if
	Case 5
		If IsSqlDataBase=1 Then
			SQL=SQL & " where datediff(month,PayTime," & SqlNowString & ")<3 order by PaymentID Desc"
		else
			SQL=SQL & " where datediff('m',PayTime," & SqlNowString & ")<3 order by PaymentID Desc"
		end if
	Case 6
		SQL=SQL & " where Status=0 order by PaymentID Desc"
	Case 7
		SQL=SQL & " where Status=1 order by PaymentID Desc"
	Case 8
		If Keyword="" Then
			Cl.ShowErr("错误,关键字不能为空!")
		End if
		Keyword=Cl.ReplaceBadChar(Keyword)
		SQL=SQL & " where "
		Select Case Field
		Case "PaymentID"
			SQL=SQL & "PaymentID="&Cl.GetClng(Keyword)&" "
		Case "PaymentNum"
			SQL=SQL & "PaymentNum Like '%"&Keyword&"%' "
		Case "UserID"
			SQL=SQL & "UserID="&Cl.GetClng(Keyword)&" "
		Case "UserName"
			SQL=SQL & "UserName Like '%"&Keyword&"%' "
		Case Else
			SQL=SQL & "PaymentNum Like '%"&Keyword&"%' "
		End Select
		SQL=SQL & " Order by PaymentID Desc"
	Case Else
		SQL=SQL & " Order by PaymentID Desc"
	End Select
	Set rs= Server.CreateObject("ADODB.Recordset")
	OpenConn : rs.open sql,Conn,1,1
	if rs.eof and rs.bof then
		TotalPut=0
		response.write "<p align='center'><br />暂时没有在线支付记录!<br /></p>"
		rs.close:set rs=Nothing:Exit Sub
	End if
   	TotalPut=rs.recordcount
   	if (TotalPut mod PageSize)=0 then
    	TotalPages = TotalPut \ PageSize
	else
	  	TotalPages = TotalPut \ PageSize + 1
	end if
	if CurrentPage > TotalPages then CurrentPage=TotalPages
	if CurrentPage < 1 then CurrentPage=1
   	rs.move (CurrentPage-1)*PageSize
	SQL = rs.GetRows(PageSize)
	rs.close:set rs=Nothing
	%>

<table width="100%" border="0" cellpadding="2" cellspacing="1" class="border" align="center">
<form action="Admin_Payment.asp" method="post" name="myform" id="myform" onsubmit="return confirm('确定要删除选定的在线支付记录吗?');">
	<tr align="center" class="title">
		<td width="30">选中</td>
		<td width="120">支付编号</td>
		<td width="60">客户姓名</td>
		<td width="120">交易时间</td>
		<td width="80">汇款金额</td>
		<td width="80">实际金额</td>
		<td width="60">交易状态</td>
		<td>银行信息</td>
		<td width="80">操作</td>
	</tr>
	<%
	'PaymentID,UserID,UserName,OrderID,PaymentNum,eBankID=5,PayMoney,TrueMoney,PayTime,Status,eBankInfo=10,Remark
	For i=0 to Ubound(SQL,2)
%>
<tr class="tdbg" onMouseOut="this.className='tdbg';showlayer('pay<%=SQL(0,i)%>','0');" onMouseOver="this.className='tdbg2';showlayer('pay<%=SQL(0,i)%>','1');">
	<td width="30" align="center"><input name="PaymentID" type="checkbox" onclick="unselectall()" id="PaymentID" value="<%=SQL(0,i)%>" <%if SQL(9,i)=1 then%>disabled<%end if%>></td>
	<td width="120" align="center"><%=SQL(4,i)%>
	<span id="pay<%=SQL(0,i)%>" class="hidden" style="width:200px;">
		<%=SQL(11,i)%>
	</span></td>
	<td width="60" align="center"><a href="Admin_User.asp?Action=Modify&UserID=<%=SQL(1,i)%>"><%=SQL(2,i)%></a></td>
	<td width="120" align="center"><%=SQL(8,i)%></td>
	<td width="80" align="right"><%=Cl.FormatNum(SQL(6,i),2)%></td>
	<td width="80" align="right"><%=Cl.FormatNum(SQL(7,i),2)%></td>
	<td width="60" align="center"><%
	if SQL(9,i)=1 then
		response.write "<font color=""blue"">支付成功</font>"
	else
		response.write "<font color=""red"">支付失败</font>"
	end if
	%></td>
	<td align="center"><%=SQL(10,i)%></td>
	<td width="80" align="center"><%
	if SQL(9,i)<>1 then
		response.write "<a href=""Admin_Payment.asp?Action=Success&PaymentID="&SQL(0,i)&""" onclick=""return confirm('确定这条在线支付记录已经支付成功了吗?');"">成功</a> <a href=""Admin_Payment.asp?Action=Del&PaymentID="&SQL(0,i)&""" onclick=""return confirm('确定要删除这条在线支付记录吗?');"">删除</a> "
	else
		response.write "<a href=""Admin_Payment.asp?Action=NoSuccess&PaymentID="&SQL(0,i)&""" onclick=""return confirm('确定这条在线支付记录未支付成功吗?');"">取消成功</a>"
	end if%></td>
</tr>
<%
	Next
%>
  <tr class="tdbg">
    <td height="30" colspan="3"><input name="chkAll" type="checkbox" id="chkAll" onclick="CheckAll(this.form)" value="checkbox" /> 
    选中本页显示的所有在线支付记录</td>            
	<td colspan="6"><input name="Action" type="hidden" id="Action" value="Del" /> 
	<input type="submit" name="Submit" value="删除选定的在线支付记录" /></td>
  </tr>
  </form>
</table>
<%
	Response.write Cl.ShowPage(FileName,TotalPut,PageSize,"条","记录")
	SQL=Empty
End Sub

Sub DelPayment()
	if Clng(Cl.Admin_Purview(0))<>1 then
		Cl.ShowErr("<br /><li>对不起,你的权限不够!</li>")
	end if
	if PaymentID="" then
		Cl.ShowErr("<br /><li>请先选择要删除的订单ID!</li>")
	end if
	if instr(PaymentID,",")>0 then
		PaymentID=replace(PaymentID," ","")
		Cl.Execute("delete from Cl_Payment where PaymentID in (" & PaymentID & ")")
	else
		PaymentID=Cl.GetClng(PaymentID)
		Cl.Execute("delete from Cl_Payment where PaymentID = " & PaymentID & " ")
	end if
	Cl.SaveAdminLog
	Call Cl.OutMsg(0,"操作成功,所选订单已被删除!",ComeUrl)
End Sub
Sub Success()
	PaymentID=Cl.GetClng(PaymentID)
	Dim sUID,rsPay,Rs,SQL
	Dim sUserID,sOrderID,sMoney,remark1
	Set rsPay = Server.CreateObject("Adodb.recordSet")
	SQL="Select * From Cl_Payment where PaymentID="&PaymentID&""
	OpenConn : rsPay.Open SQL,Conn,1,3
	if rsPay.Bof and rsPay.Eof then
		rsPay.Close:Set rsPay=Nothing
		Cl.ShowErr("<br /><b>找不到订单!</b>")
	End if
	If rsPay("Status")=1 then
		rsPay.Close:Set rsPay=Nothing
		Cl.ShowErr("支付已经完成,用户已经取货!")
	End if
	sUserID		= Clng(rsPay("UserID"))
	sOrderID	= Clng(rsPay("OrderID"))
	sMoney		= Cl.FormatNum(rsPay("PayMoney"),2)
	Set Rs=Server.CreateObject("Adodb.recordSet")
	if sOrderID > 0 then	'订单ID大于0的处理
		SQL="Select OrderID,UserID,MoneyReceipt,PresentExp,Status From Cl_Order Where OrderID="&sOrderID&" and Status<2"
		Rs.Open SQL,Conn,1,3
		if Not (Rs.Bof and Rs.Eof) then
			Rs(2) = Rs(2) + sMoney
			Rs(4) = 2
			Rs.Update
			if Rs(3)>0 then Cl.Execute_U("Update "&Db.UserTable&" Set TotalExp=TotalExp+"&Rs(3)&" where UserID="&Rs(1)&"")
			remark1="订单ID("&sOrderID&")支付完成,系统自动已赠送ID为("&Rs(1)&")的用户 "&Rs(3)&"积分。"
		else
			remark1="系统找不到对应订单号,所以无法自动处理订单。"
		End if
		Rs.Close
	Elseif sUserID > 0 then '订单ID=0,用户ID大于0的处理
		SQL="Select "&Db.UserID&","&Db.UserName&","&Db.UserPoint&","&Db.UserMoney&" From "&Db.UserTable&" where UserID="&sUserID&""
		OpenConn_U : Rs.Open SQL,Conn_U,1,3
		if Not (Rs.Bof and Rs.Eof) then
			Rs(Db.UserMoney)=Rs(Db.UserMoney) + sMoney
			Rs.UpDate
			remark1="系统已自动在其对应账户("&Rs(Db.UserName)&")上添加"&Cl.Web_Setting(26)&":"&sMoney&""&Cl.Web_Setting(27)&"。"

		end if
		Rs.Close
	Else	'游客支付的处理
		remark1="系统未作任何处理。"
	End if
	Set Rs=Nothing
	remark1	= rsPay("Remark") & remark1
	'rsPay("TrueMoney")	= v_amount
	rsPay("eBankInfo")	= "③支付成功"
	rsPay("Status")		= 1
	rsPay("Remark")		= remark1
	rsPay.Update
	Cl.Execute("insert into Cl_BankrollItem (UserID,UserName,PayMoney,TrueMoney,PayType,CurrencyType,BankName,ItemType,OrderID,PaymentID,Remark,AddTime) " & _
	"values ("&sUserID&",'"&rsPay("UserName")&"',"&rsPay("TrueMoney")&","&sMoney&",3,0,'',0,"&sOrderID&","&PaymentID&",'"&remark1&"','"&now()&"')")
	rsPay.Close:Set rsPay=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg(0,"恭喜您,操作成功!操作信息如下:\n"&remark1&"",ComeUrl)
End Sub
Sub NoSuccess()
	PaymentID=Cl.GetClng(PaymentID)
	Dim sUID,rsPay,Rs,SQL
	Dim sUserID,sOrderID,sMoney,remark1
	Set rsPay = Server.CreateObject("Adodb.recordSet")
	SQL="Select * From Cl_Payment where PaymentID="&PaymentID&""
	OpenConn : rsPay.Open SQL,Conn,1,3
	if rsPay.Bof and rsPay.Eof then
		rsPay.Close:Set rsPay=Nothing
		Cl.ShowErr("<br /><b>找不到订单!</b>")
	End if
	If rsPay("Status")=0 then
		rsPay.Close:Set rsPay=Nothing
		Cl.ShowErr("支付本身未完成,不用取货!")
	End if
	sUserID		= Clng(rsPay("UserID"))
	sOrderID	= Clng(rsPay("OrderID"))
	sMoney		= Cl.FormatNum(rsPay("PayMoney"),2)
	Set Rs=Server.CreateObject("Adodb.recordSet")
	if sOrderID > 0 then	'订单ID大于0的处理
		SQL="Select OrderID,UserID,MoneyReceipt,PresentExp,Status From Cl_Order Where OrderID="&sOrderID&" and Status<2"
		Rs.Open SQL,Conn,1,3
		if Not (Rs.Bof and Rs.Eof) then
			Rs(2) = Rs(2) - sMoney
			Rs(4) = 0
			Rs.Update
			if Rs(3)>0 then Cl.Execute_U("Update "&Db.UserTable&" Set TotalExp=TotalExp-"&Rs(3)&" where UserID="&Rs(1)&"")
			remark1="对应该订单ID("&sOrderID&")由于支付失败,系统自动减去ID为("&Rs(1)&")的用户 "&Rs(3)&"积分。"
		else
			remark1="系统找不到对应订单号,所以无法自动处理订单。"
		End if
		Rs.Close
	Elseif sUserID > 0 then '订单ID=0,用户ID大于0的处理
		SQL="Select * From "&Db.UserTable&" where UserID="&sUserID&""
		OpenConn_U : Rs.Open SQL,Conn_U,1,3
		if Not (Rs.Bof and Rs.Eof) then
			Rs("UserMoney")=Rs("UserMoney") - sMoney
			Rs.UpDate
			remark1="由于支付失败,系统已自动在对应账户("&Rs("UserName")&")上减去"&Cl.Web_Setting(26)&":"&sMoney&""&Cl.Web_Setting(27)&"。"
		end if
		Rs.Close
	Else	'游客支付的处理
		remark1="系统未作任何处理。"
	End if
	Set Rs=Nothing
	remark1	= rsPay("Remark") & remark1
	'rsPay("TrueMoney")	= v_amount
	rsPay("eBankInfo")	= "③支付失败"
	rsPay("Status")		= 0
	rsPay("Remark")		= remark1
	rsPay.Update
	Cl.Execute("delete from Cl_BankrollItem where PaymentID="&PaymentID&"")
	rsPay.Close:Set rsPay=Nothing
	Cl.SaveAdminLog
	Call Cl.OutMsg(0,"恭喜您,操作成功!操作信息如下:\n"&remark1&"",ComeUrl)
End Sub
%>
<!--
'┌───────────────────────────────────────────────────────┐
'│														 │
'│		CreateLive CMS Version 4.0						 │
'│        				Powered by Aspoo.CN	 	 │
'│ 		          						 │
'│ 	邮箱: support@aspoo.cn		Info@aspoo.cn  	 │
'│		QQ: 3315263				596197794			 │
'│		网站: www.aspoo.cn			www.aspoo.com		 │
'│		论坛: bbs.aspoo.cn			bbs.aspoo.com		 │
'│														 │
'│	Copyright (C) 2005-2007 Aspoo.CN All Rights Reserved.	 │
'└───────────────────────────────────────────────────────┘
'-->

⌨️ 快捷键说明

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