| Server IP : 156.238.232.47 / Your IP : 216.73.216.150 Web Server : nginx/1.25.3 System : Linux C202504152095410 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : www ( 1000) PHP Version : 8.3.25 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/data/wwwroot/2026_06_02_05/source/function/ |
Upload File : |
<?php
/**
* [Discuz!] (C)2001-2099 Discuz! Team
* This is NOT a freeware, use is subject to license terms
* https://license.discuz.vip
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$apitype = empty($apitype) || !preg_match('/^[a-z0-9]+$/i', $apitype) ? 'alipay' : $apitype;
require_once DISCUZ_ROOT.'./api/trade/api_'.$apitype.'.php';
function trade_offline($tradelog, $returndlang = 1, &$trade_message = '') {
global $_G;
$tmp = $return = [];
if($_G['uid'] == $tradelog['buyerid']) {
$data = [
0 => [4, 8],
1 => [4, 8],
5 => [7, 10],
11 => [10, 7],
12 => [13]
];
$tmp = $data[$tradelog['status']];
} elseif($_G['uid'] == $tradelog['sellerid']) {
$data = [
4 => [5],
10 => [12, 11],
13 => [17]
];
$tmp = $data[$tradelog['status']];
}
if($returndlang) {
if(!is_array($tmp)) {
return [];
}
$language = lang('forum/misc');
for($i = 0, $count = count($tmp); $i < $count; $i++) {
$return[$tmp[$i]] = lang('forum/misc', 'trade_offline_'.$tmp[$i]);
$trade_message .= isset($language['trade_message_'.$tmp[$i]]) ? lang('forum/misc', 'trade_message_'.$tmp[$i]).'<br />' : '';
}
return $return;
} else {
return $tmp;
}
}
function trade_create($trade) {
global $_G;
extract($trade);
$special = 2;
$expiration = $item_expiration ? strtotime($item_expiration) : 0;
$closed = $expiration > 0 && strtotime($item_expiration) < TIMESTAMP ? 1 : 0;
$item_price = floatval($item_price);
switch($transport) {
case 'offline' :
$item_transport = 0;
break;
case 'seller' :
$item_transport = 1;
break;
case 'buyer' :
$item_transport = 2;
break;
case 'virtual' :
$item_transport = 3;
break;
case 'logistics':
$item_transport = 4;
break;
}
$seller = dhtmlspecialchars($seller);
$item_name = dhtmlspecialchars($item_name);
$item_locus = dhtmlspecialchars($item_locus);
$item_number = intval($item_number);
$item_quality = intval($item_quality);
$item_transport = intval($item_transport);
$postage_mail = intval($postage_mail);
$postage_express = intval($postage_express);
$postage_ems = intval($postage_ems);
$item_type = intval($item_type);
$typeid = intval($typeid);
$item_costprice = floatval($item_costprice);
if(!$item_price || $item_price <= 0) {
$item_price = $postage_mail = $postage_express = $postage_ems = '';
}
if(empty($pid)) {
$pid = table_forum_post::t()->fetch_threadpost_by_tid_invisible($tid);
$pid = $pid['pid'];
}
if(!$item_price && $item_credit) {
$seller = '';
}
table_forum_trade::t()->insert([
'tid' => $tid,
'pid' => $pid,
'typeid' => $typeid,
'sellerid' => $_G['uid'],
'seller' => $author,
'tenpayaccount' => $tenpayaccount,
'account' => $seller,
'subject' => $item_name,
'price' => $item_price,
'amount' => $item_number,
'quality' => $item_quality,
'locus' => $item_locus,
'transport' => $item_transport,
'ordinaryfee' => $postage_mail,
'expressfee' => $postage_express,
'emsfee' => $postage_ems,
'itemtype' => $item_type,
'dateline' => $_G['timestamp'],
'expiration' => $expiration,
'lastupdate' => $_G['timestamp'],
'totalitems' => '0',
'tradesum' => '0',
'closed' => $closed,
'costprice' => $item_costprice,
'aid' => $aid, 'credit' => $item_credit,
'costcredit' => $item_costcredit
]);
}