pay.php
2.36 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
<?php
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/q_functions.php");
require("../member/class/user.php");
eCheckCloseMods('pay');//關閉模塊
$link=db_connect();
$empire=new mysqlquery();
$money=(float)$_POST['money'];
if($money<=0)
{
printerror('支付金額不能為0','',1,0,1);
}
$payid=(int)$_POST['payid'];
if(!$payid)
{
printerror('請選擇支付平台','',1,0,1);
}
$payr=$empire->fetch1("select * from {$dbtbpre}enewspayapi where payid='$payid' and isclose=0");
if(!$payr[payid])
{
printerror('請選擇支付平台','',1,0,1);
}
$ddno='';
$productname='';
$productsay='';
$phome=$_POST['phome'];
if($phome=='PayToFen')//購買點數
{
$productname='購買點數';
}
elseif($phome=='PayToMoney')//存預付款
{
$productname='存預付款';
}
elseif($phome=='ShopPay')//商城支付
{
$productname='商城支付';
}
else
{
printerror('您來自的鏈接不存在','',1,0,1);
}
include('payfun.php');
if($phome=='PayToFen'||$phome=='PayToMoney')
{
$user=islogin();//是否登陸
$pr=$empire->fetch1("select paymoneytofen,payminmoney from {$dbtbpre}enewspublic limit 1");
if($money<$pr['payminmoney'])
{
printerror('金額不能小於 '.$pr['payminmoney'].' 元','',1,0,1);
}
$productname.=",UID:".$user['userid'].",UName:".$user['username'];
$productsay="用戶ID:".$user['userid'].",用戶名:".$user['username'];
}
elseif($phome=='ShopPay')
{
$ddid=(int)getcvar('paymoneyddid');
$ddr=PayApiShopDdMoney($ddid);
if($money!=$ddr['tmoney'])
{
printerror('訂單金額有誤','',1,0,1);
}
$ddno=$ddr[ddno];
$productname="支付訂單號:".$ddno;
$productsay="訂單號:".$ddno;
}
esetcookie("payphome",$phome,0);
//返回地址前綴
$PayReturnUrlQz=$public_r['newsurl'];
if(!stristr($public_r['newsurl'],'://'))
{
$PayReturnUrlQz=eReturnDomain().$public_r['newsurl'];
}
//編碼
if($ecms_config['sets']['pagechar']!='gb2312')
{
@include_once("../class/doiconv.php");
$iconv=new Chinese('');
$char=$ecms_config['sets']['pagechar']=='big5'?'BIG5':'UTF8';
$targetchar='GB2312';
$productname=$iconv->Convert($char,$targetchar,$productname);
$productsay=$iconv->Convert($char,$targetchar,$productsay);
@header('Content-Type: text/html; charset=gb2312');
}
$file=$payr['paytype'].'/to_pay.php';
@include($file);
db_close();
$empire=null;
?>