Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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';
         }
     }
 }
Ejemplo n.º 3
0
 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']);
     }
 }
Ejemplo n.º 4
0
function xos_update_new_order_date()
{
    global $smarty;
    $new_order_date_query = xos_db_query("select last_modified  from " . TABLE_CONFIGURATION . " where configuration_key = 'NEW_ORDER' and configuration_value = 'true' and now() > date_add(last_modified,interval " . UPDATE_INTERVAL_AFTER_NEW_ORDER . " day)");
    if (xos_db_num_rows($new_order_date_query)) {
        xos_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = 'false', last_modified = null where configuration_key = 'NEW_ORDER'");
        $smarty->clearAllCache();
    }
}
Ejemplo n.º 5
0
 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'];
     }
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
 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;
         }
     }
 }
Ejemplo n.º 9
0
 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;
 }
Ejemplo n.º 10
0
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;
}
Ejemplo n.º 11
0
 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']();
         }
     }
 }
Ejemplo n.º 12
0
             $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_NAME_ERROR_EMPTY . '<br />');
         } else {
             $contents[] = array('text' => '<br />' . sprintf(TEXT_INFO_ZONES_NAME_ERROR, $_GET['error_name']) . '<br />');
         }
     }
     $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_NAME . '<br />' . xos_draw_input_field('zone_name', isset($_GET['zone_name']) ? $_GET['zone_name'] : $cInfo->zone_name) . xos_draw_hidden_field('actual_zone_name', $cInfo->zone_name));
     $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_CODE . '<br />' . xos_draw_input_field('zone_code', isset($_GET['zone_code']) ? $_GET['zone_code'] : $cInfo->zone_code));
     if (!xos_db_num_rows($check_query) && STORE_ZONE != $cInfo->zone_id) {
         $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME . '<br />' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(), isset($_GET['zone_country_id']) ? $_GET['zone_country_id'] : $cInfo->countries_id, 'style="font-size:9px"') . xos_draw_hidden_field('actual_zone_country_id', $cInfo->countries_id));
     } else {
         $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME . '<br /><b>' . $cInfo->countries_name . '</b>' . xos_draw_hidden_field('zone_country_id', $cInfo->countries_id) . xos_draw_hidden_field('actual_zone_country_id', $cInfo->countries_id));
     }
     $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPDATE . ' "><span>' . BUTTON_TEXT_UPDATE . '</span></a><a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'delete':
     $check_query = xos_db_query("select ab.entry_zone_id, zgz.zone_id from " . TABLE_ADDRESS_BOOK . " ab, " . TABLE_ZONES_TO_GEO_ZONES . " zgz where ab.entry_zone_id = '" . (int) $cInfo->zone_id . "' or zgz.zone_id = '" . (int) $cInfo->zone_id . "' LIMIT 1");
     $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>';
     if (!xos_db_num_rows($check_query) && STORE_ZONE != $cInfo->zone_id) {
         $form_tag = xos_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=deleteconfirm');
         $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
         $contents[] = array('text' => '<br /><b>' . $cInfo->zone_name . '</b>');
         $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     } else {
         $contents[] = array('text' => TEXT_INFO_DELETE_NOT_ALLOWED . '<br /><br />');
         $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_ZONES, xos_get_all_get_params(array('action'))) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_BACK . ' "><span>' . BUTTON_TEXT_BACK . '</span></a><br />&nbsp;');
     }
     break;
 default:
     if (isset($cInfo) && is_object($cInfo)) {
         $heading_title = '<b>' . $cInfo->zone_name . '</b>';
         $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=edit') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_EDIT . ' "><span>' . BUTTON_TEXT_EDIT . '</span></a><a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=delete') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a>');
Ejemplo n.º 13
0
}
require DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/' . FILENAME_PRODUCTS_NEW;
$site_trail->add(NAVBAR_TITLE, xos_href_link(FILENAME_PRODUCTS_NEW, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'x', 'y'))));
require DIR_WS_INCLUDES . 'html_header.php';
require DIR_WS_INCLUDES . 'boxes.php';
require DIR_WS_INCLUDES . 'header.php';
require DIR_WS_INCLUDES . 'footer.php';
if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) {
    $smarty->caching = 1;
    $cache_id = 'L3|cc_products_new|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency'] . '-' . $_SESSION['sppc_customer_group_id'] . '-' . $_SESSION['sppc_customer_group_show_tax'] . '-' . $_SESSION['sppc_customer_group_tax_exempt'] . '-' . $_GET['page'];
}
if (!$smarty->isCached(SELECTED_TPL . '/products_new.tpl', $cache_id)) {
    $products_new_query_raw = "select distinct p.products_id, p.products_delivery_time_id, pd.products_name, pd.products_p_unit, pd.products_info, p.products_model, p.products_quantity, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, mi.manufacturers_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS_INFO . " mi on (p.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int) $_SESSION['languages_id'] . "'), " . TABLE_PRODUCTS_DESCRIPTION . " pd where c.categories_or_pages_status = '1' and p.products_id = p2c.products_id and c.categories_or_pages_id = p2c.categories_or_pages_id and p.products_status = '1' and p.products_date_added > '" . date("Y-m-d", mktime(1, 1, 1, date("m"), date("d") - INTERVAL_DAYS_BACK, date("Y"))) . "' and p.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "' order by p.products_date_added DESC, pd.products_name";
    $products_new_split = new splitPageResultsBootstrap($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW, 'p.products_id');
    if ($products_new_split->number_of_rows > 0) {
        $products_new_query = xos_db_query($products_new_split->sql_query);
        $products_new_array = array();
        while ($products_new = xos_db_fetch_array($products_new_query)) {
            $products_prices = xos_get_product_prices($products_new['products_price']);
            $products_tax_rate = xos_get_tax_rate($products_new['products_tax_class_id']);
            $price_breaks_array = array();
            if (isset($products_prices[$customer_group_id][0])) {
                $product_price = $currencies->display_price($products_prices[$customer_group_id][0]['regular'], $products_tax_rate);
                $products_prices[$customer_group_id]['special_status'] == 1 && $products_prices[$customer_group_id][0]['special'] > 0 ? $product_price_special = $currencies->display_price($products_prices[$customer_group_id][0]['special'], $products_tax_rate) : ($product_price_special = '');
                $sizeof = count($products_prices[$customer_group_id]);
                if ($sizeof > 2) {
                    $array_keys = array_keys($products_prices[$customer_group_id]);
                    for ($count = 2, $n = $sizeof; $count < $n; $count++) {
                        $qty = $array_keys[$count];
                        $price_breaks_array[] = array('qty' => $qty, 'price_break' => $currencies->display_price($products_prices[$customer_group_id][$qty]['regular'], $products_tax_rate), 'price_break_special' => $products_prices[$customer_group_id]['special_status'] == 1 && $products_prices[$customer_group_id][$qty]['special'] > 0 ? $currencies->display_price($products_prices[$customer_group_id][$qty]['special'], $products_tax_rate) : '');
                    }
Ejemplo n.º 14
0
//
//              You should have received a copy of the GNU General Public License
//              along with XOS-Shop.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
require 'includes/application_top.php';
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/' . FILENAME_OFFLINE) == 'overwrite_all')) {
    header('HTTP/1.1 503 Service Temporarily Unavailable');
    header('Status: 503 Service Temporarily Unavailable');
    $_SESSION['navigation']->remove_current_page();
    require DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/' . FILENAME_OFFLINE;
    $error = false;
    if (isset($_GET['action']) && $_GET['action'] == 'process') {
        $email_address = xos_db_prepare_input($_POST['email_address']);
        $password = xos_db_prepare_input($_POST['password']);
        // Check if email exists
        $check_admin_query = xos_db_query("select admin_id as login_id, admin_email_address as login_email_address, admin_password as login_password from " . TABLE_ADMIN . " where admin_email_address = '" . xos_db_input($email_address) . "'");
        if (!xos_db_num_rows($check_admin_query)) {
            $error = true;
        } else {
            $check_admin = xos_db_fetch_array($check_admin_query);
            // Check that password is good
            if (!xos_validate_password($password, $check_admin['login_password'])) {
                $error = true;
            } else {
                $_SESSION['access_allowed'] = true;
                xos_redirect(xos_href_link(FILENAME_DEFAULT), false);
            }
        }
    }
    if ($error == true) {
        unset($_SESSION['access_allowed']);
     } elseif ($_GET['error'] == 'email_not_valid') {
         $contents[] = array('text' => TEXT_INFO_ERROR_EMAIL_NOT_VALID);
     }
     $contents[] = array('text' => xos_draw_hidden_field('admin_id', $mInfo->admin_id));
     $contents[] = array('text' => '<br />' . TEXT_INFO_FIRSTNAME . '<br />' . xos_draw_input_field('admin_firstname', $mInfo->admin_firstname));
     $contents[] = array('text' => '<br />' . TEXT_INFO_LASTNAME . '<br />' . xos_draw_input_field('admin_lastname', $mInfo->admin_lastname));
     if (isset($_GET['error'])) {
         $contents[] = array('text' => '<br />' . TEXT_INFO_EMAIL . '<br />' . xos_draw_input_field('admin_email_address'));
     } else {
         $contents[] = array('text' => '<br />' . TEXT_INFO_EMAIL . '<br />' . xos_draw_input_field('admin_email_address', $mInfo->admin_email_address));
     }
     if ($mInfo->admin_id == 1) {
         $contents[] = array('text' => xos_draw_hidden_field('admin_groups_id', $mInfo->admin_groups_id));
     } else {
         $groups_array = array(array('id' => '0', 'text' => TEXT_NONE));
         $groups_query = xos_db_query("select admin_groups_id, admin_groups_name from " . TABLE_ADMIN_GROUPS);
         while ($groups = xos_db_fetch_array($groups_query)) {
             $groups_array[] = array('id' => $groups['admin_groups_id'], 'text' => $groups['admin_groups_name']);
         }
         $contents[] = array('text' => '<br />' . TEXT_INFO_GROUP . '<br />' . xos_draw_pull_down_menu('admin_groups_id', $groups_array, $mInfo->admin_groups_id));
     }
     $contents[] = array('text' => '<br /><a href="" onclick="validateForm(); if(document.returnValue)newmember.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPDATE . ' "><span>' . BUTTON_TEXT_UPDATE . '</span></a><a href="' . xos_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $_GET['page'] . '&mID=' . $_GET['mID']) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'del_member':
     $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE . '</b>';
     if ($mInfo->admin_id == 1 || $mInfo->admin_email_address == STORE_OWNER_EMAIL_ADDRESS) {
         $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->admin_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_BACK . ' "><span>' . BUTTON_TEXT_BACK . '</span></a><br />&nbsp;');
     } else {
         $form_tag = xos_draw_form('edit', FILENAME_ADMIN_MEMBERS, 'action=member_delete&page=' . $_GET['page'] . '&mID=' . $admin['admin_id'], 'post', 'enctype="multipart/form-data"');
         $contents[] = array('text' => xos_draw_hidden_field('admin_id', $mInfo->admin_id));
         $contents[] = array('text' => sprintf(TEXT_INFO_DELETE_INTRO, $mInfo->admin_firstname . ' ' . $mInfo->admin_lastname));
Ejemplo n.º 16
0
     if ($option_id == $opt['options_id']) {
         $i--;
     }
     $opt_array[$i] = array('options_id' => $opt['options_id'], 'options_name' => $opt['products_options_name'], 'options_values_qty' => $option_id == $opt['options_id'] || $option_id == '' ? $ii : ($ii = 1));
     $option_id = $opt['options_id'];
     $i++;
     $ii++;
 }
 reset($opt_array);
 for ($i = sizeof($opt_array) - 1, $n = 0; $i >= $n; $i--) {
     $opt_array[$i]['rows_per_value'] = max(1, $opt_array[$i + 1]['rows_per_value']) * max(1, $opt_array[$i + 1]['options_values_qty']);
 }
 $opt_array['rows_total'] = $opt_array[0]['rows_per_value'] * $opt_array[0]['options_values_qty'];
 reset($opt_array);
 for ($i = 0, $n = sizeof($opt_array); $i < $n; $i++) {
     $opt_values_query = xos_db_query("select distinct pa.products_attributes_id, pa.options_values_id, pa.options_values_sort_order, po.products_options_name, pov.products_options_values_name from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int) $_GET['products_id'] . "' and pa.options_id = '" . (int) $opt_array[$i]['options_id'] . "' and pa.options_id = po.products_options_id and pa.options_values_id = pov.products_options_values_id and po.language_id = pov.language_id and po.language_id = '" . (int) $_SESSION['used_lng_id'] . "' order by pa.options_sort_order, pa.options_id, pa.options_values_sort_order, pov.products_options_values_name");
     while ($opt_values = xos_db_fetch_array($opt_values_query)) {
         $opt_values_array[$opt_array[$i]['options_id']][] = array('options_values_id' => $opt_values['options_values_id'], 'options_values_name' => $opt_values['products_options_values_name']);
     }
 }
 reset($opt_values_array);
 for ($i = 0, $n = $opt_array['rows_total']; $i < $n; $i++) {
     $comb_string = '';
     for ($ii = 0, $m = sizeof($opt_values_array); $ii < $m; $ii++) {
         if ($i < $opt_array[$ii]['rows_per_value'] * max(1, $opt_rows_array[$ii] + 1)) {
         } else {
             $opt_rows_array[$ii] = $opt_rows_array[$ii] + 1;
             $opt_out_array[$ii] = $opt_out_array[$ii] + 1;
             if ($opt_out_array[$ii] % $opt_array[$ii]['options_values_qty'] == 0) {
                 $opt_out_array[$ii] = 0;
             }
Ejemplo n.º 17
0
        //        $lc_text = '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('page', 'info', 'sort', 'lnc', 'cur', 'tpl')) . 'page=1&sort=' . $col . ($_GET['sort'] == $col . 'a' ? 'd' : 'a')) . '" title=" ' . xos_output_string(TEXT_SORT_PRODUCTS . ($_GET['sort'] == $col . 'd' || substr($_GET['sort'], 0, 1) != $col || empty($_GET['sort']) ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . ' ">' . $heading;
        //        $lc_text .= (!empty($_GET['sort']) && substr($_GET['sort'], 0, 1) == $col ? (substr($_GET['sort'], 1, 1) == 'a' ? xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/arrow_asc_default.gif', xos_output_string(TEXT_SORT_PRODUCTS . ($_GET['sort'] == $col . 'd' || substr($_GET['sort'], 0, 1) != $col ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading)) : xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/arrow_desc_default.gif', xos_output_string(TEXT_SORT_PRODUCTS . ($_GET['sort'] == $col . 'd' || substr($_GET['sort'], 0, 1) != $col ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading))) : xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/arrow_asc_desc_default.gif', xos_output_string(TEXT_SORT_PRODUCTS . TEXT_ASCENDINGLY . TEXT_BY . $heading))) . '</a>';
        //      }
    }
    //    if(!$product_list_b) {
    //      $table_heading_array[]=array('text' => $lc_text,
    //                                   'case' => $case);
    //    }
    if (!empty($_GET['sort']) && substr($_GET['sort'], 0, 1) == $col) {
        $selected_none = false;
    }
}
if ($listing_split->number_of_rows > 0) {
    $rows = 0;
    $table_outer_array = array();
    $listing_query = xos_db_query($listing_split->sql_query);
    while ($listing = xos_db_fetch_array($listing_query)) {
        $rows++;
        $products_prices = xos_get_product_prices($listing['products_price']);
        $products_tax_rate = xos_get_tax_rate($listing['products_tax_class_id']);
        $price_breaks = false;
        $price_breaks_array = array();
        if (isset($products_prices[$customer_group_id][0])) {
            $product_price = $currencies->display_price($products_prices[$customer_group_id][0]['regular'], $products_tax_rate);
            $products_prices[$customer_group_id]['special_status'] == 1 && $products_prices[$customer_group_id][0]['special'] > 0 ? $product_price_special = $currencies->display_price($products_prices[$customer_group_id][0]['special'], $products_tax_rate) : ($product_price_special = '');
            $sizeof = count($products_prices[$customer_group_id]);
            if ($sizeof > 2) {
                $price_breaks = true;
                $array_keys = array_keys($products_prices[$customer_group_id]);
                for ($count = 2, $n = $sizeof; $count < $n; $count++) {
                    $qty = $array_keys[$count];
 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();
         xos_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . (int) $insert_id . "', '" . (int) $_SESSION['languages_id'] . "', '" . xos_db_input($review) . "')");
         $smarty->clearCache(null, 'L3|cc_reviews');
         $smarty->clearCache(null, 'L3|cc_product_reviews');
         xos_redirect(xos_href_link(FILENAME_PRODUCT_REVIEWS, xos_get_all_get_params(array('action', 'rmp')) . 'rmp=0'), false);
     }
 }
 require DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/' . FILENAME_PRODUCT_REVIEWS_WRITE;
 $site_trail->add(NAVBAR_TITLE, xos_href_link(FILENAME_PRODUCT_REVIEWS, xos_get_all_get_params()));
 $add_header = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'function checkForm() {' . "\n" . '  var error = 0;' . "\n" . '  var error_message = "' . JS_ERROR . '";' . "\n\n" . '  var review = document.product_reviews_write.review.value;' . "\n\n" . '  if (review.length < ' . REVIEW_TEXT_MIN_LENGTH . ') {' . "\n" . '    error_message = error_message + "* ' . JS_REVIEW_TEXT . '\\n";' . "\n" . '    error = 1;' . "\n" . '  }' . "\n\n" . '  if ((document.product_reviews_write.rating[0].checked) || (document.product_reviews_write.rating[1].checked) || (document.product_reviews_write.rating[2].checked) || (document.product_reviews_write.rating[3].checked) || (document.product_reviews_write.rating[4].checked)) {' . "\n" . '  } else {' . "\n" . '    error_message = error_message + "* ' . JS_REVIEW_RATING . '\\n";' . "\n" . '    error = 1;' . "\n" . '  }' . "\n\n" . '  if (error == 1) {' . "\n" . '    alert(error_message);' . "\n" . '    return false;' . "\n" . '  } else {' . "\n" . '    return true;' . "\n" . '  }' . "\n" . '}' . "\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
 require DIR_WS_INCLUDES . 'html_header.php';
 require DIR_WS_INCLUDES . 'boxes.php';
 require DIR_WS_INCLUDES . 'header.php';
 require DIR_WS_INCLUDES . 'footer.php';
 $products_prices = xos_get_product_prices($product_info['products_price']);
 $products_tax_rate = xos_get_tax_rate($product_info['products_tax_class_id']);
 $price_breaks_array = array();
Ejemplo n.º 19
0
$site_trail->add(NAVBAR_TITLE_1, xos_href_link(FILENAME_ACCOUNT, '', 'SSL'));
$site_trail->add(NAVBAR_TITLE_2, xos_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
require DIR_WS_INCLUDES . 'html_header.php';
require DIR_WS_INCLUDES . 'boxes.php';
require DIR_WS_INCLUDES . 'header.php';
require DIR_WS_INCLUDES . 'footer.php';
$orders_total = xos_count_customer_orders();
if ($orders_total > 0) {
    $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int) $_SESSION['customer_id'] . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int) $_SESSION['languages_id'] . "' and s.public_flag = '1' group by o.orders_id order by o.orders_id DESC";
    $history_split = new splitPageResultsBootstrap($history_query_raw, MAX_DISPLAY_ORDER_HISTORY, 'o.orders_id');
    $history_query = xos_db_query($history_split->sql_query);
    $orders_array = array();
    while ($history = xos_db_fetch_array($history_query)) {
        $products_query = xos_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $history['orders_id'] . "'");
        $products = xos_db_fetch_array($products_query);
        $oder_total_query = xos_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $history['orders_id'] . "' and class = 'ot_total' order by orders_total_id DESC limit 1");
        $oder_total = xos_db_fetch_array($oder_total_query);
        if (xos_not_null($history['delivery_name'])) {
            $order_type = 'shipped_to';
            $order_name = $history['delivery_name'];
        } else {
            $order_type = 'billed_to';
            $order_name = $history['billing_name'];
        }
        $orders_array[] = array('link_filename_account_history_info' => xos_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL'), 'order_id' => $history['orders_id'], 'order_status_name' => $history['orders_status_name'], 'date_purchased' => xos_date_long($history['date_purchased']), 'order_type' => $order_type, 'order_name' => xos_output_string_protected($order_name), 'products_count' => $products['count'], 'order_total' => strip_tags($oder_total['text']));
    }
    $smarty->assign(array('orders' => true, 'nav_bar_number' => $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS), 'nav_bar_result' => '<nav><ul class="pagination">' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>'));
}
$smarty->assign(array('orders_array' => $orders_array, 'link_filename_account' => xos_href_link(FILENAME_ACCOUNT, '', 'SSL')));
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'account_history');
$output_account_history = $smarty->fetch(SELECTED_TPL . '/account_history.tpl');
Ejemplo n.º 20
0
 function remove()
 {
     xos_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
 }
Ejemplo n.º 21
0
         xos_redirect(xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
     }
 }
 if (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
     $entry_query = xos_db_query("select entry_gender, entry_company, entry_company_tax_id, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $_SESSION['customer_id'] . "' and address_book_id = '" . (int) $_GET['edit'] . "'");
     if (!xos_db_num_rows($entry_query)) {
         $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
         xos_redirect(xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
     }
     $entry = xos_db_fetch_array($entry_query);
 } elseif (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
     if ($_GET['delete'] == $_SESSION['customer_default_address_id']) {
         $messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning');
         xos_redirect(xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
     } else {
         $check_query = xos_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int) $_GET['delete'] . "' and customers_id = '" . (int) $_SESSION['customer_id'] . "'");
         $check = xos_db_fetch_array($check_query);
         if ($check['total'] < 1) {
             $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
             xos_redirect(xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
         }
     }
 } else {
     $entry = array();
 }
 if (!isset($_GET['delete']) && !isset($_GET['edit'])) {
     if (xos_count_customer_address_book_entries() >= MAX_ADDRESS_BOOK_ENTRIES) {
         $messageStack->add_session('addressbook', ERROR_ADDRESS_BOOK_FULL);
         xos_redirect(xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
     }
 }
Ejemplo n.º 22
0
             xos_redirect(xos_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page']));
             break;
     }
 }
 $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';
 $manufacturers_query_raw = "select m.manufacturers_id, m.manufacturers_image, m.date_added, m.last_modified, mi.manufacturers_name from " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int) $_SESSION['used_lng_id'] . "' order by mi.manufacturers_name";
 $manufacturers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_RESULTS, $manufacturers_query_raw, $manufacturers_query_numrows);
 $manufacturers_query = xos_db_query($manufacturers_query_raw);
 $manufacturers_array = array();
 while ($manufacturers = xos_db_fetch_array($manufacturers_query)) {
     if ((!isset($_GET['mID']) || isset($_GET['mID']) && $_GET['mID'] == $manufacturers['manufacturers_id']) && !isset($mInfo) && substr($action, 0, 3) != 'new') {
         $manufacturer_products_query = xos_db_query("select count(*) as products_count from " . TABLE_PRODUCTS . " where manufacturers_id = '" . (int) $manufacturers['manufacturers_id'] . "'");
         $manufacturer_products = xos_db_fetch_array($manufacturer_products_query);
         $mInfo_array = array_merge((array) $manufacturers, (array) $manufacturer_products);
         $mInfo = new objectInfo($mInfo_array);
     }
     $selected = false;
     if (isset($mInfo) && is_object($mInfo) && $manufacturers['manufacturers_id'] == $mInfo->manufacturers_id) {
         $selected = true;
         $link_filename_manufacturers = xos_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $manufacturers['manufacturers_id'] . '&action=edit');
     } else {
         $link_filename_manufacturers = xos_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $manufacturers['manufacturers_id']);
     }
     $manufacturers_array[] = array('selected' => $selected, 'link_filename_manufacturers' => $link_filename_manufacturers, 'name' => $manufacturers['manufacturers_name']);
 }
 if (empty($action)) {
     $smarty->assign('link_filename_manufacturers_action_new', xos_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=new'));
//              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)) {
        $rows++;
        if (strlen($rows) < 2) {
            $rows = '0' . $rows;
        }
        $products_array[] = array('link_filename_categories_action_product_preview' => xos_href_link(FILENAME_CATEGORIES, 'action=product_preview&read=only&pID=' . $products['products_id'] . '&origin=' . FILENAME_STATS_PRODUCTS_VIEWED . '?page=' . $_GET['page']), 'rows' => $rows, 'products_name' => $products['products_name'], 'name' => $products['name'], 'viewed' => $products['products_viewed']);
    }
    $smarty->assign(array('products' => $products_array, 'nav_bar_number' => $products_split->display_count($products_query_numrows, MAX_DISPLAY_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS), 'nav_bar_result' => $products_split->display_links($products_query_numrows, MAX_DISPLAY_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'])));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'stats_products_viewed');
    $output_stats_products_viewed = $smarty->fetch(ADMIN_TPL . '/stats_products_viewed.tpl');
    $smarty->assign('central_contents', $output_stats_products_viewed);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Ejemplo n.º 24
0
    $check_query = xos_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_key . "'");
    if (xos_db_num_rows($check_query)) {
        $check = xos_db_fetch_array($check_query);
        if ($check['configuration_value'] != implode(';', $installed_modules)) {
            xos_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $installed_modules) . "', last_modified = now() where configuration_key = '" . $module_key . "'");
        }
    } else {
        xos_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('" . $module_key . "', '" . implode(';', $installed_modules) . "', '6', '0', now())");
    }
    if ($template_integration == true) {
        $check_query = xos_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'TEMPLATE_BLOCK_GROUPS'");
        if (xos_db_num_rows($check_query)) {
            $check = xos_db_fetch_array($check_query);
            $tbgroups_array = explode(';', $check['configuration_value']);
            if (!in_array($module_type, $tbgroups_array)) {
                $tbgroups_array[] = $module_type;
                sort($tbgroups_array);
                xos_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $tbgroups_array) . "', last_modified = now() where configuration_key = 'TEMPLATE_BLOCK_GROUPS'");
            }
        } else {
            xos_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) values ('TEMPLATE_BLOCK_GROUPS', '" . $module_type . "', '6', '0', now())");
        }
    }
    $smarty->assign(array('modules' => $modules_array, 'directory_path' => $module_directory, 'heading_title' => HEADING_TITLE));
    require DIR_WS_BOXES . 'infobox_modules.php';
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'modules');
    $output_modules = $smarty->fetch(ADMIN_TPL . '/modules.tpl');
    $smarty->assign('central_contents', $output_modules);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Ejemplo n.º 25
0
     }
     $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;
Ejemplo n.º 26
0
         if (xos_not_null($products_options_array)) {
             $product_options_array[] = array('products_options_name' => $products_options_name['products_options_name'], 'products_options_id' => $products_options_name['products_options_id'], 'products_options_list_noscript' => $products_options_list_noscript, 'products_options_pull_down' => xos_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'class="form-control" id="option_' . $products_options_name['products_options_id'] . '" onchange="updateOptions(\'' . xos_href_link(FILENAME_UPDATE_OPTIONS, 'p=' . xos_get_prid($_GET['p']), 'NONSSL', true, false) . '\')"'));
             //                                           'products_options_pull_down' => xos_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, 'class="form-control" id="option_' . $products_options_name['products_options_id'] . '" onchange="change_action(this.form); this.form.submit();"'));
         }
     }
     $jscript_op = '<script type="text/javascript">' . "\n\n" . '    var http_request = false;' . "\n\n" . '    function updateOptions(url,serialized_attributes) {' . "\n\n" . '      var serialized_options = "";' . "\n\n" . '      if(typeof(serialized_attributes) == "undefined"){' . "\n" . '        for (var i = 0; i < document.getElementsByTagName("select").length; i++) {' . "\n" . '          if(document.getElementsByTagName("select")[i].form.name == "cart_quantity") {' . "\n" . '            option_name = document.getElementsByTagName("select")[i].name;' . "\n" . '            selected_options_value_id = document.getElementsByTagName("select")[i].options[document.getElementsByTagName("select")[i].selectedIndex].value;' . "\n" . '            serialized_options += option_name + "=" + selected_options_value_id + "&";' . "\n" . '          }' . "\n" . '        }' . "\n" . '      } else {' . "\n" . '        serialized_options = serialized_attributes;' . "\n" . '      }' . "\n\n" . '      http_request = false;' . "\n\n" . '      if (window.XMLHttpRequest) { // Mozilla, Safari,...' . "\n" . '        http_request = new XMLHttpRequest();' . "\n" . '        if (http_request.overrideMimeType) {' . "\n" . '          http_request.overrideMimeType("text/html");' . "\n" . '        }' . "\n" . '      } else if (window.ActiveXObject) { // IE' . "\n" . '        try {' . "\n" . '          http_request = new ActiveXObject("Msxml2.XMLHTTP");' . "\n" . '        } catch (e) {' . "\n" . '          try {' . "\n" . '            http_request = new ActiveXObject("Microsoft.XMLHTTP");' . "\n" . '          } catch (e) {}' . "\n" . '        }' . "\n" . '      }' . "\n\n" . '      if (!http_request) {' . "\n" . '        alert("Ende : Kann keine XMLHTTP-Instanz erzeugen");' . "\n" . '        return false;' . "\n" . '      }' . "\n" . '      http_request.onreadystatechange = response_processing;' . "\n" . '      http_request.open("POST", url, true);' . "\n" . '      http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");' . "\n" . '      http_request.send(encodeURI(serialized_options));' . "\n\n" . '    }' . "\n\n" . '    function response_processing() {' . "\n" . '      if (http_request.readyState == 1) {' . "\n" . '        document.getElementById("options").style.visibility = "hidden";' . "\n" . '        document.getElementById("loading").style.visibility = "visible";' . "\n" . '        document.getElementById("inc").style.visibility = "hidden";' . "\n" . '        document.getElementById("dec").style.visibility = "hidden";' . "\n" . '        document.getElementById("products_quantity").style.visibility = "hidden";' . "\n" . '        document.getElementById("add_to_cart").style.visibility = "hidden";' . "\n" . '      } else if (http_request.readyState == 4) {' . "\n" . '        if (http_request.status == 200) {' . "\n" . '          document.getElementById("options").innerHTML = http_request.responseText;' . "\n" . '          document.getElementById("options").style.visibility = "visible";' . "\n" . '          document.getElementById("loading").style.visibility = "hidden";' . "\n" . '          document.getElementById("inc").style.visibility = "visible";' . "\n" . '          document.getElementById("dec").style.visibility = "visible";' . "\n" . '          document.getElementById("products_quantity").style.visibility = "visible";' . "\n" . '          document.getElementById("add_to_cart").style.visibility = "visible";' . "\n" . '        } else {' . "\n" . '          alert("Bei dem Request ist ein Problem aufgetreten.");' . "\n" . '        }' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '    function getOptionsList(url) {' . "\n\n" . '      if (typeof(isLoaded) != "undefined" && isLoaded == true) {' . "\n" . '          toggle("box_products_options_overview");' . "\n" . '      } else {' . "\n\n" . '        http_request = false;' . "\n\n" . '        if (window.XMLHttpRequest) { // Mozilla, Safari,...' . "\n" . '            http_request = new XMLHttpRequest();' . "\n" . '            if (http_request.overrideMimeType) {' . "\n" . '                http_request.overrideMimeType("text/html");' . "\n" . '            }' . "\n" . '        } else if (window.ActiveXObject) { // IE' . "\n" . '            try {' . "\n" . '                http_request = new ActiveXObject("Msxml2.XMLHTTP");' . "\n" . '            } catch (e) {' . "\n" . '                try {' . "\n" . '                    http_request = new ActiveXObject("Microsoft.XMLHTTP");' . "\n" . '                } catch (e) {}' . "\n" . '            }' . "\n" . '        }' . "\n\n" . '        if (!http_request) {' . "\n" . '            alert("Ende : Kann keine XMLHTTP-Instanz erzeugen");' . "\n" . '            return false;' . "\n" . '        }' . "\n" . '        http_request.onreadystatechange = response_processing_list;' . "\n" . '        http_request.open("GET", url, true);' . "\n" . '        http_request.send(null);' . "\n\n" . '      }' . "\n\n" . '    }' . "\n\n" . '    function response_processing_list() {' . "\n" . '      if (http_request.readyState == 1) {' . "\n" . '        $("#loading_list").show(1);' . "\n" . '      } else if (http_request.readyState == 4) {' . "\n" . '        if (http_request.status == 200) {' . "\n" . '          document.getElementById("box_products_options_overview").innerHTML = http_request.responseText;' . "\n" . '          document.getElementById("loading_list").style.display = "none";' . "\n" . '          isLoaded = true;' . "\n" . '          toggle("box_products_options_overview");' . "\n" . '        } else {' . "\n" . '          alert("Bei dem Request ist ein Problem aufgetreten.");' . "\n" . '        }' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '    function getAbsoluteX (elm) {' . "\n" . '      var x = 0;' . "\n" . '      if (elm && typeof elm.offsetParent != "undefined") {' . "\n" . '        while (elm && typeof elm.offsetLeft == "number") {' . "\n" . '          x += elm.offsetLeft;' . "\n" . '          elm = elm.offsetParent;' . "\n" . '        }' . "\n" . '      }' . "\n" . '      return x;' . "\n" . '    }' . "\n\n" . '    function toggle(targetId) {' . "\n" . '      var elem = document.getElementById(targetId);' . "\n" . '      if (elem.style.display == "none"){' . "\n" . '        elem.style.display="block";' . "\n" . '        var x = getAbsoluteX(elem);' . "\n" . '        elem.style.display="none";' . "\n" . '        if (x < 0){' . "\n" . '          oldRightValue = elem.style.right;' . "\n" . '          $("#"+targetId).css({"right" : x+"px"}).show(1);' . "\n" . '        } else {' . "\n" . '          $("#"+targetId).show(1);' . "\n" . '        }' . "\n" . '      } else {' . "\n" . '        if(typeof(oldRightValue) != "undefined" && oldRightValue != ""){' . "\n" . '          elem.style.right=oldRightValue;' . "\n" . '        }' . "\n" . '        elem.style.display="none";' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '    function toggleByClassName(targetClass) {' . "\n" . '      var allElems = document.getElementsByTagName("span");' . "\n" . '      for (var i = 0; i < allElems.length; i++) {' . "\n" . '        var thisElem = allElems[i];' . "\n" . '        if (thisElem.className && thisElem.className == targetClass) {' . "\n" . '          if (thisElem.style.display == "none"){' . "\n" . '            thisElem.style.display = "";' . "\n" . '          } else {' . "\n" . '            thisElem.style.display = "none";' . "\n" . '          }' . "\n" . '        }' . "\n" . '      }' . "\n" . '    }' . "\n\n" . '</script>' . "\n";
     if (xos_not_null($attributes_quantity) && STOCK_CHECK == 'true') {
         if ($flag == false) {
             $combi_str .= $c_str;
         }
         $att_qty = $attributes_quantity[substr($combi_str, 0, -1)];
         $smarty->assign('qty_for_these_options', $att_qty > 0 ? $att_qty : '<span class="red-mark">' . $att_qty . '</span>');
     }
     $smarty->assign(array('link_options_noscript' => xos_href_link(FILENAME_OPTIONS_WINDOW, 'p=' . $product_info['products_id'] . '&products_name=' . urlencode($product_info['products_name'])), 'get_otions_list' => 'getOptionsList(\'' . xos_href_link(FILENAME_OPTIONS_LIST, 'p=' . xos_get_prid($_GET['p']), 'NONSSL', true, false) . '\');', 'products_options' => $product_options_array));
 }
 $reviews_query = xos_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int) $_GET['p'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $_SESSION['languages_id'] . "'");
 $reviews = xos_db_fetch_array($reviews_query);
 if ($reviews['count'] > 0) {
     $smarty->assign('reviews_count', $reviews['count']);
 }
 if (xos_not_null($product_info['products_url'])) {
     $smarty->assign('link_products_url', xos_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false));
 }
 if ($product_info['products_date_available'] > 0) {
     $smarty->assign('products_date_available', xos_date_long($product_info['products_date_available']));
 } else {
     $smarty->assign('products_date_added', xos_date_long($product_info['products_date_added']));
 }
 if (PRODUCT_REVIEWS_ENABLED == 'true') {
     $smarty->assign('link_filename_product_reviews', xos_href_link(FILENAME_PRODUCT_REVIEWS, xos_get_all_get_params(array('lnc', 'cur', 'tpl'))));
 }
Ejemplo n.º 27
0
//              GNU General Public License for more details.
//
//              You should have received a copy of the GNU General Public License
//              along with XOS-Shop.  If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
// this file is based on:
//              osCommerce, Open Source E-Commerce Solutions
//              http://www.oscommerce.com
//              Copyright (c) 2003 osCommerce
//              filename: xsell_products.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/modules/xsell_products.php') == 'overwrite_all')) {
    if (isset($_GET['p'])) {
        $xsell_query = xos_db_query("select distinct p.products_id, p.products_image, pd.products_name, pd.products_info, p.products_tax_class_id, p.products_price from " . TABLE_PRODUCTS_XSELL . " xp, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where xp.products_id = '" . (int) $_GET['p'] . "' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and p.products_id = p2c.products_id and p2c.categories_or_pages_id = c.categories_or_pages_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "' and p.products_status = '1' and c.categories_or_pages_status = '1' order by xp.sort_order ");
        $num_products_xsell = xos_db_num_rows($xsell_query);
        if ($num_products_xsell > 0) {
            $xsell_products_array = array();
            while ($xsell = xos_db_fetch_array($xsell_query)) {
                $products_prices = xos_get_product_prices($xsell['products_price']);
                $products_tax_rate = xos_get_tax_rate($xsell['products_tax_class_id']);
                $xsell_price_breaks_array = array();
                if (isset($products_prices[$customer_group_id][0])) {
                    $xsell_product_price = $currencies->display_price($products_prices[$customer_group_id][0]['regular'], $products_tax_rate);
                    $products_prices[$customer_group_id]['special_status'] == 1 && $products_prices[$customer_group_id][0]['special'] > 0 ? $xsell_product_price_special = $currencies->display_price($products_prices[$customer_group_id][0]['special'], $products_tax_rate) : ($xsell_product_price_special = '');
                    $sizeof = count($products_prices[$customer_group_id]);
                    /*          
                              if ($sizeof > 2) {
                                $array_keys = array_keys($products_prices[$customer_group_id]);
                                for ($count=2, $n=$sizeof; $count<$n; $count++) {
Ejemplo n.º 28
0
         $sql_data_array = array('entry_firstname' => $firstname, 'entry_lastname' => $lastname);
         if (ACCOUNT_GENDER == 'true') {
             $sql_data_array['entry_gender'] = $gender;
         }
         xos_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int) $_SESSION['customer_id'] . "' and address_book_id = '" . (int) $_SESSION['customer_default_address_id'] . "'");
         // reset the session variables
         if (ACCOUNT_GENDER == 'true') {
             $_SESSION['customer_gender'] = $gender;
         }
         $_SESSION['customer_first_name'] = $firstname;
         $_SESSION['customer_lastname'] = $lastname;
         $messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');
         xos_redirect(xos_href_link(FILENAME_ACCOUNT, '', 'SSL'));
     }
 }
 $account_query = xos_db_query("select customers_gender, customers_c_id, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_language_id, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $_SESSION['customer_id'] . "'");
 $account = xos_db_fetch_array($account_query);
 $site_trail->add(NAVBAR_TITLE_1, xos_href_link(FILENAME_ACCOUNT, '', 'SSL'));
 $site_trail->add(NAVBAR_TITLE_2, xos_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'));
 require DIR_WS_INCLUDES . 'html_header.php';
 require DIR_WS_INCLUDES . 'boxes.php';
 require DIR_WS_INCLUDES . 'header.php';
 require DIR_WS_INCLUDES . 'footer.php';
 if ($messageStack->size('account_edit') > 0) {
     $smarty->assign('message_stack', $messageStack->output('account_edit'));
     $smarty->assign('message_stack_error', $messageStack->output('account_edit', 'error'));
     $smarty->assign('message_stack_warning', $messageStack->output('account_edit', 'warning'));
     $smarty->assign('message_stack_success', $messageStack->output('account_edit', 'success'));
 }
 if (ACCOUNT_GENDER == 'true') {
     if (isset($gender)) {
Ejemplo n.º 29
0
 function _sess_gc($maxlifetime)
 {
     xos_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");
     return true;
 }
Ejemplo n.º 30
0
 }
 $sql_data_array = array('orders_id' => $insert_id, 'products_id' => xos_get_prid($order->products[$i]['id']), 'products_attributes_sting' => $attributes_sting, 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_p_unit' => $order->products[$i]['packaging_unit'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_price_text' => $order->products[$i]['price_formated'], 'final_price_text' => $order->products[$i]['final_price_formated'], 'total_price_text' => $order->products[$i]['total_price_formated'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']);
 xos_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
 $order_products_id = xos_db_insert_id();
 //------insert customer choosen option to order--------
 $attributes_exist = '0';
 $attributes_options_values_price = false;
 if (isset($order->products[$i]['attributes'])) {
     $attributes_exist = '1';
     $order_attributes_array = array();
     for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
         if (DOWNLOAD_ENABLED == 'true') {
             $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename \n                               from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa \n                               left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                on pa.products_attributes_id=pad.products_attributes_id\n                               where pa.products_id = '" . $order->products[$i]['id'] . "' \n                                and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' \n                                and pa.options_id = popt.products_options_id \n                                and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' \n                                and pa.options_values_id = poval.products_options_values_id \n                                and popt.language_id = '" . $_SESSION['languages_id'] . "' \n                                and poval.language_id = '" . $_SESSION['languages_id'] . "'";
             $attributes = xos_db_query($attributes_query);
         } else {
             $attributes = xos_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $_SESSION['languages_id'] . "' and poval.language_id = '" . $_SESSION['languages_id'] . "'");
         }
         $attributes_values = xos_db_fetch_array($attributes);
         $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $order->products[$i]['attributes'][$j]['price'], 'options_values_price_text' => $order->products[$i]['attributes'][$j]['price'] != 0 ? $order->products[$i]['attributes'][$j]['price_formated'] : '', 'price_prefix' => $attributes_values['price_prefix']);
         xos_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
         if (DOWNLOAD_ENABLED == 'true' && isset($attributes_values['products_attributes_filename']) && xos_not_null($attributes_values['products_attributes_filename'])) {
             $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'orders_products_filename' => $attributes_values['products_attributes_filename'], 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 'download_count' => $attributes_values['products_attributes_maxcount']);
             xos_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
         }
         $options_values_price = '';
         if ($attributes_values['options_values_price'] != 0) {
             $attributes_options_values_price = true;
             $options_values_price = $order->products[$i]['attributes'][$j]['price_formated'];
         }
         $order_attributes_array[] = array('option_name' => $attributes_values['products_options_name'], 'option_value_name' => $attributes_values['products_options_values_name'], 'option_price' => $options_values_price, 'option_price_prefix' => $attributes_values['price_prefix']);
     }