Ejemplo n.º 1
0
 function __construct($module, $user_id = null, $user_name = null)
 {
     $module = xos_sanitize_string(str_replace(' ', '', $module));
     if (defined('MODULE_ACTION_RECORDER_INSTALLED') && xos_not_null(MODULE_ACTION_RECORDER_INSTALLED)) {
         if (xos_not_null($module) && in_array($module . '.' . substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.') + 1), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) {
             if (!class_exists($module)) {
                 if (file_exists(DIR_FS_CATALOG . 'includes/modules/action_recorder/' . $module . '.' . substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.') + 1))) {
                     include DIR_FS_SMARTY . 'admin/languages/' . $_SESSION['language'] . '/modules/action_recorder/' . $module . '.' . substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.') + 1);
                     include DIR_FS_CATALOG . 'includes/modules/action_recorder/' . $module . '.' . substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.') + 1);
                 } else {
                     return false;
                 }
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
     $this->_module = $module;
     if (!empty($user_id) && is_numeric($user_id)) {
         $this->_user_id = $user_id;
     }
     if (!empty($user_name)) {
         $this->_user_name = $user_name;
     }
     $GLOBALS[$this->_module] = new $module();
     $GLOBALS[$this->_module]->setIdentifier();
 }
 function buildBlocks()
 {
     if (defined('TEMPLATE_BLOCK_GROUPS') && xos_not_null(TEMPLATE_BLOCK_GROUPS)) {
         $tbgroups_array = explode(';', TEMPLATE_BLOCK_GROUPS);
         foreach ($tbgroups_array as $group) {
             $module_key = 'MODULE_' . strtoupper($group) . '_INSTALLED';
             if (defined($module_key) && xos_not_null(constant($module_key))) {
                 $modules_array = explode(';', constant($module_key));
                 foreach ($modules_array as $module) {
                     $class = substr($module, 0, strrpos($module, '.'));
                     if (!class_exists($class)) {
                         if (file_exists(DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/modules/' . $group . '/' . $module)) {
                             include DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/modules/' . $group . '/' . $module;
                         }
                         if (file_exists(DIR_WS_MODULES . $group . '/' . $class . '.php')) {
                             include DIR_WS_MODULES . $group . '/' . $class . '.php';
                         }
                     }
                     if (class_exists($class)) {
                         $mb = new $class();
                         if ($mb->isEnabled()) {
                             $mb->execute();
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 function set_language($language)
 {
     if (xos_not_null($language) && isset($this->catalog_languages[$language])) {
         $this->language = $this->catalog_languages[$language];
     } else {
         $this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
     }
 }
Ejemplo n.º 4
0
 function is_set($code)
 {
     if (isset($this->currencies[$code]) && xos_not_null($this->currencies[$code])) {
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 5
0
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FLAT_TEXT_WAY, 'cost' => MODULE_SHIPPING_FLAT_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = xos_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (xos_not_null($this->icon)) {
         $this->quotes['icon'] = xos_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Ejemplo n.º 6
0
 function checkdnsrr($host, $type)
 {
     if (xos_not_null($host) && xos_not_null($type)) {
         @exec("nslookup -type=" . escapeshellarg($type) . " " . escapeshellarg($host), $output);
         reset($output);
         while (list($k, $line) = each($output)) {
             if (preg_match("/^{$host}/i", $line)) {
                 return true;
             }
         }
     }
     return false;
 }
Ejemplo n.º 7
0
function xos_validate_old_password($plain, $encrypted)
{
    if (xos_not_null($plain) && xos_not_null($encrypted)) {
        // split apart the hash / salt
        $stack = explode(':', $encrypted);
        if (sizeof($stack) != 2) {
            return false;
        }
        if (md5($stack[1] . $plain) == $stack[0]) {
            return true;
        }
    }
    return false;
}
Ejemplo n.º 8
0
 function breadcrumb_trail($separator = ' - ')
 {
     $trail_string = '';
     for ($i = 0, $n = sizeof($this->_trail); $i < $n; $i++) {
         if (isset($this->_trail[$i]['link']) && xos_not_null($this->_trail[$i]['link'])) {
             $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="header-navi">' . $this->_trail[$i]['title'] . '</a>';
         } else {
             $trail_string .= $this->_trail[$i]['title'];
         }
         if ($i + 1 < $n) {
             $trail_string .= $separator;
         }
     }
     return $trail_string;
 }
Ejemplo n.º 9
0
 function display_links($max_page_links, $parameters = '')
 {
     global $request_type;
     $display_links_string = '';
     if (xos_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // previous button
     if ($this->current_page_number > 1) {
         $display_links_string .= '<li><a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="page-results" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' ">' . PREVNEXT_BUTTON_PREV . '</a></li>';
     } elseif ($this->number_of_pages != 1) {
         $display_links_string .= '<li class="disabled"><span><span aria-hidden="true">' . PREVNEXT_BUTTON_PREV . '</span></span></li>';
     }
     // check if number_of_pages > $max_page_links
     $cur_window_num = intval($this->current_page_number / $max_page_links);
     if ($this->current_page_number % $max_page_links) {
         $cur_window_num++;
     }
     $max_window_num = intval($this->number_of_pages / $max_page_links);
     if ($this->number_of_pages % $max_page_links) {
         $max_window_num++;
     }
     // previous window of pages
     if ($cur_window_num > 1) {
         $display_links_string .= '<li><a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $this->page_name . '=' . ($cur_window_num - 1) * $max_page_links, $request_type) . '" class="page-results" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a></li>';
     }
     // page nn button
     for ($jump_to_page = 1 + ($cur_window_num - 1) * $max_page_links; $jump_to_page <= $cur_window_num * $max_page_links && $jump_to_page <= $this->number_of_pages; $jump_to_page++) {
         if ($jump_to_page == $this->current_page_number) {
             if ($this->number_of_pages > 1) {
                 $display_links_string .= '<li class="active"><span>' . $jump_to_page . '<span class="sr-only">(current)</span></span></li>';
             }
         } else {
             $display_links_string .= '<li><a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" class="page-results" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' ">' . $jump_to_page . '</a></li>';
         }
     }
     // next window of pages
     if ($cur_window_num < $max_window_num) {
         $display_links_string .= '<li><a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $this->page_name . '=' . ($cur_window_num * $max_page_links + 1), $request_type) . '" class="page-results" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a></li>';
     }
     // next button
     if ($this->current_page_number < $this->number_of_pages) {
         $display_links_string .= '<li><a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="page-results" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' ">' . PREVNEXT_BUTTON_NEXT . '</a></li>';
     } elseif ($this->number_of_pages != 1) {
         $display_links_string .= '<li class="disabled"><span><span aria-hidden="true">' . PREVNEXT_BUTTON_NEXT . '</span></span></li>';
     }
     return $display_links_string;
 }
Ejemplo n.º 10
0
 function execute()
 {
     global $templateIntegration;
     if (xos_not_null(MODULE_HEADER_TAGS_ROBOT_NOINDEX_PAGES)) {
         $pages_array = array();
         foreach (explode(';', MODULE_HEADER_TAGS_ROBOT_NOINDEX_PAGES) as $page) {
             $page = trim($page);
             if (!empty($page)) {
                 $pages_array[] = $page;
             }
         }
         if (in_array(basename($_SERVER['PHP_SELF']), $pages_array)) {
             $templateIntegration->addBlock('<meta name="robots" content="noindex,follow" />' . "\n", $this->group);
         }
     }
 }
Ejemplo n.º 11
0
function xos_expire_banners()
{
    $banners_query = xos_db_query("select b.banners_id, b.expires_date, b.expires_impressions, sum(bh.banners_shown) as banners_shown from " . TABLE_BANNERS . " b, " . TABLE_BANNERS_HISTORY . " bh where b.status = '1' and b.banners_id = bh.banners_id group by b.banners_id");
    if (xos_db_num_rows($banners_query)) {
        while ($banners = xos_db_fetch_array($banners_query)) {
            if (xos_not_null($banners['expires_date'])) {
                if (date('Y-m-d H:i:s') >= $banners['expires_date']) {
                    xos_set_banner_status($banners['banners_id'], '0');
                }
            } elseif (xos_not_null($banners['expires_impressions'])) {
                if ($banners['expires_impressions'] > 0 && $banners['banners_shown'] >= $banners['expires_impressions']) {
                    xos_set_banner_status($banners['banners_id'], '0');
                }
            }
        }
    }
}
Ejemplo n.º 12
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.º 13
0
 function process()
 {
     global $order, $currencies;
     if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
         switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
             case 'national':
                 if ($order->delivery['country_id'] == STORE_COUNTRY) {
                     $pass = true;
                 }
                 break;
             case 'international':
                 if ($order->delivery['country_id'] != STORE_COUNTRY) {
                     $pass = true;
                 }
                 break;
             case 'both':
                 $pass = true;
                 break;
             default:
                 $pass = false;
                 break;
         }
         if ($pass == true && $_SESSION['cart']->get_content_type() != 'virtual' && $order->info['subtotal'] >= $currencies->currencies[$_SESSION['currency']]['value'] * MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
             $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
             //          $order->info['total'] -= $order->info['shipping_cost'];
             $order->info['shipping_cost'] = 0;
         }
     }
     $module = substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_'));
     if (xos_not_null($order->info['shipping_method'])) {
         $order->info['shipping_cost'] = $order->info['currency_value'] * $order->info['shipping_cost'];
         //        if ($GLOBALS[$module]->tax_class > 0) {
         $shipping_tax = xos_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
         $shipping_tax_description = xos_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
         $shipping_tax_value = xos_calculate_tax($order->info['shipping_cost'], $shipping_tax);
         $order->info['tax'] += $order->info['shipping_tax'] = $shipping_tax_value;
         $order->info['tax_groups']["{$shipping_tax_description}"] += $shipping_tax_value;
         $order->info['total'] += $shipping_tax_value;
         if ($_SESSION['sppc_customer_group_show_tax'] == '1') {
             $order->info['shipping_cost'] += $shipping_tax_value;
         }
         //        }
         $this->output[] = array('title' => $order->info['shipping_method'] . ':', 'text' => $currencies->format($order->info['shipping_cost']), 'value' => $order->info['shipping_cost'], 'tax' => $order->info['shipping_method'] == FREE_SHIPPING_TITLE || strpos($order->info['shipping_method'], MODULE_SHIPPING_STORE_PICKUP_TEXT_TITLE) !== false && $order->info['shipping_cost'] == 0 ? -1 : xos_display_tax_value($shipping_tax));
     }
 }
Ejemplo n.º 14
0
 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     if (xos_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // calculate number of pages needing links
     $num_pages = ceil($query_numrows / $max_rows_per_page);
     $pages_array = array();
     for ($i = 1; $i <= $num_pages; $i++) {
         $pages_array[] = array('id' => $i, 'text' => $i);
     }
     if ($num_pages > 1) {
         $display_links = xos_draw_form('pages', basename($_SERVER['PHP_SELF']), '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number - 1)) . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
         } else {
             $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
         }
         $display_links .= sprintf(TEXT_RESULT_PAGE, xos_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onchange="this.form.submit();"'), $num_pages);
         if ($current_page_number < $num_pages && $num_pages != 1) {
             $display_links .= '&nbsp;&nbsp;<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number + 1)) . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
         } else {
             $display_links .= '&nbsp;&nbsp;' . PREVNEXT_BUTTON_NEXT;
         }
         if ($parameters != '') {
             if (substr($parameters, -1) == '&') {
                 $parameters = substr($parameters, 0, -1);
             }
             $pairs = explode('&', $parameters);
             while (list(, $pair) = each($pairs)) {
                 list($key, $value) = explode('=', $pair);
                 $display_links .= xos_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         if (SESSID) {
             $display_links .= xos_draw_hidden_field(xos_session_name(), xos_session_id());
         }
         $display_links .= '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
Ejemplo n.º 15
0
 function process()
 {
     $order_total_array = array();
     if (is_array($this->modules)) {
         reset($this->modules);
         while (list(, $value) = each($this->modules)) {
             $class = substr($value, 0, strrpos($value, '.'));
             if ($GLOBALS[$class]->enabled) {
                 $GLOBALS[$class]->output = array();
                 $GLOBALS[$class]->process();
                 for ($i = 0, $n = sizeof($GLOBALS[$class]->output); $i < $n; $i++) {
                     if (xos_not_null($GLOBALS[$class]->output[$i]['title']) && xos_not_null($GLOBALS[$class]->output[$i]['text'])) {
                         $order_total_array[] = array('code' => $GLOBALS[$class]->code, 'title' => $GLOBALS[$class]->output[$i]['title'], 'text' => $GLOBALS[$class]->output[$i]['text'], 'value' => $GLOBALS[$class]->output[$i]['value'], 'tax' => $GLOBALS[$class]->output[$i]['tax'], 'sort_order' => $GLOBALS[$class]->sort_order);
                     }
                 }
             }
         }
     }
     return $order_total_array;
 }
Ejemplo n.º 16
0
 $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']);
     }
 }
 //------insert customer choosen option eof ----
 $tax_rate = xos_display_tax_value($order->products[$i]['tax']);
 $order_products_array[] = array('qty' => $order->products[$i]['qty'], 'model' => $order->products[$i]['model'], 'name' => $order->products[$i]['name'], 'packaging_unit' => $order->products[$i]['packaging_unit'], 'tax_value' => $tax_rate, 'price' => $order->products[$i]['price_formated'], 'final_single_price' => $order->products[$i]['final_price_formated'], 'final_price' => $order->products[$i]['total_price_formated'], 'products_attributes_option_price' => $attributes_options_values_price, 'product_attributes' => $order_attributes_array);
 if (isset($tax_rate)) {
Ejemplo n.º 17
0
            $male = $account['customers_gender'] == 'm' ? true : false;
        }
        $female = !$male;
        $smarty->assign(array('account_gender' => true, 'input_gender' => xos_draw_radio_field('gender', 'm', $male, 'id="gender_m"') . '<label class="control-label" for="gender_m">&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;</label>' . xos_draw_radio_field('gender', 'f', $female, 'id="gender_f"') . '<label class="control-label" for="gender_f">&nbsp;&nbsp;' . FEMALE . '&nbsp;</label>' . (xos_not_null(ENTRY_GENDER_TEXT) ? '<span class="input-requirement">' . ENTRY_GENDER_TEXT . '</span>' : '')));
    }
    if (ACCOUNT_DOB == 'true') {
        $smarty->assign(array('account_dob' => true, 'input_dob' => xos_draw_input_field('dob', xos_date_short($account['customers_dob']), 'class="form-control" id="dob"') . '&nbsp;' . (xos_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="input-requirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>' : '')));
    }
    reset($lng->catalog_languages);
    if (sizeof($lng->catalog_languages) > 1) {
        $lang_array = array();
        $languages_selected = '';
        while (list($key, $value) = each($lng->catalog_languages)) {
            $lang_array[] = array('id' => $value['id'], 'text' => $value['name']);
            if (!empty($language_id)) {
                $languages_selected = $language_id;
            } elseif ($value['id'] == $account['customers_language_id']) {
                $languages_selected = $account['customers_language_id'];
            }
        }
        $smarty->assign(array('languages' => true, 'pull_down_menu_languages' => xos_draw_pull_down_menu('languages', $lang_array, $languages_selected, 'class="form-control" id="languages"')));
    } else {
        $smarty->assign('hidden_field_languages', xos_draw_hidden_field('languages', $account['customers_language_id']));
    }
    $smarty->assign(array('form_begin' => xos_draw_form('account_edit', xos_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onsubmit="return true;"', true), 'hidden_field' => xos_draw_hidden_field('action', 'process'), 'link_filename_account' => xos_href_link(FILENAME_ACCOUNT, '', 'SSL'), 'c_id' => $account['customers_c_id'], 'input_firstname' => xos_draw_input_field('firstname', $account['customers_firstname'], 'class="form-control" id="firstname"') . '&nbsp;' . (xos_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="input-requirement">' . ENTRY_FIRST_NAME_TEXT . '</span>' : ''), 'input_lastname' => xos_draw_input_field('lastname', $account['customers_lastname'], 'class="form-control" id="lastname"') . '&nbsp;' . (xos_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="input-requirement">' . ENTRY_LAST_NAME_TEXT . '</span>' : ''), 'input_email_address' => xos_draw_input_field('email_address', $account['customers_email_address'], 'class="form-control" id="email_address"') . '&nbsp;' . (xos_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="input-requirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>' : ''), 'input_telephone' => xos_draw_input_field('telephone', $account['customers_telephone'], 'class="form-control" id="telephone"') . '&nbsp;' . (xos_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="input-requirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>' : ''), 'input_fax' => xos_draw_input_field('fax', $account['customers_fax'], 'class="form-control" id="fax"') . '&nbsp;' . (xos_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="input-requirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>' : ''), 'form_end' => '</form>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'account_edit');
    $output_account_edit = $smarty->fetch(SELECTED_TPL . '/account_edit.tpl');
    $smarty->assign('central_contents', $output_account_edit);
    $smarty->display(SELECTED_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
Ejemplo n.º 18
0
     $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'))));
 }
 $smarty->assign(array('input_products_quantity' => xos_draw_input_field('products_quantity', '1', 'id="products_quantity" style="text-align: center; width: 60px;" class="form-control" maxlength="5"'), 'hidden_field_products_id' => xos_draw_hidden_field('p', $product_info['products_id']), 'javascript' => $jscript_op, 'form_begin' => xos_draw_form('cart_quantity', xos_href_link(FILENAME_PRODUCT_INFO, xos_get_all_get_params(array('action')) . 'action=add_product')), 'form_end' => '</form>'));
 $smarty->caching = 0;
 include DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS;
 include DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS;
 if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true') && !isset($_GET['noscript'])) {
Ejemplo n.º 19
0
////////////////////////////////////////////////////////////////////////////////
require 'includes/application_top.php';
if (!(@(include DIR_FS_SMARTY . 'admin/templates/' . ADMIN_TPL . '/php/' . FILENAME_MODULES) == 'overwrite_all')) {
    $set = isset($_GET['set']) ? $_GET['set'] : '';
    $modules = $cfgModules->getAll();
    if (empty($set) || !$cfgModules->exists($set)) {
        $set = $modules[0]['code'];
    }
    $module_type = $cfgModules->get($set, 'code');
    $module_directory = $cfgModules->get($set, 'directory');
    $module_language_directory = $cfgModules->get($set, 'language_directory');
    $module_key = $cfgModules->get($set, 'key');
    define('HEADING_TITLE', $cfgModules->get($set, 'title'));
    $template_integration = $cfgModules->get($set, 'template_integration');
    $action = isset($_GET['action']) ? $_GET['action'] : '';
    if (xos_not_null($action)) {
        switch ($action) {
            case 'save':
                reset($_POST['configuration']);
                while (list($key, $value) = each($_POST['configuration'])) {
                    xos_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
                }
                $smarty_cache_control->clearAllCache();
                xos_redirect(xos_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $_GET['module']));
                break;
            case 'install':
            case 'remove':
                $file_extension = substr(basename($_SERVER['PHP_SELF']), strrpos(basename($_SERVER['PHP_SELF']), '.'));
                $class = basename($_GET['module']);
                if (file_exists($module_directory . $class . $file_extension)) {
                    include $module_directory . $class . $file_extension;
Ejemplo n.º 20
0
 /** 
  * send a request
  * data sent are in order
  * a) the command
  * b) the request headers if they are defined
  * c) the request body if defined
  * @return string the server repsonse status code
  **/
 function sendCommand($command)
 {
     $this->responseHeaders = array();
     $this->responseBody = '';
     // connect if necessary
     if ($this->socket == false || feof($this->socket)) {
         if ($this->useProxy) {
             $host = $this->proxyHost;
             $port = $this->proxyPort;
         } else {
             $host = $this->url['host'];
             $port = $this->url['port'];
         }
         if (!xos_not_null($port)) {
             $port = 80;
         }
         if (!($this->socket = fsockopen($host, $port, $this->reply, $this->replyString))) {
             return false;
         }
         if (xos_not_null($this->requestBody)) {
             $this->addHeader('Content-Length', strlen($this->requestBody));
         }
         $this->request = $command;
         $cmd = $command . "\r\n";
         if (is_array($this->requestHeaders)) {
             reset($this->requestHeaders);
             while (list($k, $v) = each($this->requestHeaders)) {
                 $cmd .= $k . ': ' . $v . "\r\n";
             }
         }
         if (xos_not_null($this->requestBody)) {
             $cmd .= "\r\n" . $this->requestBody;
         }
         // unset body (in case of successive requests)
         $this->requestBody = '';
         fputs($this->socket, $cmd . "\r\n");
         return true;
     }
 }
Ejemplo n.º 21
0
 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';
 if ($action == 'edit' && $order_exists == true) {
     $orders_statuses = array();
     $orders_status_array = array();
     $orders_status_query = xos_db_query("select orders_status_id, orders_status_name, orders_status_code from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int) $_SESSION['used_lng_id'] . "'");
     while ($orders_status = xos_db_fetch_array($orders_status_query)) {
         if ($orders_status['orders_status_code'] == '') {
             $orders_statuses[] = array('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']);
         }
         $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
     }
     $order = new order($oID);
     if (xos_not_null($order->info['cc_type']) || xos_not_null($order->info['cc_owner']) || xos_not_null($order->info['cc_number'])) {
         $smarty->assign(array('credit_card' => true, 'credit_card_type' => $order->info['cc_type'], 'credit_card_owner' => $order->info['cc_owner'], 'credit_card_number' => $order->info['cc_number'], 'credit_card_expires' => $order->info['cc_expires']));
     }
     $order_products_array = array();
     for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
         $attributes_options_values_price = false;
         if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
             $order_attributes_array = array();
             for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
                 $options_values_price = '';
                 if ($order->products[$i]['attributes'][$j]['price'] != 0) {
                     $attributes_options_values_price = true;
                     $options_values_price = $order->products[$i]['attributes'][$j]['price_formated'];
                 }
                 $order_attributes_array[] = array('option_name' => $order->products[$i]['attributes'][$j]['option'], 'option_value_name' => $order->products[$i]['attributes'][$j]['value'], 'option_price' => $options_values_price, 'option_price_prefix' => $order->products[$i]['attributes'][$j]['prefix']);
             }
Ejemplo n.º 22
0
                if ((!isset($_GET['cID']) || isset($_GET['cID']) && $_GET['cID'] == $customers_groups['customers_group_id']) && !isset($cInfo)) {
                    $cInfo = new objectInfo($customers_groups);
                }
                $selected = false;
                if (is_object($cInfo) && $customers_groups['customers_group_id'] == $cInfo->customers_group_id) {
                    $selected = true;
                    $link_filename_customers_groups = xos_href_link(FILENAME_CUSTOMERS_GROUPS, xos_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_group_id . '&action=edit');
                } else {
                    $link_filename_customers_groups = xos_href_link(FILENAME_CUSTOMERS_GROUPS, xos_get_all_get_params(array('cID')) . 'cID=' . $customers_groups['customers_group_id']);
                }
                $customers_groups_array[] = array('selected' => $selected, 'link_filename_customers_groups' => $link_filename_customers_groups, 'group_name' => $customers_groups['customers_group_name']);
            }
            if (SESSID) {
                $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
            }
            $smarty->assign(array('form_begin_search' => xos_draw_form('search', FILENAME_CUSTOMERS_GROUPS, '', 'get'), 'input_search' => xos_draw_input_field('search'), 'form_end' => '</form>', 'link_filename_customers_groups_sort_asc' => xos_href_link(FILENAME_CUSTOMERS_GROUPS, 'listing=group'), 'text_sort_asc' => ICON_TITLE_IC_UP_TEXT_SORT . ' ' . TABLE_HEADING_NAME . ' ' . ICON_TITLE_IC_UP_TEXT_FROM_TOP_ABC, 'link_filename_customers_groups_sort_desc' => xos_href_link(FILENAME_CUSTOMERS_GROUPS, 'listing=group-desc'), 'text_sort_desc' => ICON_TITLE_IC_DOWN_TEXT_SORT . ' ' . TABLE_HEADING_NAME . ' ' . ICON_TITLE_IC_DOWN_TEXT_FROM_TOP_ZYX, 'customers_groups' => $customers_groups_array, 'nav_bar_number' => $customers_groups_split->display_count($customers_groups_query_numrows, MAX_DISPLAY_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS_GROUPS), 'nav_bar_result' => $customers_groups_split->display_links($customers_groups_query_numrows, MAX_DISPLAY_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], xos_get_all_get_params(array('page', 'info', 'x', 'y', 'cID')))));
            if (isset($_GET['search']) && xos_not_null($_GET['search'])) {
                $smarty->assign('link_filename_customers_groups_reset', xos_href_link(FILENAME_CUSTOMERS_GROUPS));
            } else {
                $smarty->assign('link_filename_customers_groups_insert', xos_href_link(FILENAME_CUSTOMERS_GROUPS, 'page=' . $_GET['page'] . '&action=new'));
            }
            require DIR_WS_BOXES . 'infobox_customers_groups.php';
        }
    }
    $smarty->assign('BODY_TAG_PARAMS', 'onload="SetFocus();"');
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'customers_groups');
    $output_customers_groups = $smarty->fetch(ADMIN_TPL . '/customers_groups.tpl');
    $smarty->assign('central_contents', $output_customers_groups);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
$contents = array();
switch ($action) {
    case 'edit':
        $heading_title = '<b>' . constant($cInfo->lang_key . '_TITLE') . '</b>';
        if ($cInfo->set_function) {
            eval('$value_field = ' . $cInfo->set_function . '"' . $cInfo->configuration_value . '");');
        } else {
            $value_field = xos_draw_input_field('configuration_value', $cInfo->configuration_value);
        }
        $form_tag = xos_draw_form('configuration', FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=save');
        $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
        $contents[] = array('text' => '<br /><b>' . constant($cInfo->lang_key . '_TITLE') . '</b><br />' . constant($cInfo->lang_key . '_DESCRIPTION') . '<br />' . $value_field);
        $contents[] = array('text' => '<br /><a href="" onclick="configuration.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_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
        break;
    default:
        if (isset($cInfo) && is_object($cInfo)) {
            $heading_title = '<b>' . constant($cInfo->lang_key . '_TITLE') . '</b>';
            $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_CONFIGURATION, 'gID=' . $_GET['gID'] . '&cID=' . $cInfo->configuration_id . '&action=edit') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_EDIT . ' "><span>' . BUTTON_TEXT_EDIT . '</span></a>');
            $contents[] = array('text' => '<br />' . constant($cInfo->lang_key . '_DESCRIPTION'));
            $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . xos_date_short($cInfo->date_added));
            if (xos_not_null($cInfo->last_modified)) {
                $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . xos_date_short($cInfo->last_modified));
            }
        }
        break;
}
$smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents));
$output_infobox_configuration = $smarty->fetch(ADMIN_TPL . '/includes/boxes/infobox_configuration.tpl');
$smarty->clearAssign(array('info_box_heading_title', 'info_box_form_tag', 'info_box_contents'));
$smarty->assign('infobox_configuration', $output_infobox_configuration);
return 'overwrite_all';
     $sizeof = count($products_prices[0]);
     if ($sizeof > 2) {
         $array_keys = array_keys($products_prices[0]);
         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[0][$qty]['regular'], $products_tax_rate), 'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : '');
         }
     }
 }
 if ($messageStack->size('review') > 0) {
     $smarty->assign('message_stack', $messageStack->output('review'));
     $smarty->assign('message_stack_error', $messageStack->output('review', 'error'));
     $smarty->assign('message_stack_warning', $messageStack->output('review', 'warning'));
     $smarty->assign('message_stack_success', $messageStack->output('review', 'success'));
 }
 if (xos_not_null($products_image_name)) {
     $pop_width = 0;
     $pop_height = 0;
     $small_height = 0;
     $small_width_total = 0;
     foreach ($products_image_name as $products_img_name) {
         if (count($products_image_name) > 1) {
             $small_img = DIR_WS_IMAGES . 'products/small/' . $products_img_name['name'];
             $small_size = @GetImageSize("{$small_img}");
             $small_width_total += $small_size[0] + 10;
             if ($small_size[1] + 10 > $small_height) {
                 $small_height = $small_size[1] + 10;
             }
         }
         $popup_img = DIR_WS_IMAGES . 'products/large/' . $products_img_name['name'];
         $pop_size = @GetImageSize("{$popup_img}");
Ejemplo n.º 25
0
     $sql_data_array['entry_suburb'] = $suburb;
 }
 if (ACCOUNT_STATE == 'true') {
     if ($zone_id > 0) {
         $sql_data_array['entry_zone_id'] = (int) $zone_id;
         $sql_data_array['entry_state'] = '';
     } else {
         $sql_data_array['entry_zone_id'] = '0';
         $sql_data_array['entry_state'] = $state;
     }
 }
 if ($_POST['action'] == 'update') {
     $check_query = xos_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int) $_GET['edit'] . "' and customers_id = '" . (int) $_SESSION['customer_id'] . "' limit 1");
     if (xos_db_num_rows($check_query) == 1) {
         xos_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "address_book_id = '" . (int) $_GET['edit'] . "' and customers_id ='" . (int) $_SESSION['customer_id'] . "'");
         if (ACCOUNT_COMPANY == 'true' && xos_not_null($company_tax_id)) {
             $sql_data_array2['customers_group_ra'] = '1';
             xos_db_perform(TABLE_CUSTOMERS, $sql_data_array2, 'update', "customers_id ='" . (int) $_SESSION['customer_id'] . "'");
             if (SEND_EMAILS == 'true') {
                 // if you would *not* like to have an email when a tax id number has been entered in
                 // the appropriate field, comment out this section. The alert in admin is raised anyway
                 $alert_email_text = sprintf(EMAIL_TEXT_TAX_ID_ADDED, $firstname, $lastname, $company);
                 $email_to_store_owner = new mailer(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT_TAX_ID_ADDED, '', $alert_email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
                 if (!$email_to_store_owner->send()) {
                     $messageStack->add_session('header', sprintf(ERROR_PHPMAILER, $email_to_store_owner->ErrorInfo));
                 }
             }
         }
         // reregister session variables
         if (isset($_POST['primary']) && $_POST['primary'] == 'on' || $_GET['edit'] == $_SESSION['customer_default_address_id']) {
             if (ACCOUNT_GENDER == 'true') {
Ejemplo n.º 26
0
//------------------------------------------------------------------------------
// this file is based on:
//              osCommerce, Open Source E-Commerce Solutions
//              http://www.oscommerce.com
//              Copyright (c) 2003 osCommerce
//              filename: manufacturer_info.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/manufacturer_info.php') == 'overwrite_all')) {
    if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) {
        $smarty->caching = 1;
        $cache_id = 'L3|box_manufacturer_info|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency'] . '-' . $_GET['p'];
    }
    if (!$smarty->isCached(SELECTED_TPL . '/includes/boxes/manufacturers_info.tpl', $cache_id)) {
        $manufacturer_query = xos_db_query("select m.manufacturers_id, m.manufacturers_image, mi.manufacturers_name, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int) $_SESSION['languages_id'] . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int) $_GET['p'] . "' and p.manufacturers_id = m.manufacturers_id");
        if (xos_db_num_rows($manufacturer_query)) {
            $manufacturer = xos_db_fetch_array($manufacturer_query);
            if (xos_not_null($manufacturer['manufacturers_image'])) {
                $smarty->assign('box_manufacturer_info_manufacturer_image', xos_image(DIR_WS_IMAGES . 'manufacturers/' . rawurlencode($manufacturer['manufacturers_image']), $manufacturer['manufacturers_name']));
            }
            if (xos_not_null($manufacturer['manufacturers_url'])) {
                $smarty->assign(array('box_manufacturer_info_link_to_the_manufacturer' => xos_href_link(FILENAME_REDIRECT, 'action=manufacturer&m=' . $manufacturer['manufacturers_id']), 'box_manufacturer_info_manufacturer_name' => $manufacturer['manufacturers_name']));
            }
            $smarty->assign(array('box_manufacturer_info_has_content' => true, 'box_manufacturer_info_link_filename_default' => xos_href_link(FILENAME_DEFAULT, 'm=' . $manufacturer['manufacturers_id'])));
        }
    }
    $output_manufacturer_info = $smarty->fetch(SELECTED_TPL . '/includes/boxes/manufacturers_info.tpl', $cache_id);
    $smarty->caching = 0;
    $smarty->assign('box_manufacturer_info', $output_manufacturer_info);
}
Ejemplo n.º 27
0
 case 'deleteconfirm':
     if (strstr($_GET['info'], '..')) {
         xos_redirect(xos_href_link(FILENAME_FILE_MANAGER));
     }
     xos_remove($_SESSION['current_path'] . '/' . $_GET['info']);
     if (!$xos_remove_error) {
         xos_redirect(xos_href_link(FILENAME_FILE_MANAGER));
     }
     break;
 case 'insert':
     if (isset($_POST['folder_name']) && xos_not_null(basename($_POST['folder_name'])) && mkdir($_SESSION['current_path'] . '/' . basename($_POST['folder_name']), 0777)) {
         xos_redirect(xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($_POST['folder_name'])));
     }
     break;
 case 'save':
     if (isset($_POST['filename']) && xos_not_null(basename($_POST['filename']))) {
         if (is_writable($_SESSION['current_path']) && ($fp = fopen($_SESSION['current_path'] . '/' . basename($_POST['filename']), 'w+'))) {
             fputs($fp, stripslashes($_POST['file_contents']));
             fclose($fp);
             xos_redirect(xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode(basename($_POST['filename']))));
         }
     } else {
         $action = 'new_file';
         $directory_writeable = true;
         $messageStack->add('header', ERROR_FILENAME_EMPTY, 'error');
     }
     break;
 case 'processuploads':
     for ($i = 1; $i < 6; $i++) {
         if (!empty($_FILES['file_' . $i]['name'])) {
             $upload = new upload('file_' . $i, $_SESSION['current_path'], '644');
Ejemplo n.º 28
0
 } elseif ($action == 'preview') {
     if (xos_not_null($_POST)) {
         $rInfo = new objectInfo($_POST);
     } else {
         $rID = xos_db_prepare_input($_GET['rID']);
         $reviews_query = xos_db_query("select r.reviews_id, r.products_id, r.customers_name, r.date_added, r.last_modified, r.reviews_read, rd.reviews_text, r.reviews_rating from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int) $rID . "' and r.reviews_id = rd.reviews_id");
         $reviews = xos_db_fetch_array($reviews_query);
         $products_query = xos_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int) $reviews['products_id'] . "'");
         $products = xos_db_fetch_array($products_query);
         $products_name_query = xos_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $reviews['products_id'] . "' and language_id = '" . (int) $_SESSION['used_lng_id'] . "'");
         $products_name = xos_db_fetch_array($products_name_query);
         $rInfo_array = array_merge((array) $reviews, (array) $products, (array) $products_name);
         $rInfo = new objectInfo($rInfo_array);
     }
     $product_image = xos_get_product_images($rInfo->products_image);
     if (xos_not_null($_POST)) {
         /* Re-Post all POST'ed variables */
         reset($_POST);
         $hidden_post_values = '';
         while (list($key, $value) = each($_POST)) {
             $hidden_post_values .= xos_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
         }
         $smarty->assign(array('hidden_post_values' => $hidden_post_values, 'link_filename_reviews_back_edit' => xos_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit'), 'link_filename_reviews_cancel' => xos_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id)));
     } else {
         if (isset($_GET['origin'])) {
             $back_url = $_GET['origin'];
             $back_url_params = '';
         } else {
             $back_url = FILENAME_REVIEWS;
             $back_url_params = 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id;
         }
Ejemplo n.º 29
0
//              XOS-Shop is distributed in the hope that it will be useful,
//              but WITHOUT ANY WARRANTY; without even the implied warranty of
//              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//              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/>.
////////////////////////////////////////////////////////////////////////////////
require 'includes/application_top.php';
if (!(@(include DIR_FS_SMARTY . 'admin/templates/' . ADMIN_TPL . '/php/' . FILENAME_ATTRIBUTES_QTY_LIST) == 'overwrite_all')) {
    require DIR_FS_SMARTY . 'admin/languages/' . $_SESSION['language'] . '/' . FILENAME_CATEGORIES;
    if (xos_has_product_attributes((int) $_GET['products_id']) && STOCK_CHECK == 'true') {
        $product_query = xos_db_query("select attributes_quantity, attributes_not_updated from " . TABLE_PRODUCTS . " where products_status = '1' and products_id = '" . (int) $_GET['products_id'] . "'");
        $product = xos_db_fetch_array($product_query);
        $attributes_quantity = xos_get_attributes_quantity($product['attributes_quantity']);
        if (xos_not_null($attributes_quantity) && !xos_not_null($product['attributes_not_updated'])) {
            $opt_query = xos_db_query("select pa.options_id, po.products_options_name from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS . " po where pa.products_id = '" . (int) $_GET['products_id'] . "' and pa.options_id = po.products_options_id and po.language_id = '" . (int) $_SESSION['used_lng_id'] . "' order by pa.options_sort_order asc, pa.options_id asc");
            $opt_array = array();
            $opt_values_array = array();
            $opt_result_array = array();
            $opt_rows_array = array();
            $opt_out_array = array();
            $i = 0;
            $ii = 1;
            $option_id = '';
            while ($opt = xos_db_fetch_array($opt_query)) {
                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'];
Ejemplo n.º 30
0
 if ($customer_info['customers_id'] != $_SESSION['customer_id']) {
     xos_redirect(xos_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
 }
 require DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/' . FILENAME_ACCOUNT_HISTORY_INFO;
 $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'));
 $site_trail->add(sprintf(NAVBAR_TITLE_3, $_GET['order_id']), xos_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $_GET['order_id'], 'SSL'));
 require DIR_WS_CLASSES . 'order.php';
 $order = new order($_GET['order_id']);
 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 ($order->delivery != false) {
     $smarty->assign('delivery_address', xos_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'));
     if (xos_not_null($order->info['shipping_method'])) {
         $smarty->assign('shipping_method', $order->info['shipping_method']);
     }
 }
 if (sizeof($order->info['tax_groups']) > 1) {
     $smarty->assign('tax_groups', true);
 }
 $order_products_array = array();
 for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
     $attributes_options_values_price = false;
     if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
         $order_attributes_array = array();
         for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
             $options_values_price = '';
             if ($order->products[$i]['attributes'][$j]['price'] != 0) {
                 $attributes_options_values_price = true;