• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP xos_db_fetch_array函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中xos_db_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP xos_db_fetch_array函数的具体用法?PHP xos_db_fetch_array怎么用?PHP xos_db_fetch_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了xos_db_fetch_array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: xos_update_whos_online

function xos_update_whos_online()
{
    global $session_started;
    if (isset($_SESSION['customer_id'])) {
        $wo_customer_id = $_SESSION['customer_id'];
        $customer_query = xos_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $_SESSION['customer_id'] . "'");
        $customer = xos_db_fetch_array($customer_query);
        $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname'];
    } else {
        $wo_customer_id = '';
        $wo_full_name = 'Guest';
    }
    $wo_session_id = xos_session_id();
    $wo_ip_address = getenv('REMOTE_ADDR');
    $wo_last_page_url = getenv('REQUEST_URI');
    $current_time = time();
    $xx_mins_ago = $current_time - 900;
    // remove entries that have expired
    xos_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");
    if ($session_started) {
        $where_str = " where session_id = '" . xos_db_input($wo_session_id) . "'";
    } else {
        $where_str = " where session_id = '' and ip_address = '" . xos_db_input($wo_ip_address) . "'";
    }
    $stored_customer_query = xos_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . $where_str);
    $stored_customer = xos_db_fetch_array($stored_customer_query);
    if ($stored_customer['count'] > 0) {
        xos_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int) $wo_customer_id . "', full_name = '" . xos_db_input($wo_full_name) . "', ip_address = '" . xos_db_input($wo_ip_address) . "', time_last_click = '" . xos_db_input($current_time) . "', last_page_url = '" . xos_db_input($wo_last_page_url) . "'" . $where_str);
    } else {
        xos_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . (int) $wo_customer_id . "', '" . xos_db_input($wo_full_name) . "', '" . xos_db_input($wo_session_id) . "', '" . xos_db_input($wo_ip_address) . "', '" . xos_db_input($current_time) . "', '" . xos_db_input($current_time) . "', '" . xos_db_input($wo_last_page_url) . "')");
    }
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:32,代码来源:whos_online.php


示例2: update_status

 function update_status()
 {
     global $order, $customer_id;
     if ($this->enabled == true && (int) MODULE_PAYMENT_INVOICE_ZONE > 0) {
         $check_flag = false;
         $check_query = xos_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_INVOICE_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
         while ($check = xos_db_fetch_array($check_query)) {
             if ($check['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check['zone_id'] == $order->billing['zone_id']) {
                 $check_flag = true;
                 break;
             }
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     $test_query = xos_db_query("select count(*) as total from " . TABLE_ORDERS . " where customers_id='" . $_SESSION['customer_id'] . "' AND orders_status >= '" . MODULE_PAYMENT_INVOICE_ORDER_STATUS_ID . "'");
     $result = xos_db_fetch_array($test_query);
     if ($result['total'] + 1 < MODULE_PAYMENT_INVOICE_FROM_ORDER) {
         $this->enabled = false;
     }
     // disable the module if the order only contains virtual products
     if ($this->enabled == true && $order->content_type == 'virtual' && MODULE_PAYMENT_INVOICE_ENABLED_FOR_DOWNLOADS == 'false') {
         $this->enabled = false;
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:29,代码来源:invoice.php


示例3: update_status

 function update_status()
 {
     global $order;
     if ($this->enabled == true && (int) MODULE_PAYMENT_COD_ZONE > 0) {
         $check_flag = false;
         $check_query = xos_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_COD_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while ($check = xos_db_fetch_array($check_query)) {
             if ($check['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
     // disable the module if the order only contains virtual products
     if ($this->enabled == true) {
         if ($order->content_type == 'virtual') {
             $this->enabled = false;
         }
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:26,代码来源:cod.php


示例4: __construct

 function __construct(&$current_page_number, $max_rows_per_page, &$sql_query, &$query_num_rows, $count_key = '*')
 {
     $current_page_number = empty($current_page_number) || $current_page_number < 1 ? 1 : (int) $current_page_number;
     $pos_to = strlen($sql_query);
     $pos_from = strpos($sql_query, ' from', 0);
     $pos_group_by = strpos($sql_query, ' group by', $pos_from);
     if ($pos_group_by < $pos_to && $pos_group_by != false) {
         $pos_to = $pos_group_by;
     }
     $pos_having = strpos($sql_query, ' having', $pos_from);
     if ($pos_having < $pos_to && $pos_having != false) {
         $pos_to = $pos_having;
     }
     $pos_order_by = strpos($sql_query, ' order by', $pos_from);
     if ($pos_order_by < $pos_to && $pos_order_by != false) {
         $pos_to = $pos_order_by;
     }
     if (strpos($sql_query, 'distinct') || strpos($sql_query, 'group by')) {
         $count_string = 'distinct ' . xos_db_input($count_key);
     } else {
         $count_string = xos_db_input($count_key);
     }
     $reviews_count_query = xos_db_query("select count(" . $count_string . ") as total " . substr($sql_query, $pos_from, $pos_to - $pos_from));
     $reviews_count = xos_db_fetch_array($reviews_count_query);
     $query_num_rows = $reviews_count['total'];
     $num_pages = ceil($query_num_rows / $max_rows_per_page);
     if ($current_page_number > $num_pages) {
         $current_page_number = $num_pages;
     }
     $offset = $max_rows_per_page * ($current_page_number - 1);
     $sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:32,代码来源:split_page_results.php


示例5: query

 function query($order_id)
 {
     $order_query = xos_db_query("select customers_c_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, AES_DECRYPT(cc_number, 'key_cc_number') AS cc_number, cc_expires, language_id, language_directory, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
     $order = xos_db_fetch_array($order_query);
     $this->info = array('language_id' => $order['language_id'], 'language_directory' => $order['language_directory'], 'currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order['orders_status'], 'last_modified' => $order['last_modified']);
     $this->customer = array('c_id' => $order['customers_c_id'], 'name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']);
     $this->delivery = array('name' => $order['delivery_name'], 'company' => $order['delivery_company'], 'street_address' => $order['delivery_street_address'], 'suburb' => $order['delivery_suburb'], 'city' => $order['delivery_city'], 'postcode' => $order['delivery_postcode'], 'state' => $order['delivery_state'], 'country' => $order['delivery_country'], 'format_id' => $order['delivery_address_format_id']);
     $this->billing = array('name' => $order['billing_name'], 'company' => $order['billing_company'], 'street_address' => $order['billing_street_address'], 'suburb' => $order['billing_suburb'], 'city' => $order['billing_city'], 'postcode' => $order['billing_postcode'], 'state' => $order['billing_state'], 'country' => $order['billing_country'], 'format_id' => $order['billing_address_format_id']);
     $index = 0;
     $orders_products_query = xos_db_query("select orders_products_id, products_id, products_model, products_name, products_p_unit, products_price, final_price, products_price_text, final_price_text, total_price_text, products_tax, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $order_id . "'");
     while ($orders_products = xos_db_fetch_array($orders_products_query)) {
         $this->products[$index] = array('qty' => $orders_products['products_quantity'], 'id' => $orders_products['products_id'], 'model' => $orders_products['products_model'], 'name' => $orders_products['products_name'], 'packaging_unit' => $orders_products['products_p_unit'], 'tax' => $orders_products['products_tax'], 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price'], 'price_formated' => $orders_products['products_price_text'], 'final_price_formated' => $orders_products['final_price_text'], 'total_price_formated' => $orders_products['total_price_text']);
         $subindex = 0;
         $attributes_query = xos_db_query("select products_options, products_options_values, options_values_price, options_values_price_text, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $order_id . "' and orders_products_id = '" . (int) $orders_products['orders_products_id'] . "'");
         if (xos_db_num_rows($attributes_query)) {
             while ($attributes = xos_db_fetch_array($attributes_query)) {
                 $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price'], 'price_formated' => $attributes['options_values_price_text']);
                 $subindex++;
             }
         }
         $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1';
         $index++;
     }
     $totals_query = xos_db_query("select title, text, tax, class from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' order by sort_order, orders_total_id");
     while ($totals = xos_db_fetch_array($totals_query)) {
         $this->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'tax' => $totals['tax'], 'class' => $totals['class']);
         if ($totals['tax'] > -1 && ($totals['class'] == 'ot_shipping' || $totals['class'] == 'ot_loworderfee' || $totals['class'] == 'ot_cod_fee')) {
             $this->info['tax_groups']["{$totals['tax']}"] = '1';
         }
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:order.php


示例6: __construct

 function __construct()
 {
     $this->currencies = array();
     $currencies_query = xos_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES . " where language_id = '" . (int) $_SESSION['used_lng_id'] . "'");
     while ($currencies = xos_db_fetch_array($currencies_query)) {
         $this->currencies[$currencies['code']] = array('title' => $currencies['title'], 'symbol_left' => $currencies['symbol_left'], 'symbol_right' => $currencies['symbol_right'], 'decimal_point' => $currencies['decimal_point'], 'thousands_point' => $currencies['thousands_point'], 'decimal_places' => $currencies['decimal_places'], 'value' => $currencies['value']);
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:8,代码来源:currencies.php


示例7: __construct

 function __construct($pmInfo_array)
 {
     $this->payment_code = $pmInfo_array['payment_code'];
     for ($i = 0, $n = sizeof($pmInfo_array) - 1; $i < $n; $i++) {
         $key_value_query = xos_db_query("select configuration_title, configuration_value, configuration_description from " . TABLE_CONFIGURATION . " where configuration_key = '" . $pmInfo_array[$i] . "'");
         $key_value = xos_db_fetch_array($key_value_query);
         $this->keys[$pmInfo_array[$i]]['title'] = $key_value['configuration_title'];
         $this->keys[$pmInfo_array[$i]]['value'] = $key_value['configuration_value'];
         $this->keys[$pmInfo_array[$i]]['description'] = $key_value['configuration_description'];
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:11,代码来源:payment_module_info.php


示例8: xos_get_categories_string

 function xos_get_categories_string($parent_id = '', $entrance = false, $categories_string = '')
 {
     if ($entrance) {
         $categories_string = " p2c.categories_or_pages_id = '" . $parent_id . "'";
     }
     $categories_query = xos_db_query("select c.categories_or_pages_id, cpd.categories_or_pages_name, c.parent_id from " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_CATEGORIES_OR_PAGES_DATA . " cpd where c.categories_or_pages_id = cpd.categories_or_pages_id and cpd.language_id = '" . (int) $_SESSION['used_lng_id'] . "' and c.parent_id = '" . (int) $parent_id . "' order by c.sort_order, cpd.categories_or_pages_name");
     while ($categories = xos_db_fetch_array($categories_query)) {
         $categories_string .= " or p2c.categories_or_pages_id = '" . $categories['categories_or_pages_id'] . "'";
         $categories_string = xos_get_categories_string($categories['categories_or_pages_id'], '', $categories_string);
     }
     return $categories_string;
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:12,代码来源:xsell.php


示例9: xos_update_products_date_available

function xos_update_products_date_available()
{
    global $smarty;
    $expected_query = xos_db_query("select products_id  from " . TABLE_PRODUCTS . " p where to_days(now()) >= to_days(p.products_date_available)");
    if (xos_db_num_rows($expected_query)) {
        while ($expected = xos_db_fetch_array($expected_query)) {
            xos_db_query("update " . TABLE_PRODUCTS . " set products_last_modified = now(), products_date_available = null where products_id = '" . (int) $expected['products_id'] . "'");
        }
        $smarty->clearCache(null, 'L3|cc_index_default');
        $smarty->clearCache(null, 'L3|cc_product_info');
    }
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:12,代码来源:reset_and_update.php


示例10: __construct

 function __construct($lng = '')
 {
     $this->languages = array('ar' => 'ar([-_][[:alpha:]]{2})?|arabic', 'bg' => 'bg|bulgarian', 'br' => 'pt[-_]br|brazilian portuguese', 'ca' => 'ca|catalan', 'cs' => 'cs|czech', 'da' => 'da|danish', 'de' => 'de([-_][[:alpha:]]{2})?|german', 'el' => 'el|greek', 'en' => 'en([-_][[:alpha:]]{2})?|english', 'es' => 'es([-_][[:alpha:]]{2})?|spanish', 'et' => 'et|estonian', 'fi' => 'fi|finnish', 'fr' => 'fr([-_][[:alpha:]]{2})?|french', 'gl' => 'gl|galician', 'he' => 'he|hebrew', 'hu' => 'hu|hungarian', 'id' => 'id|indonesian', 'it' => 'it|italian', 'ja' => 'ja|japanese', 'ko' => 'ko|korean', 'ka' => 'ka|georgian', 'lt' => 'lt|lithuanian', 'lv' => 'lv|latvian', 'nl' => 'nl([-_][[:alpha:]]{2})?|dutch', 'no' => 'no|norwegian', 'pl' => 'pl|polish', 'pt' => 'pt([-_][[:alpha:]]{2})?|portuguese', 'ro' => 'ro|romanian', 'ru' => 'ru|russian', 'sk' => 'sk|slovak', 'sr' => 'sr|serbian', 'sv' => 'sv|swedish', 'th' => 'th|thai', 'tr' => 'tr|turkish', 'uk' => 'uk|ukrainian', 'tw' => 'zh[-_]tw|chinese traditional', 'zh' => 'zh|chinese simplified');
     $this->catalog_languages = array();
     $languages_query = xos_db_query("select languages_id, use_in_id, name, code, image, directory from " . TABLE_LANGUAGES . " where use_in_id <> '2' order by sort_order");
     while ($languages = xos_db_fetch_array($languages_query)) {
         $this->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'], 'use_in_id' => $languages['use_in_id'], 'name' => $languages['name'], 'code' => $languages['code'], 'image' => $languages['image'], 'directory' => $languages['directory']);
     }
     $this->browser_languages = '';
     $this->language = '';
     $this->set_language($lng);
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:12,代码来源:language.php


示例11: _sess_write

 function _sess_write($key, $val)
 {
     global $SESS_LIFE;
     $expiry = time() + $SESS_LIFE;
     $value = $val;
     $qid = xos_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . xos_db_input($key) . "'");
     $total = xos_db_fetch_array($qid);
     if ($total['total'] > 0) {
         return xos_db_query("update " . TABLE_SESSIONS . " set expiry = '" . xos_db_input($expiry) . "', value = '" . xos_db_input($value) . "' where sesskey = '" . xos_db_input($key) . "'");
     } else {
         return xos_db_query("insert into " . TABLE_SESSIONS . " values ('" . xos_db_input($key) . "', '" . xos_db_input($expiry) . "', '" . xos_db_input($value) . "')");
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:13,代码来源:sessions.php


示例12: __construct

 function __construct($module = '')
 {
     global $customer_group_id;
     if (defined('MODULE_PAYMENT_INSTALLED') && xos_not_null(MODULE_PAYMENT_INSTALLED)) {
         $customer_payment_query = xos_db_query("select group_payment_allowed as payment_allowed from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id =  '" . $customer_group_id . "'");
         if ($customer_payment = xos_db_fetch_array($customer_payment_query)) {
             if (xos_not_null($customer_payment['payment_allowed'])) {
                 $temp_payment_array = explode(';', $customer_payment['payment_allowed']);
                 $installed_modules = explode(';', MODULE_PAYMENT_INSTALLED);
                 for ($n = 0; $n < sizeof($installed_modules); $n++) {
                     // check to see if a payment method is not de-installed
                     if (in_array($installed_modules[$n], $temp_payment_array)) {
                         $payment_array[] = $installed_modules[$n];
                     }
                 }
                 $this->modules = $payment_array;
             } else {
                 $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
             }
         } else {
             $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
         }
         $include_modules = array();
         if (xos_not_null($module) && in_array($module . '.' . substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.') + 1), $this->modules)) {
             $this->selected_module = $module;
             $include_modules[] = array('class' => $module, 'file' => $module . '.php');
         } else {
             reset($this->modules);
             while (list(, $value) = each($this->modules)) {
                 $class = substr($value, 0, strrpos($value, '.'));
                 $include_modules[] = array('class' => $class, 'file' => $value);
             }
         }
         for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) {
             include DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/modules/payment/' . $include_modules[$i]['file'];
             include DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file'];
             $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']();
         }
         if (xos_count_payment_modules() == 1 && (!isset($_SESSION['payment']) || isset($_SESSION['payment']) && !is_object($_SESSION['payment']))) {
             $_SESSION['payment'] = $include_modules[0]['class'];
         }
         if (xos_not_null($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) {
             $this->form_action_url = $GLOBALS[$module]->form_action_url;
         }
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:46,代码来源:payment.php


示例13: __construct

 function __construct($query, $max_rows, $count_key = '*', $page_holder = 'page')
 {
     $this->sql_query = $query;
     $this->page_name = $page_holder;
     if (isset($_GET[$page_holder])) {
         $page = (int) $_GET[$page_holder];
     } elseif (isset($_POST[$page_holder])) {
         $page = (int) $_POST[$page_holder];
     } else {
         $page = 1;
     }
     if (empty($page) || $page < 1) {
         $page = 1;
     }
     $this->current_page_number = $page;
     $this->number_of_rows_per_page = $max_rows;
     $pos_to = strlen($this->sql_query);
     $pos_from = strpos($this->sql_query, ' from', 0);
     $pos_group_by = strpos($this->sql_query, ' group by', $pos_from);
     if ($pos_group_by < $pos_to && $pos_group_by != false) {
         $pos_to = $pos_group_by;
     }
     $pos_having = strpos($this->sql_query, ' having', $pos_from);
     if ($pos_having < $pos_to && $pos_having != false) {
         $pos_to = $pos_having;
     }
     $pos_order_by = strpos($this->sql_query, ' order by', $pos_from);
     if ($pos_order_by < $pos_to && $pos_order_by != false) {
         $pos_to = $pos_order_by;
     }
     if (strpos($this->sql_query, 'distinct') || strpos($this->sql_query, 'group by')) {
         $count_string = 'distinct ' . xos_db_input($count_key);
     } else {
         $count_string = xos_db_input($count_key);
     }
     $count_query = xos_db_query("select count(" . $count_string . ") as total " . substr($this->sql_query, $pos_from, $pos_to - $pos_from));
     $count = xos_db_fetch_array($count_query);
     $this->number_of_rows = $count['total'];
     $this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);
     if ($this->current_page_number > $this->number_of_pages) {
         $this->current_page_number = $this->number_of_pages;
     }
     $offset = $this->number_of_rows_per_page * ($this->current_page_number - 1);
     $this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page;
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:45,代码来源:split_page_results.php


示例14: xos_get_category_tree_for_movings

function xos_get_category_tree_for_movings($parent_id = '0', $spacing = '', $category_tree_array = '', $move_product = false)
{
    if (!is_array($category_tree_array)) {
        $category_tree_array = array();
    }
    if (sizeof($category_tree_array) < 1) {
        $category_tree_array[] = $move_product ? array('id' => '0', 'text' => TEXT_TOP, 'params' => 'style="color: grey;" disabled="disabled"') : array('id' => '0', 'text' => TEXT_TOP);
    }
    $categories_query = xos_db_query("select c.categories_or_pages_id, cpd.categories_or_pages_name, c.parent_id, c.categories_or_pages_status from " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_CATEGORIES_OR_PAGES_DATA . " cpd where c.categories_or_pages_id = cpd.categories_or_pages_id and c.is_page = 'false' and cpd.language_id = '" . (int) $_SESSION['used_lng_id'] . "' and c.parent_id = '" . (int) $parent_id . "' order by c.sort_order, cpd.categories_or_pages_name");
    while ($categories = xos_db_fetch_array($categories_query)) {
        if (xos_children_in_category_count($categories['categories_or_pages_id']) > 0 && $move_product || xos_children_in_category_count($categories['categories_or_pages_id']) == 0 && xos_products_in_category_count($categories['categories_or_pages_id'], true) > 0 && !$move_product) {
            $category_tree_array[] = array('id' => $categories['categories_or_pages_id'], 'text' => $spacing . $categories['categories_or_pages_name'], 'params' => 'style="color: grey;" disabled="disabled"');
        } else {
            $category_tree_array[] = array('id' => $categories['categories_or_pages_id'], 'text' => $spacing . $categories['categories_or_pages_name'], 'params' => $categories['categories_or_pages_status'] == 0 ? 'style="color: red;"' : '');
        }
        $category_tree_array = xos_get_category_tree_for_movings($categories['categories_or_pages_id'], $spacing . '&nbsp;&nbsp;&nbsp;', $category_tree_array, $move_product);
    }
    return $category_tree_array;
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:19,代码来源:infobox_categories.php


示例15: update_status

 function update_status()
 {
     global $order;
     if ($this->enabled == true && (int) MODULE_SHIPPING_FLAT_ZONE > 0) {
         $check_flag = false;
         $check_query = xos_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
         while ($check = xos_db_fetch_array($check_query)) {
             if ($check['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:20,代码来源:flat.php


示例16: __construct

 function __construct($module = '')
 {
     global $customer_group_id;
     if (defined('MODULE_SHIPPING_INSTALLED') && xos_not_null(MODULE_SHIPPING_INSTALLED)) {
         $customer_shipment_query = xos_db_query("select group_shipment_allowed as shipment_allowed from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id =  '" . $customer_group_id . "'");
         if ($customer_shipment = xos_db_fetch_array($customer_shipment_query)) {
             if (xos_not_null($customer_shipment['shipment_allowed'])) {
                 $temp_shipment_array = explode(';', $customer_shipment['shipment_allowed']);
                 $installed_modules = explode(';', MODULE_SHIPPING_INSTALLED);
                 for ($n = 0; $n < sizeof($installed_modules); $n++) {
                     // check to see if a shipping module is not de-installed
                     if (in_array($installed_modules[$n], $temp_shipment_array)) {
                         $shipment_array[] = $installed_modules[$n];
                     }
                 }
                 $this->modules = $shipment_array;
             } else {
                 $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);
             }
         } else {
             $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);
         }
         $include_modules = array();
         if (xos_not_null($module) && in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.') + 1), $this->modules)) {
             $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.') + 1));
         } else {
             reset($this->modules);
             while (list(, $value) = each($this->modules)) {
                 $class = substr($value, 0, strrpos($value, '.'));
                 $include_modules[] = array('class' => $class, 'file' => $value);
             }
         }
         for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) {
             include DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/modules/shipping/' . $include_modules[$i]['file'];
             include DIR_WS_MODULES . 'shipping/' . $include_modules[$i]['file'];
             $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']();
         }
     }
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:39,代码来源:shipping.php


示例17: array

         $contents[] = array('text' => '<br /><a href="" onclick="currencies.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_UPDATE . ' ">' . BUTTON_TEXT_UPDATE . '</a><a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
         break;
     case 'delete':
         $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_CURRENCY . '</b>';
         $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
         $contents[] = array('text' => '<br /><b>' . $cInfo->title . '</b>');
         $contents[] = array('text' => '<br />' . '<a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a>' . ($remove_currency ? '<a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>' : '') . '<br />&nbsp;');
         break;
     default:
         if (is_object($cInfo)) {
             $heading_title = '<b>' . $cInfo->title . '</b>';
             $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
             $languages = xos_get_languages();
             for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                 $currency_query = xos_db_query("select title, symbol_left, symbol_right, decimal_point, thousands_point from " . TABLE_CURRENCIES . " where currencies_id = '" . $cInfo->currencies_id . "' and language_id = '" . (int) $languages[$i]['id'] . "'");
                 $currency = xos_db_fetch_array($currency_query);
                 $contents[] = array('text' => '<br />&nbsp;<br />' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']));
                 $contents[] = array('text' => TEXT_INFO_CURRENCY_TITLE . ' ' . $currency['title']);
                 $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . ' ' . $currency['symbol_left']);
                 $contents[] = array('text' => TEXT_INFO_CURRENCY_SYMBOL_RIGHT . ' ' . $currency['symbol_right']);
                 $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENCY_DECIMAL_POINT . ' ' . $currency['decimal_point']);
                 $contents[] = array('text' => TEXT_INFO_CURRENCY_THOUSANDS_POINT . ' ' . $currency['thousands_point']);
             }
             $contents[] = array('text' => '<br />&nbsp;<br />&nbsp;<br />' . TEXT_INFO_CURRENCY_CODE . ' ' . $cInfo->code);
             $contents[] = array('text' => TEXT_INFO_CURRENCY_DECIMAL_PLACES . ' ' . $cInfo->decimal_places);
             $contents[] = array('text' => TEXT_INFO_CURRENCY_VALUE . ' ' . number_format($cInfo->value, 8));
             $contents[] = array('text' => TEXT_INFO_CURRENCY_EXAMPLE . ' ' . $currencies->format('30') . ' = ' . $currencies->format('30', true, $cInfo->code));
             $contents[] = array('text' => TEXT_INFO_CURRENCY_LAST_UPDATED . ' ' . xos_date_short($cInfo->last_updated));
         }
         break;
 }
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:infobox_currencies.php


示例18: xos_redirect

 if (PRODUCT_REVIEWS_ENABLED != 'true') {
     xos_redirect(xos_href_link(FILENAME_DEFAULT), false);
 } elseif (!isset($_SESSION['customer_id'])) {
     $_SESSION['navigation']->remove_current_page();
     $_SESSION['navigation']->set_snapshot();
     xos_redirect(xos_href_link(FILENAME_LOGIN, '', 'SSL'));
 }
 $product_info_query = xos_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_p_unit from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_or_pages_status = '1' and p.products_id = p2c.products_id and p2c.categories_or_pages_id = c.categories_or_pages_id and p.products_id = '" . (int) $_GET['p'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'");
 if (!xos_db_num_rows($product_info_query)) {
     xos_redirect(xos_href_link(FILENAME_PRODUCT_REVIEWS, xos_get_all_get_params(array('action'))), false);
 } else {
     $product_info = xos_db_fetch_array($product_info_query);
     $products_image_name = xos_get_product_images($product_info['products_image'], 'all');
 }
 $customer_query = xos_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $_SESSION['customer_id'] . "'");
 $customer = xos_db_fetch_array($customer_query);
 if (isset($_GET['action']) && $_GET['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $_SESSION['sessiontoken']) {
     $rating = xos_db_prepare_input($_POST['rating']);
     $review = xos_db_prepare_input(substr(strip_tags($_POST['review']), 0, 1000));
     $error = false;
     if (strlen($review) < REVIEW_TEXT_MIN_LENGTH) {
         $error = true;
         $messageStack->add('review', JS_REVIEW_TEXT);
     }
     if ($rating < 1 || $rating > 5) {
         $error = true;
         $messageStack->add('review', JS_REVIEW_RATING);
     }
     if ($error == false) {
         xos_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . (int) $_GET['p'] . "', '" . (int) $_SESSION['customer_id'] . "', '" . xos_db_input($customer['customers_firstname']) . ' ' . xos_db_input($customer['customers_lastname']) . "', '" . xos_db_input($rating) . "', now())");
         $insert_id = xos_db_insert_id();
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:product_reviews_write.php


示例19: isset

//              Copyright (c) 2003 osCommerce
//              filename: stats_products_viewed.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
require 'includes/application_top.php';
if (!(@(include DIR_FS_SMARTY . 'admin/templates/' . ADMIN_TPL . '/php/' . FILENAME_STATS_PRODUCTS_VIEWED) == 'overwrite_all')) {
    $javascript = '<script type="text/javascript" src="' . DIR_WS_ADMIN . 'includes/general.js"></script>' . "\n";
    require DIR_WS_INCLUDES . 'html_header.php';
    require DIR_WS_INCLUDES . 'header.php';
    require DIR_WS_INCLUDES . 'column_left.php';
    require DIR_WS_INCLUDES . 'footer.php';
    isset($_GET['page']) && $_GET['page'] > 1 ? $rows = $_GET['page'] * MAX_DISPLAY_RESULTS - MAX_DISPLAY_RESULTS : ($rows = 0);
    $products_query_raw = "select p.products_id, pd.products_name, ps.products_viewed, l.name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_STATS . " ps, " . TABLE_LANGUAGES . " l where p.products_id = pd.products_id and p.products_id = ps.products_id and l.languages_id = pd.language_id and l.languages_id = ps.language_id order by ps.products_viewed DESC";
    $products_split = new splitPageResults($_GET['page'], MAX_DISPLAY_RESULTS, $products_query_raw, $products_query_numrows);
    $products_query = xos_db_query($products_query_raw);
    $products_array = array();
    while ($products = xos_db_fetch_array($products_query)) {
        $ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP xos_db_input函数代码示例发布时间:2022-05-23
下一篇:
PHP xos_date_short函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap