本文整理汇总了PHP中fn_date_format函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_date_format函数的具体用法?PHP fn_date_format怎么用?PHP fn_date_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_date_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_modifier_date_format
/**
* Smarty date_format modifier plugin
*
* Type: modifier<br>
* Name: date_format<br>
* Purpose: format datestamps via strftime<br>
* Input:<br>
* - string: input date string
* - format: strftime format for output
* - default_date: default date if $string is empty
* @link http://smarty.php.net/manual/en/language.modifier.date.format.php
* date_format (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string
* @param string
* @return string|void
* @uses smarty_make_timestamp()
*/
function smarty_modifier_date_format($string, $format = "%b %e, %Y", $default_date = null)
{
if ($string != '') {
$timestamp = smarty_make_timestamp($string);
} elseif (isset($default_date) && $default_date != '') {
$timestamp = smarty_make_timestamp($default_date);
} else {
$timestamp = TIME;
}
return fn_date_format($timestamp, $format);
}
示例2: fn_check_intervals
function fn_check_intervals($interval, $time_from, $time_to, $limit = 0)
{
$intervals['0'] = db_get_row("SELECT a.* FROM ?:sales_reports_intervals as a WHERE a.interval_id = ?i", $interval);
if (empty($time_from) && Registry::get('settings.Company.company_start_year')) {
$time_from = mktime(0, 0, 0, 1, 1, Registry::get('settings.Company.company_start_year'));
}
if ($intervals['0']['value'] != 0) {
$num = 0;
$time_end = $time_from;
while ($time_to > $time_end) {
$temp = array();
$temp = $intervals[0];
$temp['interval_id'] = $temp['interval_id'] . $num;
$temp['time_from'] = $time_end;
$time_end += $intervals['0']['interval_id'] == '7' ? mktime(0, 0, 0, date("m", $time_end) + 1, 1, date("Y", $time_end)) - $time_end : $temp['value'];
/**
* If a year is leap, we should add 1 day.
*/
if (date('L', $temp['time_from'])) {
$time_end += 86400;
}
$temp['time_to'] = $time_end;
$num++;
$temp['description'] = fn_date_format($temp['time_from'], Registry::get('settings.Reports.' . $temp['interval_code']));
$intervals[] = $temp;
}
unset($intervals[0]);
ksort($intervals);
} else {
$intervals['0']['time_from'] = $time_from;
$intervals['0']['time_to'] = $time_to;
}
//$intervals = array_reverse($intervals);
if (!empty($limit)) {
$i = 1;
$j = 0;
$temp = array();
foreach ($intervals as $k => $v) {
$temp[$i][$k] = $v;
$j++;
if ($j == $limit) {
$j = 0;
$i++;
}
}
unset($intervals);
$intervals = $temp;
}
return $intervals;
}
示例3: smarty_modifier_date_format
/**
* Smarty date_format modifier plugin
*
* Type: modifier<br>
* Name: date_format<br>
* Purpose: format datestamps via strftime<br>
* Input:<br>
* - string: input date string
* - format: strftime format for output
* - default_date: default date if $string is empty
* @link http://smarty.php.net/manual/en/language.modifier.date.format.php
* date_format (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @param string
* @param string
* @return string|void
* @uses smarty_make_timestamp()
*/
function smarty_modifier_date_format($string, $format = "%b %e, %Y", $default_date = null)
{
/**
* Include the {@link shared.make_timestamp.php} plugin
*/
require_once SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php';
if ($string != '') {
$timestamp = smarty_make_timestamp($string);
} elseif (isset($default_date) && $default_date != '') {
$timestamp = smarty_make_timestamp($default_date);
} else {
$timestamp = TIME;
}
return fn_date_format($timestamp, $format);
}
示例4: elseif
$response->setData($file_url);
} elseif ($meta['object'] == 'errors') {
$response->returnResponse();
} elseif ($meta['object'] == 'reward_points_userlog') {
$items_per_page = !empty($items_per_page) ? $items_per_page : TWG_RESPONSE_ITEMS_LIMIT;
$request = $_REQUEST;
$auth =& $_SESSION['auth'];
$page = !empty($request['page']) ? $request['page'] : 1;
list($_reward_points_log, $params) = fn_twg_get_reward_points_userlog(array('user_id' => $auth['user_id'], 'items_per_page' => $items_per_page, 'page' => $page));
$reward_points_log = array();
$statuses = fn_get_simple_statuses(STATUSES_ORDER, true, true);
$actions = array(CHANGE_DUE_ORDER => 'CHANGE_DUE_ORDER', CHANGE_DUE_USE => 'CHANGE_DUE_USE', CHANGE_DUE_RMA => 'CHANGE_DUE_RMA', CHANGE_DUE_ADDITION => 'CHANGE_DUE_ADDITION', CHANGE_DUE_SUBTRACT => 'CHANGE_DUE_SUBTRACT', CHANGE_DUE_ORDER_DELETE => 'CHANGE_DUE_ORDER_DELETE', CHANGE_DUE_ORDER_PLACE => 'CHANGE_DUE_ORDER_PLACE');
foreach ($_reward_points_log as &$record) {
$record['reason'] = !in_array($record['action'], array(CHANGE_DUE_ADDITION, CHANGE_DUE_SUBTRACT)) ? unserialize($record['reason']) : $record['reason'];
$date_format = Registry::get('settings.Appearance.date_format') . ', ' . Registry::get('settings.Appearance.time_format');
$record['timestamp'] = fn_date_format($record['timestamp'], $date_format);
$record['order_exists'] = !empty($record['reason']['order_id']) ? fn_get_order_name($record['reason']['order_id']) != false : false;
$record['custom_action'] = false;
if (in_array($record['action'], array_keys($actions))) {
$record['action'] = $actions[$record['action']];
} else {
$record['custom_action'] = true;
}
if (is_array($record['reason'])) {
if (!empty($record['reason']['text'])) {
$record['reason']['text'] = ltrim($record['reason']['text'], 'text_');
}
if (!empty($statuses[$record['reason']['from']]) && !empty($statuses[$record['reason']['to']])) {
$record['reason']['status'] = array('from' => $statuses[$record['reason']['from']], 'to' => $statuses[$record['reason']['to']]);
} else {
$record['reason']['status'] = array();
示例5: elseif
}
}
}
Tygh::$app['view']->assign('yml_offer_types', $offers);
Tygh::$app['view']->assign('yml_offer_features', $offers_features);
} elseif ($mode == 'manage') {
$price_lists = fn_yml_get_price_lists();
$generation_statuses = array();
foreach ($price_lists as $price_id => $price) {
$price_lists[$price_id]['offset'] = 0;
$price_lists[$price_id]['offset'] = fn_get_storage_data('yml2_export_offset_' . $price_id);
$price_lists[$price_id]['count'] = fn_get_storage_data('yml2_export_count_' . $price_id);
$time = fn_get_storage_data('yml2_export_time_' . $price_id);
$price_lists[$price_id]['time'] = "";
if (!empty($time)) {
$price_lists[$price_id]['time'] = fn_date_format($time, Registry::get('settings.Appearance.date_format') . " " . Registry::get('settings.Appearance.time_format'));
}
$runtime = fn_get_storage_data('yml2_export_start_time_' . $price_id);
$price_lists[$price_id]['runtime'] = 0;
if (!empty($runtime)) {
$time = mktime(null, null, time() - $runtime);
//$mktime = mktime(null, null, time() - $runtime);
$price_lists[$price_id]['runtime'] = date("H:i:s", $time);
}
if ($price_lists[$price_id]['offset'] > $price_lists[$price_id]['count']) {
$price_lists[$price_id]['offset'] = $price_lists[$price_id]['count'];
}
$price_lists[$price_id]['generate_link'] = fn_yml_get_generate_link($price);
$price_lists[$price_id]['get_link'] = fn_yml_get_link($price);
$generation_statuses[$price_id] = fn_get_storage_data('yml2_status_generate_' . $price_id);
if ($generation_statuses[$price_id] == 'redirect') {
示例6: db_get_field
$__status = db_get_field("SELECT status FROM ?:orders WHERE order_id = ?i", $order_id);
$pp_response = array();
$pp_response['order_status'] = $__status;
$pp_response['reason_text'] = __('order_id') . '-' . $order_id;
if (fn_check_payment_script('proxypay3.php', $order_id)) {
fn_finish_payment($order_id, $pp_response, false);
}
fn_order_placement_routines('route', $order_id);
} elseif ($action == 'nok') {
if (empty($order_id)) {
fn_set_notification('E', __('error'), __('connection_error'));
fn_order_placement_routines('checkout_redirect');
} else {
$pp_response = array('order_status' => 'D', 'reason_text' => __('payments.proxypay3.declined_reason_text'));
fn_finish_payment($order_id, $pp_response, false);
fn_order_placement_routines('route', $order_id);
}
}
}
} else {
$lang = CART_LANGUAGE == 'el' ? 'GR' : 'EN';
if (in_array($processor_data['processor_params']['currency'], $totals_100)) {
$total_cost = $order_info['total'];
} else {
$total_cost = $order_info['total'] * 100;
}
$order_id = $order_id . '_' . fn_date_format(time(), '%H:%M:%S');
$post_data = array('APACScommand' => 'NewPayment', 'merchantID' => $processor_data['processor_params']['merchantid'], 'amount' => $total_cost, 'merchantRef' => $order_id, 'merchantDesc' => $processor_data['processor_params']['details'], 'currency' => $processor_data['processor_params']['currency'], 'lang' => $lang, 'CustomerEmail' => $order_info['email']);
fn_create_payment_form('https://' . $processor_data['processor_params']['url'], $post_data, 'Eurobank');
}
exit;
示例7: fn_finish_payment
$pp_response['descr_avs'] = $avs[1];
}
fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
fn_order_placement_routines('route', $_REQUEST['order_id']);
} else {
if ($processor_data['processor_params']['testmode'] == 'Y') {
$post_address = "https://test.sagepay.com/gateway/service/vspform-register.vsp";
} elseif ($processor_data['processor_params']['testmode'] == 'N') {
$post_address = "https://live.sagepay.com/gateway/service/vspform-register.vsp";
} elseif ($processor_data['processor_params']['testmode'] == 'S') {
$post_address = "https://test.sagepay.com/Simulator/VSPFormGateway.asp";
}
$post["VPSProtocol"] = "2.23";
$post["TxType"] = $processor_data["processor_params"]["transaction_type"];
$post["Vendor"] = htmlspecialchars($processor_data["processor_params"]["vendor"]);
$post_encrypted = 'VendorTxCode=' . $processor_data['processor_params']['order_prefix'] . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id) . '-' . fn_date_format(time(), '%H_%M_%S') . "&";
$post_encrypted .= 'Amount=' . $order_info['total'] . '&';
$post_encrypted .= 'Currency=' . $processor_data['processor_params']['currency'] . '&';
$post_encrypted .= 'Description=Payment for Order' . $order_id . '&';
$post_encrypted .= 'SuccessURL=' . fn_url("payment_notification.notify?payment=sagepay_form&order_id={$order_id}", AREA, 'http') . '&';
$post_encrypted .= 'FailureURL=' . fn_url("payment_notification.notify?payment=sagepay_form&order_id={$order_id}", AREA, 'http') . '&';
$post_encrypted .= 'CustomerEMail=' . $order_info['email'] . '&';
$post_encrypted .= 'VendorEmail=' . Registry::get('settings.Company.company_orders_department') . '&';
$post_encrypted .= 'CustomerName=' . $order_info['firstname'] . ' ' . $order_info['lastname'] . '&';
$post_encrypted .= 'ContactNumber=' . $order_info['phone'] . '&';
$post_encrypted .= 'ContactFax=' . $order_info['fax'] . '&';
// Billing address
$post_encrypted .= 'BillingAddress1=' . $order_info['b_address'] . '&';
if (!empty($order_info['b_address_2'])) {
$post_encrypted .= 'BillingAddress2=' . $order_info['b_address_2'] . '&';
}
示例8: fn_date_format
1 - Pre-authorization
2 - Confirmation
3 -Automatic Refund
4 - Payment by Cell Phone
5 - Recurrent Transaction
6 - Successive Transaction
7 - Authentication
8 - Confirmation of Authentication
*/
$currency = $processor_data['processor_params']['currency'];
$merchant = $processor_data['processor_params']['merchant_id'];
$terminal = $processor_data['processor_params']['terminal'];
$transaction_type = 0;
// authorization
$clave = $processor_data['processor_params']['clave'];
$postfix = fn_date_format(time(), '%S');
if (strlen($order_id) > 6) {
$order_n = $order_id . $postfix . ($order_info['repaid'] ? 'x' . $order_info['repaid'] : '');
} else {
$order_n = str_repeat('0', 6 - strlen($order_id)) . $order_id . $postfix . ($order_info['repaid'] ? 'x' . $order_info['repaid'] : '');
}
$amount = $currency == '978' ? $order_info['total'] * 100 : $order_info['total'];
$url_merchant = fn_url("payment_notification.result?payment=servired&order_id={$order_id}{$postfix}", AREA, 'current');
$url_ok = fn_url("payment_notification.notify?payment=servired&order_id={$order_id}{$postfix}", AREA, 'current');
$url_nok = fn_url("payment_notification.failed?payment=servired&order_id={$order_id}{$postfix}", AREA, 'current');
// Compute hash to sign form data
$message = $amount . $order_n . $merchant . $currency . $transaction_type . $url_merchant . $clave;
$signature = strtoupper(sha1($message));
$post_data = array('Ds_Merchant_Amount' => $amount, 'Ds_Merchant_Currency' => $currency, 'Ds_Merchant_Order' => $order_n, 'Ds_Merchant_MerchantCode' => $merchant, 'Ds_Merchant_Terminal' => $terminal, 'Ds_Merchant_TransactionType' => $transaction_type, 'Ds_Merchant_MerchantURL' => $url_merchant, 'Ds_Merchant_UrlOK' => $url_ok, 'Ds_Merchant_UrlKO' => $url_nok, 'Ds_Merchant_MerchantSignature' => $signature);
fn_create_payment_form($post_address, $post_data, 'SERMEPA');
}
示例9: elseif
$pp_merch = $processor_data['processor_params']['vendor'];
$pp_curr = $processor_data['processor_params']['currency'];
if ($processor_data['processor_params']['testmode'] == 'Y') {
$post_address = 'https://test.sagepay.com/gateway/service/vspdirect-register.vsp';
} elseif ($processor_data['processor_params']['testmode'] == 'N') {
$post_address = 'https://live.sagepay.com/gateway/service/vspdirect-register.vsp';
} elseif ($processor_data['processor_params']['testmode'] == 'S') {
$post_address = 'https://test.sagepay.com/Simulator/VSPDirectGateway.asp';
}
$already_posted = false;
$card_type = fn_get_payment_card($order_info['payment_info']['card_number'], array('visa' => 'VISA', 'visa_debit' => 'DELTA', 'mastercard' => 'MC', 'mastercard_debit' => 'MCDEBIT', 'amex' => 'AMEX', 'jcb' => 'JCB', 'maestro' => 'MAESTRO', 'visa_electron' => 'UKE', 'laser' => 'LASER', 'diners_club_carte_blanche' => 'DINERS', 'diners_club_international' => 'DINERS'));
$post = array();
$post['VPSProtocol'] = '2.23';
$post['TxType'] = $processor_data['processor_params']['transaction_type'];
$post['Vendor'] = $pp_merch;
$post['VendorTxCode'] = (!empty($processor_data['processor_params']['order_prefix']) ? $processor_data['processor_params']['order_prefix'] : 'O') . '-' . ($order_info['repaid'] ? $order_info['order_id'] . '-' . $order_info['repaid'] : $order_info['order_id']) . '-' . fn_date_format(time(), '%H_%M_%S');
$post['Amount'] = $order_info["total"];
$post['Currency'] = $pp_curr;
$post['Description'] = 'Your Cart';
$post['CardHolder'] = $order_info['payment_info']['cardholder_name'];
$post['CardNumber'] = $order_info['payment_info']['card_number'];
$post['ExpiryDate'] = $order_info['payment_info']['expiry_month'] . $order_info['payment_info']['expiry_year'];
$post['CV2'] = $order_info['payment_info']['cvv2'];
$post['CardType'] = $card_type;
$post['Apply3DSecure'] = 0;
$post['BillingAddress1'] = $order_info['b_address'];
$post['BillingAddress2'] = $order_info['b_address_2'];
//Workariund for the Irish customers. According to the documentation we should enter zip code anyway.
$post['BillingPostCode'] = !empty($order_info['b_zipcode']) ? $order_info['b_zipcode'] : '0000';
$post['BillingCountry'] = $order_info['b_country'];
if ($order_info['b_country'] == 'US') {
示例10: fn_gift_certificates_quickbooks_export_order
function fn_gift_certificates_quickbooks_export_order($order, $order_products, $spl, &$export)
{
$order_date = fn_date_format($order['timestamp'], "%m/%d/%Y");
$trns_class = Registry::get('addons.quickbooks.trns_class');
if (!empty($order['gift_certificates'])) {
foreach ($order['gift_certificates'] as $gift) {
// Check wether gift certificate is taxable
$taxable = !empty($gift['tax_value']) ? 'Y' : 'N';
$export[] = sprintf($spl, $order_date, Registry::get('addons.quickbooks.accnt_product'), fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, -$gift['amount'], $order['order_id'], 'GIFT CERTIFICATE:', $gift['gift_cert_code'], $gift['amount'], -1, 'GIFT CERTIFICATE', $taxable, '');
}
}
if (!empty($order['use_gift_certificates'])) {
foreach ($order['use_gift_certificates'] as $code => $use_gift) {
$export[] = sprintf($spl, $order_date, Registry::get('addons.quickbooks.accnt_discount'), fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), Registry::get('addons.quickbooks.trns_class'), $use_gift['cost'], $order['order_id'], 'GIFT CERTIFICATE:', $code, -$use_gift['cost'], -1, 'GIFT CERTIFICATE', 'N', '');
}
}
}
示例11: fn_format_rss_time
function fn_format_rss_time($timestamp)
{
return fn_date_format($timestamp, '%a, %d %b %Y %T') . ' GMT';
}
示例12: fn_check_intervals
/**
* Generates date-time intervals of a given period for sales reports
*
* @param int $interval_id Sales reports interval ID
* @param int $timestamp_from Timestamp of report period beginning date
* @param int $timestamp_to Timestamp of report period end date
* @param int $limit
*
* @return array
*/
function fn_check_intervals($interval_id, $timestamp_from, $timestamp_to, $limit = 0)
{
$interval_definition = db_get_row('SELECT * FROM ?:sales_reports_intervals WHERE `interval_id` = ?i', $interval_id);
$intervals = array();
// Passthru given timeframe
if (empty($interval_definition['value'])) {
$interval = $interval_definition;
$interval['time_from'] = $timestamp_from;
$interval['time_to'] = $timestamp_to;
$intervals[] = $interval;
} else {
$interval_type_map = array('day' => 'D', 'week' => 'W', 'month' => 'M', 'year' => 'Y');
$mapped_interval_type = $interval_type_map[$interval_definition['interval_code']];
$timezone = new \DateTimeZone(date_default_timezone_get());
$date_interval = new \DateInterval("P1{$mapped_interval_type}");
$datetime_from = new \DateTime("@{$timestamp_from}");
$datetime_from->setTimezone($timezone);
$datetime_to = new \DateTime("@{$timestamp_to}");
$datetime_to->setTimezone($timezone);
$period_iterator_datetime_from = clone $datetime_from;
$period_definitions = DateTimeHelper::getPeriodDefinitions();
switch ($interval_definition['interval_code']) {
case 'week':
$period_iterator_start_datetime_modifier = $period_definitions[DateTimeHelper::PERIOD_THIS_WEEK]['from'];
break;
case 'month':
$period_iterator_start_datetime_modifier = $period_definitions[DateTimeHelper::PERIOD_THIS_MONTH]['from'];
break;
case 'year':
$period_iterator_start_datetime_modifier = $period_definitions[DateTimeHelper::PERIOD_THIS_YEAR]['from'];
break;
default:
$period_iterator_start_datetime_modifier = null;
break;
}
if (null !== $period_iterator_start_datetime_modifier) {
$period_iterator_datetime_from->modify($period_iterator_start_datetime_modifier);
}
$period_list = new \DatePeriod($period_iterator_datetime_from, $date_interval, $datetime_to);
foreach ($period_list as $i => $period_start) {
/** @var \DateTime $period_start */
$period_end = clone $period_start;
$period_end->add($date_interval)->modify('-1 second');
if ($period_start < $datetime_from) {
$period_start = clone $datetime_from;
}
if ($period_end > $datetime_to) {
$period_end = clone $datetime_to;
}
$interval = array('interval_id' => "{$interval_definition['interval_id']}{$i}", 'value' => $interval_definition['value'], 'interval_code' => $interval_definition['interval_code'], 'time_from' => $period_start->getTimestamp(), 'time_to' => $period_end->getTimestamp(), 'iso8601_from' => $period_start->format(\DateTime::ISO8601), 'iso8601_to' => $period_end->format(\DateTime::ISO8601));
$interval_date_format = Registry::get("settings.Reports.{$interval_definition['interval_code']}");
// String representation of interval's beginning date
$interval['description'] = fn_date_format($interval['time_from'], $interval_date_format);
// Week, month and year intervals may belong to two real weeks/months/years,
// so we have to display both of them.
if (in_array($interval_definition['interval_code'], array('week', 'month', 'year'))) {
$datetime_to_description = fn_date_format($interval['time_to'], $interval_date_format);
// Interval belongs to two real weeks/months/years
if ($interval['description'] !== $datetime_to_description) {
$interval['description'] .= " - {$datetime_to_description}";
}
}
$intervals[$i + 1] = $interval;
// $i+1 is also preserved for BC, no algorhytmical meaning
}
}
// This magical part of code must be working, but is left non-tested yet
if (!empty($limit)) {
$i = 1;
$j = 0;
$temp = array();
foreach ($intervals as $k => $v) {
$temp[$i][$k] = $v;
$j++;
if ($j == $limit) {
$j = 0;
$i++;
}
}
unset($intervals);
$intervals = $temp;
}
return $intervals;
}
示例13: array
$all_tables = array();
foreach ($status_data as $k => $v) {
$database_size += $v['Data_length'] + $v['Index_length'];
$all_tables[] = $v['Name'];
}
Registry::get('view')->assign('database_size', $database_size);
Registry::get('view')->assign('all_tables', $all_tables);
$files = fn_get_dir_contents(Registry::get('config.dir.database'), false, true, array('.sql', '.tgz'), '', true);
sort($files, SORT_STRING);
$backup_files = array();
$date_format = Registry::get('settings.Appearance.date_format') . ' ' . Registry::get('settings.Appearance.time_format');
if (is_array($files)) {
foreach ($files as $file) {
$backup_files[$file]['size'] = filesize(Registry::get('config.dir.database') . $file);
$backup_files[$file]['type'] = strpos($file, '.tgz') === false ? 'sql' : 'tgz';
$backup_files[$file]['create'] = fn_date_format(filemtime(Registry::get('config.dir.database') . $file), $date_format);
}
}
Registry::get('view')->assign('backup_files', $backup_files);
Registry::get('view')->assign('backup_dir', fn_get_rel_dir(Registry::get('config.dir.database')));
} elseif ($mode == 'delete') {
if (!empty($_REQUEST['backup_file'])) {
fn_rm(Registry::get('config.dir.database') . fn_basename($_REQUEST['backup_file']));
}
return array(CONTROLLER_STATUS_REDIRECT, "database.manage?selected_section=restore");
}
function fn_restore_dump($files)
{
if (empty($files)) {
return false;
}
示例14: fn_date_format
$post['x_ship_to_company'] = $order_info['company'];
$post['x_ship_to_city'] = $order_info['s_city'];
$post['x_ship_to_state'] = $order_info['s_state'];
$post['x_ship_to_zip'] = $order_info['s_zipcode'];
$post['x_ship_to_country'] = $order_info['s_country'];
// Customer information
$post['x_phone'] = $order_info['phone'];
$post['x_fax'] = $order_info['fax'];
$post['x_cust_id'] = $_SESSION['auth']['user_id'];
// !!!FIXME (what about not registered?)
$post['x_customer_ip'] = $_SERVER['REMOTE_ADDR'];
$post['x_email'] = $order_info['email'];
$post['x_email_customer'] = 'FALSE';
// Merchant information
$post['x_merchant_email'] = Registry::get('settings.Company.company_orders_department');
$post['x_invoice_num'] = $processor_data['processor_params']['order_prefix'] . $order_id . ($order_info['repaid'] ? "_{$order_info['repaid']}" : '') . '_' . fn_date_format(time(), '%H_%M_%S');
$post['x_amount'] = fn_format_price($order_info['total']);
$post['x_currency_code'] = $processor_data['processor_params']['currency'];
$post['x_method'] = 'CC';
$post['x_recurring_billing'] = 'NO';
$post['x_type'] = $transaction_types[$trans_type];
// CC information
$post['x_card_num'] = $order_info['payment_info']['card_number'];
$post['x_exp_date'] = $order_info['payment_info']['expiry_month'] . '/' . $order_info['payment_info']['expiry_year'];
$post['x_card_code'] = $order_info['payment_info']['cvv2'];
// Cart totals
$post['x_relay_response'] = 'FALSE';
$post['x_tax'] = fn_format_price($order_info['tax_subtotal']);
$post['x_freight'] = fn_format_price($order_info['shipping_cost']);
$payment_url = $processor_data['processor_params']['mode'] == 'developer' ? "https://test.authorize.net/gateway/transact.dll" : "https://secure.authorize.net:443/gateway/transact.dll";
Registry::set('log_cut_data', array('x_card_num', 'x_exp_date', 'x_card_code'));
示例15: fn_twg_get_feature_value
function fn_twg_get_feature_value($value, $feature_type, $value_int, $variant_id, $variants)
{
if ($feature_type == "D") {
$value = fn_date_format($value_int, REGISTRY::get('settings.Appearance.date_format'));
} elseif ($feature_type == "M") {
$value = array();
foreach ($variants as $variant) {
if ($variant['selected']) {
$value[] = $variant['variant'];
}
}
} elseif ($variant_id) {
$value = $variants[$variant_id]['variant'];
} elseif ($value_int) {
$value = $value_int;
}
return $value;
}