本文整理汇总了PHP中xtc_db_perform函数的典型用法代码示例。如果您正苦于以下问题:PHP xtc_db_perform函数的具体用法?PHP xtc_db_perform怎么用?PHP xtc_db_perform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xtc_db_perform函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_page_content
function get_page_content($name, $coID = '')
{
$mode = '';
$format = strtolower(MODULE_JANOLAW_FORMAT);
if ($format == 'html') {
$mode = '_include';
}
$url = 'http://www.janolaw.de/agb-service/shops/' . $this->m_user_id . '/' . $this->m_shop_id . '/' . $name . $mode . '.' . $format;
$content = get_external_content($url, '3', false);
if (strtolower(MODULE_JANOLAW_TYPE) == 'database') {
// update data in table
$sql_data_array = array('content_text' => $content, 'content_file' => '');
xtc_db_perform(TABLE_CONTENT_MANAGER, $sql_data_array, 'update', "content_group='" . (int) $coID . "' and languages_id='2'");
} else {
// write content to file
$file = DIR_FS_CATALOG . 'media/content/' . $name . '.' . $format;
$fp = @fopen($file, 'w+');
if (is_resource($fp)) {
fwrite($fp, $content);
fclose($fp);
}
// update data in table
$sql_data_array = array('content_file' => $name . '.' . $format, 'content_text' => '');
xtc_db_perform(TABLE_CONTENT_MANAGER, $sql_data_array, 'update', "content_group='" . (int) $coID . "' and languages_id='2'");
}
}
示例2: log
public function log($message, $level = 0)
{
$this->_logcount++;
$table = $this->_mode == 'api' ? 'payone_api_log' : 'payone_transactions_log';
$sql_data_array = array('event_id' => (int) $this->_event_id, 'date_created' => 'now()', 'log_count' => (int) $this->_logcount, 'log_level' => (int) $level, 'message' => $message, 'customers_id' => isset($_SESSION['customer_id']) ? $_SESSION['customer_id'] : '0');
xtc_db_perform($table, $sql_data_array);
}
示例3: testCheckedInLastWeekReturnsFalseWhenLastCheckIsLongerAgoThanAWeek
public function testCheckedInLastWeekReturnsFalseWhenLastCheckIsLongerAgoThanAWeek()
{
$sql_data = array('configuration_key' => 'MODULE_PAYMENT_BARZAHLEN_LAST_UPDATE_CHECK', 'configuration_value' => '2013-01-01 00:00:00', 'configuration_group_id' => 6, 'date_added' => 'now()');
xtc_db_perform(TABLE_CONFIGURATION, $sql_data);
$versionCheck = $this->createVersionCheck();
$this->assertFalse($versionCheck->isCheckedInLastWeek());
}
示例4: affiliate_insert
function affiliate_insert($sql_data_array, $affiliate_parent = 0)
{
// LOCK TABLES
@mysql_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
if ($affiliate_parent > 0) {
$affiliate_root_query = xtc_db_query("select affiliate_root, affiliate_rgt, affiliate_lft�from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_parent . "' ");
// Check if we have a parent affiliate
if ($affiliate_root_array = xtc_db_fetch_array($affiliate_root_query)) {
xtc_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_lft > " . $affiliate_root_array['affiliate_rgt'] . " AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
xtc_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
$sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root'];
$sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt'];
$sql_data_array['affiliate_rgt'] = $affiliate_root_array['affiliate_rgt'] + 1;
xtc_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = xtc_db_insert_id();
}
// no parent -> new root
} else {
$sql_data_array['affiliate_lft'] = '1';
$sql_data_array['affiliate_rgt'] = '2';
xtc_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = xtc_db_insert_id();
xtc_db_query("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
}
// UNLOCK TABLES
@mysql_query("UNLOCK TABLES");
return $affiliate_id;
}
示例5: isCheckedInLastWeek
/**
* Checks if version was checked in last week
*
* @return boolean
*/
public function isCheckedInLastWeek()
{
$lastQuery = xtc_db_query("SELECT configuration_value\n FROM " . TABLE_CONFIGURATION . "\n WHERE configuration_key = 'MODULE_PAYMENT_BARZAHLEN_LAST_UPDATE_CHECK'");
$lastCheck = xtc_db_fetch_array($lastQuery);
if (!$lastCheck) {
$sql_data = array('configuration_key' => 'MODULE_PAYMENT_BARZAHLEN_LAST_UPDATE_CHECK', 'configuration_value' => 'now()', 'configuration_group_id' => 6, 'date_added' => 'now()');
xtc_db_perform(TABLE_CONFIGURATION, $sql_data);
return false;
} elseif (time() - strtotime($lastCheck['configuration_value']) > 60 * 60 * 24 * 7) {
xtc_db_query("UPDATE " . TABLE_CONFIGURATION . "\n SET configuration_value = NOW()\n WHERE configuration_key = 'MODULE_PAYMENT_BARZAHLEN_LAST_UPDATE_CHECK'");
return false;
}
return true;
}
示例6: xtc_update_whos_online
function xtc_update_whos_online()
{
$crawler = 0;
if (isset($_SESSION['customer_id'])) {
$wo_customer_id = (int) $_SESSION['customer_id'];
$customer_query = xtc_db_query("select\n customers_firstname,\n customers_lastname\n from " . TABLE_CUSTOMERS . "\n where customers_id = '" . $wo_customer_id . "'");
$customer = xtc_db_fetch_array($customer_query);
$wo_full_name = xtc_db_prepare_input($customer['customers_firstname'] . ' ' . $customer['customers_lastname']);
} else {
$wo_customer_id = '';
$crawler = xtc_check_agent();
if ($crawler !== 0) {
$wo_full_name = '[' . TEXT_SEARCH_ENGINE_AGENT . ']';
} else {
$wo_full_name = TEXT_GUEST;
}
}
if ($crawler !== 0) {
$wo_session_id = '';
} else {
$wo_session_id = xtc_session_id();
}
$wo_ip_address = xtc_db_prepare_input($_SESSION['tracking']['ip']);
$wo_last_page_url = xtc_db_prepare_input(strip_tags($_SERVER['REQUEST_URI']));
$wo_referer = xtc_db_prepare_input(isset($_SERVER['HTTP_REFERER']) ? strip_tags($_SERVER['HTTP_REFERER']) : '---');
$current_time = time();
$time_last_click = 900;
if (defined('WHOS_ONLINE_TIME_LAST_CLICK')) {
$time_last_click = (int) WHOS_ONLINE_TIME_LAST_CLICK;
}
$xx_mins_ago = time() - $time_last_click;
// remove entries that have expired
xtc_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
$stored_customer_query = xtc_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . $wo_session_id . "'");
$stored_customer = xtc_db_fetch_array($stored_customer_query);
$sql_data_array = array('customer_id' => $wo_customer_id, 'full_name' => xtc_db_prepare_input($wo_full_name), 'ip_address' => $wo_ip_address, 'time_last_click' => $current_time, 'last_page_url' => $wo_last_page_url);
if ($stored_customer['count'] > 0) {
xtc_db_perform(TABLE_WHOS_ONLINE, $sql_data_array, 'update', "session_id = '" . $wo_session_id . "'");
} else {
$sql_data_array['time_entry'] = $current_time;
$sql_data_array['session_id'] = $wo_session_id;
$sql_data_array['http_referer'] = $wo_referer;
xtc_db_perform(TABLE_WHOS_ONLINE, $sql_data_array);
}
}
示例7: xtc_cfg_save_max_display_results
function xtc_cfg_save_max_display_results($cfg_key)
{
if (isset($_POST[$cfg_key])) {
$configuration_value = preg_replace('/[^0-9-]/', '', $_POST[$cfg_key]);
$configuration_value = xtc_db_prepare_input($configuration_value);
$configuration_query = xtc_db_query("SELECT configuration_key,\n configuration_value\n FROM " . TABLE_CONFIGURATION . "\n WHERE configuration_key = '" . xtc_db_input($cfg_key) . "'\n ");
if (xtc_db_num_rows($configuration_query) > 0) {
//update
xtc_db_query("UPDATE " . TABLE_CONFIGURATION . "\n SET configuration_value ='" . xtc_db_input($configuration_value) . "',\n last_modified = NOW()\n WHERE configuration_key='" . xtc_db_input($cfg_key) . "'");
} else {
//new entry
$sql_data_array = array('configuration_key' => $cfg_key, 'configuration_value' => $configuration_value, 'configuration_group_id' => '1000', 'sort_order' => '-1', 'last_modified' => 'now()', 'date_added' => 'now()');
xtc_db_perform(TABLE_CONFIGURATION, $sql_data_array);
}
return $configuration_value;
}
return defined($cfg_key) && (int) constant($cfg_key) > 0 ? constant($cfg_key) : 20;
}
示例8: _sess_write
function _sess_write($key, $val)
{
global $SESS_LIFE;
$flag = '';
if (isset($_SESSION['customers_status']['customers_status_id']) && $_SESSION['customers_status']['customers_status_id'] == 0) {
$SESS_LIFE = defined('SESSION_LIFE_ADMIN') ? (int) SESSION_LIFE_ADMIN : (int) SESSION_LIFE_ADMIN_DEFAULT;
$flag = 'admin';
}
$expiry = time() + (int) $SESS_LIFE;
//$value = addslashes($val);
$value = base64_encode($val);
$check_query = xtc_db_query("-- includes/functions/sessions.php\n SELECT count(*) as total\n FROM " . TABLE_SESSIONS . "\n WHERE sesskey = '" . xtc_db_input($key) . "'");
$total = xtc_db_fetch_array($check_query);
if ($total['total'] > 0) {
return xtc_db_query("-- includes/functions/sessions.php\n UPDATE " . TABLE_SESSIONS . "\n SET expiry = '" . $expiry . "',\n value = '" . xtc_db_input($value) . "',\n flag = '" . xtc_db_input($flag) . "'\n WHERE sesskey = '" . xtc_db_input($key) . "'");
} else {
$sql_data_array = array('sesskey' => $key, 'expiry' => (int) $expiry, 'value' => $value, 'flag' => $flag);
return xtc_db_perform(TABLE_SESSIONS, $sql_data_array);
}
}
示例9: array
if ($status['customers_status_show_price_tax'] == 1) {
$tax_info = TEXT_ADD_TAX;
}
if ($status['customers_status_show_price_tax'] == 0) {
$tax_info = TEXT_NO_TAX;
}
$title = $tax_info . $title . ':';
//EOF web28 - 2010-12-04 - "inkl." oder "zzgl." hinzufügen
if ($ust['tax_value_new']) {
$text = $xtPrice->xtcFormat($ust['tax_value_new'], true);
//BOF - Dokuman - 2010-03-17 - added sort order directly to array
$sql_data_array = array('orders_id' => (int) $_POST['oID'], 'title' => xtc_db_prepare_input($title), 'text' => $text, 'value' => xtc_db_prepare_input($ust['tax_value_new']), 'class' => 'ot_tax', 'sort_order' => MODULE_ORDER_TOTAL_TAX_SORT_ORDER);
//$insert_sql_data = array ('sort_order' => MODULE_ORDER_TOTAL_TAX_SORT_ORDER);
//$sql_data_array = xtc_array_merge($sql_data_array, $insert_sql_data);
//EOF - Dokuman - 2010-03-17 - added sort order directly to array
xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
}
}
//BOF web28 - 2010-12-04 - Keine Mwst. auf Rechnung ausweisen
if ($status['customers_status_show_price_tax'] == 0 && $status['customers_status_add_tax_ot'] == 0) {
xtc_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $_POST['oID'] . "' and class='ot_tax'");
}
//EOF web28 - 2010-12-04 - Keine Mwst. auf Rechnung ausweisen
//EOF####### MwSt. neu berechnen #######//
//BOF web28 - 2010-12-04 Errechne neue Gesamtsumme für Artikel
//Mwst feststellen
$add_tax = 0;
$price = 'b_price';
if ($status['customers_status_show_price_tax'] == 0 && $status['customers_status_add_tax_ot'] == 1) {
$tax_query = xtc_db_query("select SUM(value) as value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $_POST['oID'] . "' and class='ot_tax'");
$tax = xtc_db_fetch_array($tax_query);
示例10: array
if ($error == false) {
// file upload
if ($select_file != 'default') {
$content_file_name = $select_file;
}
$accepted_file_upload_files_extensions = array("xls", "xla", "hlp", "chm", "ppt", "ppz", "pps", "pot", "doc", "dot", "pdf", "rtf", "swf", "cab", "tar", "zip", "au", "snd", "mp2", "rpm", "stream", "wav", "gif", "jpeg", "jpg", "jpe", "png", "tiff", "tif", "bmp", "csv", "txt", "rtf", "tsv", "mpeg", "mpg", "mpe", "qt", "mov", "avi", "movie", "rar", "7z");
$accepted_file_upload_files_mime_types = array("application/msexcel", "application/mshelp", "application/mspowerpoint", "application/msword", "application/pdf", "application/rtf", "application/x-shockwave-flash", "application/x-tar", "application/zip", "audio/basic", "audio/x-mpeg", "audio/x-pn-realaudio-plugin", "audio/x-qt-stream", "audio/x-wav", "image/gif", "image/jpeg", "image/png", "image/tiff", "image/bmp", "text/comma-separated-values", "text/plain", "text/rtf", "text/tab-separated-values", "video/mpeg", "video/quicktime", "video/x-msvideo", "video/x-sgi-movie", "application/x-rar-compressed", "application/x-7z-compressed");
if ($content_file = xtc_try_upload('file_upload', DIR_FS_CATALOG . 'media/content/', '644', $accepted_file_upload_files_extensions, $accepted_file_upload_files_mime_types)) {
$content_file_name = $content_file->filename;
}
// update data in table
$sql_data_array = array('languages_id' => $content_language, 'content_title' => $content_title, 'content_heading' => $content_header, 'content_text' => $content_text, 'content_file' => $content_file_name, 'content_status' => $content_status, 'parent_id' => $parent_id, 'group_ids' => $group_ids, 'content_group' => $group_id, 'sort_order' => $sort_order, 'file_flag' => $file_flag, 'content_meta_title' => $content_meta_title, 'content_meta_description' => $content_meta_description, 'content_meta_keywords' => $content_meta_keywords, 'content_meta_index' => $content_meta_index, 'change_date' => $time);
if ($id == 'update') {
xtc_db_perform(TABLE_CONTENT_MANAGER, $sql_data_array, 'update', "content_id = '" . $coID . "'");
} else {
xtc_db_perform(TABLE_CONTENT_MANAGER, $sql_data_array);
}
// if get id
xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER));
}
// if error
}
// if
require DIR_WS_INCLUDES . 'head.php';
?>
</head>
<body>
<!-- header //-->
<?php
require DIR_WS_INCLUDES . 'header.php';
?>
示例11: parse_url
// referrer #todo sec
$ref_url = parse_url(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $current_domain . $_SERVER['REQUEST_URI']);
if (!isset($_SESSION['tracking']['http_referer'])) {
$_SESSION['tracking']['http_referer'] = $ref_url;
}
// IP
if (!isset($_SESSION['tracking']['ip'])) {
$_SESSION['tracking']['ip'] = $_SERVER['REMOTE_ADDR'];
}
// campaigns
if (!isset($_SESSION['tracking']['refID']) && isset($_GET['refID'])) {
$campaign_check_query_raw = "SELECT * FROM " . TABLE_CAMPAIGNS . " WHERE campaigns_refID = '" . xtc_db_input($_GET['refID']) . "'";
$campaign_check_query = xtc_db_query($campaign_check_query_raw);
if (xtc_db_num_rows($campaign_check_query) > 0) {
$_SESSION['tracking']['refID'] = xtc_db_input($_GET['refID']);
xtc_db_perform(TABLE_CAMPAIGNS_IP, array('user_ip' => $_SESSION['tracking']['ip'], 'campaign' => xtc_db_input($_GET['refID']), 'time' => 'now()'));
}
}
// datetime
if (!isset($_SESSION['tracking']['date'])) {
$_SESSION['tracking']['date'] = date("Y-m-d H:i:s");
}
// browser #todo sec
if (!isset($_SESSION['tracking']['browser'])) {
$_SESSION['tracking']['browser'] = $_SERVER['HTTP_USER_AGENT'];
}
// pageview history
if (!isset($_SESSION['tracking']['pageview_history'])) {
$_SESSION['tracking']['pageview_history'] = array();
}
$i = count($_SESSION['tracking']['pageview_history']);
示例12: updateOrderDatabase
/**
* Update orderstatuses in the database
*
* @param int $customer The order status id to show the customer
* @param int $admin The order status id to show in the administration page
*
* @return void
*/
public function updateOrderDatabase($customer, $admin)
{
global $insert_id;
$orderid = mysqli_real_escape_string(xtc_db_connect(), $insert_id);
$refno = mysqli_real_escape_string(xtc_db_connect(), $_SESSION['klarna_refno']);
$sql_data_arr = array('orders_id' => $orderid, 'orders_status_id' => $customer, 'comments' => "Accepted by Klarna. Reference #: {$refno}", 'customer_notified' => 1, 'date_added' => date("Y-m-d H:i:s"));
xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_arr);
$has_ordernum_table = xtc_db_fetch_array(xtc_db_query("SELECT COUNT(*) " . "FROM information_schema.tables " . "WHERE table_schema = '" . DB_DATABASE . "' " . "AND table_name = 'klarna_ordernum';"));
$has_ordernum_table = $has_ordernum_table['COUNT(*)'];
if ($has_ordernum_table > 0) {
xtc_db_query("INSERT INTO `klarna_ordernum` (orders_id, klarna_ref) " . "VALUES ({$orderid}, {$refno})");
}
// Set pending status and hide it from customer.
$status = $_SESSION['klarna_orderstatus'];
if (isset($status)) {
$orderStatusQuery = $this->_klarnaDB->query("SELECT orders_status_id FROM " . TABLE_ORDERS_STATUS . " WHERE orders_status_name = '{$status}'");
$orderStatusID = $orderStatusQuery->getArray();
$sql_data_arr = array('orders_id' => $orderid, 'orders_status_id' => $orderStatusID['orders_status_id'], 'comments' => "Klarna Orderstatus: {$status}", 'customer_notified' => 0, 'date_added' => date("Y-m-d H:i:s"));
xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_arr);
xtc_db_query("UPDATE " . TABLE_ORDERS . " SET orders_status='" . $orderStatusID['orders_status_id'] . "' WHERE orders_id='" . $orderid . "'");
}
try {
$this->_klarna->setEstoreInfo(KiTT_String::encode($orderid));
$this->_klarna->update($_SESSION['klarna_refno']);
} catch (Exception $e) {
Klarna::printDebug(__METHOD__, "{$e->getMessage()} #({$e->getCode()})");
}
//Delete Session with user details
unset($_SESSION['klarna_data']);
unset($_SESSION['klarna_refno']);
unset($_SESSION['klarna_orderstatus']);
}
示例13: _process_order
function _process_order()
{
try {
/**
* Process the internal cartID to match the cartID in the $_SESSION
*/
if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) {
if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
return false;
}
}
$order = new order();
/**
* PropertiesControl Object
*/
$coo_properties = MainFactory::create_object('PropertiesControl');
$tmp_status = $order->info['order_status'];
if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == 1) {
$discount = $_SESSION['customers_status']['customers_status_ot_discount'];
} else {
$discount = '0.00';
}
if (gm_get_conf("GM_SHOW_IP") == '1' && gm_get_conf("GM_LOG_IP") == '1') {
$customers_ip = $_SESSION['user_info']['user_ip'];
}
$comments = '';
if (trim((string) $this->_request->comment_client) != '') {
$comments .= sprintf('Customer\'s Comment: %s', trim((string) $this->_request->comment_client) . "\n");
}
$comments .= sprintf('Rakuten Order No: %s', (string) $this->_request->order_no . "\n") . sprintf('Rakuten Client ID: %s', (string) $this->_request->client->client_id . "\n");
$order->info['comments'] = $comments;
$order->info['rakuten_order_no'] = (string) $this->_request->order_no;
$billing_addr = $this->_request->client;
$order->customer['email_address'] = (string) $billing_addr->email;
$order->customer['firstname'] = $this->_escape_str_revert((string) $billing_addr->first_name);
$order->customer['lastname'] = $this->_escape_str_revert((string) $billing_addr->last_name);
$order->customer['telephone'] = (string) $billing_addr->phone;
$billing_country_result = xtc_db_query("SELECT countries_id, countries_name from " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . (string) $billing_addr->country . "' ");
if (xtc_db_num_rows($billing_country_result)) {
$billing_country = xtc_db_fetch_array($billing_country_result);
} else {
$billing_country['countries_id'] = -1;
$billing_country['countries_name'] = (string) $billing_addr->country;
}
$order->billing['firstname'] = (string) $billing_addr->first_name;
$order->billing['lastname'] = (string) $billing_addr->last_name;
$order->billing['company'] = (string) $billing_addr->company;
$order->billing['street_address'] = (string) $billing_addr->street . " " . (string) $billing_addr->street_no . ((string) $billing_addr->address_add ? '<br />' . (string) $billing_addr->address_add : '');
$order->billing['city'] = (string) $billing_addr->city;
$order->billing['postcode'] = (string) $billing_addr->zip_code;
$order->billing['country']['title'] = $billing_country['countries_name'];
$order->billing['country']['iso_code_2'] = (string) $billing_addr->country;
$order->billing['format_id'] = '5';
$shipping_addr = $this->_request->delivery_address;
$shipping_country_result = xtc_db_query("SELECT countries_id, countries_name from " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . (string) $shipping_addr->country . "' ");
if (xtc_db_num_rows($shipping_country_result)) {
$shipping_country = xtc_db_fetch_array($shipping_country_result);
} else {
$shipping_country['countries_id'] = -1;
$shipping_country['countries_name'] = (string) $shipping_addr->country;
}
$order->delivery['firstname'] = (string) $shipping_addr->first_name;
$order->delivery['lastname'] = (string) $shipping_addr->last_name;
$order->delivery['company'] = (string) $shipping_addr->company;
$order->delivery['street_address'] = (string) $shipping_addr->street . " " . (string) $shipping_addr->street_no . ((string) $shipping_addr->address_add ? '<br />' . (string) $shipping_addr->address_add : '');
$order->delivery['city'] = (string) $shipping_addr->city;
$order->delivery['postcode'] = (string) $shipping_addr->zip_code;
$order->delivery['country']['title'] = $shipping_country['countries_name'];
$order->delivery['country']['iso_code_2'] = (string) $shipping_addr->country;
$order->delivery['format_id'] = '5';
$order->info['payment_method'] = 'rakuten';
$order->info['payment_class'] = '';
$order->info['shipping_method'] = 'rakuten';
$order->info['shipping_class'] = '';
$sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_firstname' => $order->customer['firstname'], 'customers_lastname' => $order->customer['lastname'], 'customers_cid' => $order->customer['csID'], 'customers_vat_id' => $_SESSION['customer_vat_id'], 'customers_company' => $order->customer['company'], 'customers_status' => $_SESSION['customers_status']['customers_status_id'], 'customers_status_name' => $_SESSION['customers_status']['customers_status_name'], 'customers_status_image' => $_SESSION['customers_status']['customers_status_image'], 'customers_status_discount' => $discount, 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], 'customers_postcode' => $order->customer['postcode'], 'customers_state' => $order->customer['state'], 'customers_country' => $order->customer['country']['title'], 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 'delivery_firstname' => $order->delivery['firstname'], 'delivery_lastname' => $order->delivery['lastname'], 'delivery_company' => $order->delivery['company'], 'delivery_street_address' => $order->delivery['street_address'], 'delivery_suburb' => $order->delivery['suburb'], 'delivery_city' => $order->delivery['city'], 'delivery_postcode' => $order->delivery['postcode'], 'delivery_state' => $order->delivery['state'], 'delivery_country' => $order->delivery['country']['title'], 'delivery_country_iso_code_2' => $order->delivery['country']['iso_code_2'], 'delivery_address_format_id' => $order->delivery['format_id'], 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_firstname' => $order->billing['firstname'], 'billing_lastname' => $order->billing['lastname'], 'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'], 'billing_suburb' => $order->billing['suburb'], 'billing_city' => $order->billing['city'], 'billing_postcode' => $order->billing['postcode'], 'billing_state' => $order->billing['state'], 'billing_country' => $order->billing['country']['title'], 'billing_country_iso_code_2' => $order->billing['country']['iso_code_2'], 'billing_address_format_id' => $order->billing['format_id'], 'payment_method' => $order->info['payment_method'], 'payment_class' => $order->info['payment_class'], 'shipping_method' => $order->info['shipping_method'], 'shipping_class' => $order->info['shipping_class'], 'cc_type' => $order->info['cc_type'], 'cc_owner' => $order->info['cc_owner'], 'cc_number' => $order->info['cc_number'], 'cc_expires' => $order->info['cc_expires'], 'cc_start' => $order->info['cc_start'], 'cc_cvv' => $order->info['cc_cvv'], 'cc_issue' => $order->info['cc_issue'], 'date_purchased' => 'now()', 'orders_status' => $tmp_status, 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value'], 'customers_ip' => $customers_ip, 'language' => $_SESSION['language'], 'comments' => $order->info['comments'], 'rakuten_order_no' => $order->info['rakuten_order_no']);
xtc_db_perform(TABLE_ORDERS, $sql_data_array);
$insert_id = xtc_db_insert_id();
$_SESSION['tmp_oID'] = $insert_id;
$sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_SUBTOTAL . ':', 'text' => ' ' . sprintf("%01.2f EUR", (double) $this->_request->total - (double) $this->_request->shipping - (double) $this->_request->total_tax_amount), 'value' => (double) $this->_request->total - (double) $this->_request->shipping - (double) $this->_request->total_tax_amount, 'class' => 'ot_subtotal', 'sort_order' => 10);
xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
$sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_SHIPPING . ':', 'text' => ' ' . sprintf("%01.2f EUR", (double) $this->_request->shipping), 'value' => (double) $this->_request->shipping, 'class' => 'ot_shipping', 'sort_order' => 30);
xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
$sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_TAX . ':', 'text' => ' ' . sprintf("%01.2f EUR", (double) $this->_request->total_tax_amount), 'value' => (double) $this->_request->total_tax_amount, 'class' => 'ot_tax', 'sort_order' => 97);
xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
$sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_TOTAL . ':', 'text' => sprintf("<b> %01.2f EUR</b>", (double) $this->_request->total), 'value' => (double) $this->_request->total, 'class' => 'ot_total', 'sort_order' => 99);
xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
$customer_notification = '0';
$sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => $order->info['order_status'], 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']);
xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
require_once DIR_FS_CATALOG . 'gm/inc/set_shipping_status.php';
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
/**
* Stock update
*/
if (STOCK_LIMITED == 'true') {
if (DOWNLOAD_ENABLED == 'true') {
$stock_query_raw = "SELECT p.products_quantity, pad.products_attributes_filename\n FROM " . TABLE_PRODUCTS . " p\n LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n ON p.products_id=pa.products_id\n LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n ON pa.products_attributes_id=pad.products_attributes_id\n WHERE p.products_id = '" . xtc_get_prid($order->products[$i]['id']) . "'";
$products_attributes = $order->products[$i]['attributes'];
if (is_array($products_attributes)) {
$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
//.........这里部分代码省略.........
示例14: xtc_set_groups
/**
* xtc_set_groups()
*
* @param mixed $categories_id
* @param mixed $permission_array
* @return
*/
function xtc_set_groups($categories_id, $permission_array)
{
// get products in categorie
$products_query = xtc_db_query("SELECT products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories_id . "'");
while ($products = xtc_db_fetch_array($products_query)) {
xtc_db_perform(TABLE_PRODUCTS, $permission_array, 'update', 'products_id = \'' . $products['products_id'] . '\'');
}
// set status of categorie
xtc_db_perform(TABLE_CATEGORIES, $permission_array, 'update', 'categories_id = \'' . $categories_id . '\'');
// look for deeper categories and go rekursiv
$categories_query = xtc_db_query("SELECT categories_id FROM " . TABLE_CATEGORIES . " where parent_id='" . $categories_id . "'");
while ($categories = xtc_db_fetch_array($categories_query)) {
xtc_set_groups($categories['categories_id'], $permission_array);
}
}
示例15: _parse_response_payone_api
function _parse_response_payone_api($redirect = true)
{
global $insert_id;
if ($this->response instanceof Payone_Api_Response_Preauthorization_Approved || $this->response instanceof Payone_Api_Response_Authorization_Approved) {
$sql_data_array = array('bankaccountholder' => $this->response->getClearingBankaccountholder(), 'bankcountry' => $this->response->getClearingBankcountry(), 'bankaccount' => $this->response->getClearingBankaccount(), 'bankcode' => $this->response->getClearingBankcode(), 'bankiban' => $this->response->getClearingBankiban(), 'bankbic' => $this->response->getClearingBankbic(), 'bankcity' => $this->response->getClearingBankcity(), 'bankname' => $this->response->getClearingBankname(), 'orders_id' => (int) $insert_id);
xtc_db_perform('payone_clearingdata', $sql_data_array);
}
if ($this->response instanceof Payone_Api_Response_Preauthorization_Approved) {
$this->payone->log("preauthorization approved");
$this->payone->saveTransaction($insert_id, $this->response->getStatus(), $this->response->getTxid(), $this->response->getUserid());
$this->_updateOrdersStatus($insert_id, $this->response->getTxid(), strtolower((string) $this->response->getStatus()), COMMENT_PREAUTH_APPROVED);
} elseif ($this->response instanceof Payone_Api_Response_Authorization_Approved) {
$this->payone->log("authorization approved");
$this->payone->saveTransaction($insert_id, $this->response->getStatus(), $this->response->getTxid(), $this->response->getUserid());
$this->_updateOrdersStatus($insert_id, $this->response->getTxid(), strtolower((string) $this->response->getStatus()), COMMENT_AUTH_APPROVED);
} elseif ($this->response instanceof Payone_Api_Response_Authorization_Redirect) {
$this->payone->log("authorization for order " . $insert_id . " initiated, txid = " . $this->response->getTxid());
if ($this->response->getStatus() == 'REDIRECT') {
$this->payone->saveTransaction($insert_id, $this->response->getStatus(), $this->response->getTxid(), $this->response->getUserid());
$this->payone->log("redirecting to payment service");
$this->_updateOrdersStatus($insert_id, $this->response->getTxid(), strtolower((string) $this->response->getStatus()), COMMENT_REDIRECTION_INITIATED);
$redirect_url = $this->response->getRedirecturl();
if ($redirect_url != '') {
xtc_redirect($redirect_url);
}
}
} elseif ($this->response instanceof Payone_Api_Response_Error) {
$this->payone->log("authorization for order " . $insert_id . " failed, status " . $this->response->getStatus() . ", code " . $this->response->getErrorcode() . ", message " . $this->response->getErrormessage());
$this->_updateOrdersStatus($insert_id, '', strtolower((string) $this->response->getStatus()), COMMENT_ERROR);
$_SESSION['payone_error'] = $this->response->getCustomermessage();
$this->_remove_order($insert_id);
if ($_SESSION[$this->code]['installment_type'] == 'klarna') {
xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'conditions=true&payment_error=' . $this->code));
} else {
xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code));
}
} else {
die('unhandled response type');
}
}