PayApi.php
4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
define('EmpireCMSAdmin','1');
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//驗證用戶
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
//驗證權限
CheckLevel($logininid,$loginin,$classid,"pay");
//設置接口
function EditPayApi($add,$userid,$username){
global $empire,$dbtbpre;
$add[payid]=(int)$add[payid];
if(empty($add[payname])||!$add[payid])
{
printerror("EmptyPayApi","history.go(-1)");
}
$add[isclose]=(int)$add[isclose];
$add[myorder]=(int)$add[myorder];
$add[paymethod]=(int)$add[paymethod];
$sql=$empire->query("update {$dbtbpre}enewspayapi set isclose='$add[isclose]',payname='$add[payname]',paysay='$add[paysay]',payuser='$add[payuser]',paykey='$add[paykey]',payfee='$add[payfee]',payemail='$add[payemail]',myorder='$add[myorder]',paymethod='$add[paymethod]' where payid='$add[payid]'");
if($sql)
{
//操作日誌
insert_dolog("payid=".$add[payid]."<br>payname=".$add[payname]);
printerror("EditPayApiSuccess","PayApi.php".hReturnEcmsHashStrHref2(1));
}
else
{
printerror("DbError","history.go(-1)");
}
}
//支付參數設置
function SetPayFen($add,$userid,$username){
global $empire,$dbtbpre;
$add[paymoneytofen]=(int)$add[paymoneytofen];
$add[payminmoney]=(int)$add[payminmoney];
if(empty($add[paymoneytofen]))
{
printerror("EmptySetPayFen","history.go(-1)");
}
$sql=$empire->query("update {$dbtbpre}enewspublic set paymoneytofen='$add[paymoneytofen]',payminmoney='$add[payminmoney]'");
if($sql)
{
//操作日誌
insert_dolog("moneytofen=$add[paymoneytofen]&minmoney=$add[payminmoney]");
printerror("SetPayFenSuccess","SetPayFen.php".hReturnEcmsHashStrHref2(1));
}
else
{
printerror("DbError","history.go(-1)");
}
}
$enews=$_POST['enews'];
if(empty($enews))
{$enews=$_GET['enews'];}
if($enews)
{
hCheckEcmsRHash();
}
//增加用戶
if($enews=="EditPayApi")
{
EditPayApi($_POST,$logininid,$loginin);
}
elseif($enews=="SetPayFen")
{
SetPayFen($_POST,$logininid,$loginin);
}
$sql=$empire->query("select payid,paytype,payfee,paylogo,paysay,payname,isclose from {$dbtbpre}enewspayapi order by myorder,payid");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>支付接口</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td width="50%">位置:在線支付> <a href="PayApi.php<?=$ecms_hashur['whehref']?>">管理支付接口</a> </td>
<td><div align="right" class="emenubutton">
<input type="button" name="Submit5" value="管理支付記錄" onclick="self.location.href='ListPayRecord.php<?=$ecms_hashur['whehref']?>';">
<input type="button" name="Submit52" value="支付參數設置" onclick="self.location.href='SetPayFen.php<?=$ecms_hashur['whehref']?>';">
</div></td>
</tr>
</table>
<br>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr class="header">
<td width="15%"><div align="center">接口名稱</div></td>
<td width="47%"><div align="center">接口描述</div></td>
<td width="7%"><div align="center">狀態</div></td>
<td width="12%" height="25"><div align="center">接口類型</div></td>
<td width="11%" height="25"><div align="center">操作</div></td>
</tr>
<?
while($r=$empire->fetch($sql))
{
if($r[paytype]=='alipay')
{
$r[payname]="<font color='red'><b>".$r[payname]."</b></font>";
}
?>
<tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
<td height="38" align="center">
<?=$r[payname]?>
</td>
<td>
<?=$r[paysay]?>
</td>
<td><div align="center">
<?=$r[isclose]==0?'開啟':'關閉'?>
</div></td>
<td height="25"> <div align="center">
<?=$r[paytype]?>
</div></td>
<td height="25"> <div align="center"><a href="SetPayApi.php?enews=EditPayApi&payid=<?=$r[payid]?><?=$ecms_hashur['ehref']?>">配置接口</a></div></td>
</tr>
<?
}
db_close();
$empire=null;
?>
</table>
</body>
</html>