function listConfigurations()
 {
     global $toC_Json, $osC_Database;
     $Qcfg = $osC_Database->query('select configuration_id, configuration_key, configuration_title, configuration_description, configuration_value, use_function, set_function from :table_configuration where configuration_group_id = :configuration_group_id order by sort_order');
     $Qcfg->bindTable(':table_configuration', TABLE_CONFIGURATION);
     $Qcfg->bindInt(':configuration_group_id', $_REQUEST['gID']);
     $Qcfg->execute();
     $keys = array();
     while ($Qcfg->next()) {
         $cfgValue = $Qcfg->value('configuration_value');
         if (!osc_empty($Qcfg->value('use_function'))) {
             $cfgValue = osc_call_user_func($Qcfg->value('use_function'), $Qcfg->value('configuration_value'));
         }
         $control = array();
         if (!osc_empty($Qcfg->value('set_function'))) {
             $control = osc_call_user_func($Qcfg->value('set_function'), $Qcfg->value('configuration_value'), $Qcfg->value('configuration_key'));
         } else {
             $control['type'] = 'textfield';
             $control['name'] = $Qcfg->value('configuration_key');
         }
         $control['id'] = $Qcfg->value('configuration_id');
         $control['title'] = $Qcfg->value('configuration_title');
         $control['value'] = $cfgValue;
         $keys[] = $control;
     }
     echo $toC_Json->encode($keys);
 }
 function getConfigurationOptions()
 {
     global $osC_Language, $osC_Database, $toC_Json;
     include '../includes/modules/' . $_REQUEST['set'] . '/' . $_REQUEST['code'] . '.php';
     $module = 'osC_' . ucfirst($_REQUEST['set']) . '_' . $_REQUEST['code'];
     $module = new $module();
     $keys = array();
     foreach ($module->getKeys() as $key) {
         $Qkey = $osC_Database->query('select configuration_id, configuration_key, configuration_title, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
         $Qkey->bindTable(':table_configuration', TABLE_CONFIGURATION);
         $Qkey->bindValue(':configuration_key', $key);
         $Qkey->execute();
         $control = array();
         if (!osc_empty($Qkey->value('set_function'))) {
             $control = osc_call_user_func($Qkey->value('set_function'), $Qkey->value('configuration_value'), $key);
             $field['title'] = $Qkey->value('configuration_title');
         } else {
             $control['type'] = 'textfield';
             $control['name'] = 'configuration[' . $key . ']';
         }
         $control['id'] = $Qkey->value('configuration_id');
         $control['title'] = $Qkey->value('configuration_title');
         $control['value'] = $Qkey->value('configuration_value');
         $control['description'] = $Qkey->value('configuration_description');
         $keys[] = $control;
     }
     echo $toC_Json->encode($keys);
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Currencies;
     $Qupcoming = $osC_Database->query('select p.products_id, p.products_price, p.products_tax_class_id, p.products_date_available as date_expected, pd.products_name, pd.products_keyword, s.specials_new_products_price, i.image from :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag) left join :table_specials s on (p.products_id = s.products_id and s.status = 1), :table_products_description pd where to_days(p.products_date_available) >= to_days(now()) and p.products_status = :products_status and p.products_id = pd.products_id and pd.language_id = :language_id order by p.products_date_available limit :max_display_upcoming_products');
     $Qupcoming->bindTable(':table_products', TABLE_PRODUCTS);
     $Qupcoming->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
     $Qupcoming->bindTable(':table_specials', TABLE_SPECIALS);
     $Qupcoming->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
     $Qupcoming->bindInt(':default_flag', 1);
     $Qupcoming->bindInt(':products_status', 1);
     $Qupcoming->bindInt(':language_id', $osC_Language->getID());
     $Qupcoming->bindInt(':max_display_upcoming_products', MODULE_CONTENT_UPCOMING_PRODUCTS_MAX_DISPLAY);
     if (MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE > 0) {
         $Qupcoming->setCache('upcoming_products-' . $osC_Language->getCode() . '-' . $osC_Currencies->getCode(), MODULE_CONTENT_UPCOMING_PRODUCTS_CACHE);
     }
     $Qupcoming->execute();
     if ($Qupcoming->numberOfRows() > 0) {
         $this->_content = '<ol style="list-style: none;">';
         while ($Qupcoming->next()) {
             $this->_content .= '<li>' . osC_DateTime::getLong($Qupcoming->value('date_expected')) . ': ' . osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qupcoming->value('products_id')), $Qupcoming->value('products_name')) . ' ';
             if (osc_empty($Qupcoming->value('specials_new_products_price'))) {
                 $this->_content .= '(' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . ')';
             } else {
                 $this->_content .= '(<s>' . $osC_Currencies->displayPrice($Qupcoming->value('products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</s> <span class="productSpecialPrice">' . $osC_Currencies->displayPrice($Qupcoming->value('specials_new_products_price'), $Qupcoming->valueInt('products_tax_class_id')) . '</span>)';
             }
             $this->_content .= '</li>';
         }
         $this->_content .= '</ol>';
     }
     $Qupcoming->freeResult();
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product, $osC_Image;
     if (isset($osC_Product)) {
         $Qorders = $osC_Database->query('select p.products_id, pd.products_name, pd.products_keyword, i.image from :table_orders_products opa, :table_orders_products opb, :table_orders o, :table_products p left join :table_products_images i on (p.products_id = i.products_id and i.default_flag = :default_flag), :table_products_description pd where opa.products_id = :products_id and opa.orders_id = opb.orders_id and opb.products_id != :products_id and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id group by p.products_id order by o.date_purchased desc limit :limit');
         $Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qorders->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qorders->bindTable(':table_orders', TABLE_ORDERS);
         $Qorders->bindTable(':table_products', TABLE_PRODUCTS);
         $Qorders->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
         $Qorders->bindTable(':table_products_description', TABLE_PRODUCTS_DESCRIPTION);
         $Qorders->bindInt(':default_flag', 1);
         $Qorders->bindInt(':products_id', $osC_Product->getID());
         $Qorders->bindInt(':products_id', $osC_Product->getID());
         $Qorders->bindInt(':language_id', $osC_Language->getID());
         $Qorders->bindInt(':limit', MODULE_CONTENT_ALSO_PURCHASED_MAX_DISPLAY);
         if (MODULE_CONTENT_ALSO_PURCHASED_PRODUCTS_CACHE > 0) {
             $Qorders->setCache('also_purchased-' . $osC_Product->getID(), MODULE_CONTENT_ALSO_PURCHASED_PRODUCTS_CACHE);
         }
         $Qorders->execute();
         if ($Qorders->numberOfRows() >= MODULE_CONTENT_ALSO_PURCHASED_MIN_DISPLAY) {
             $this->_content = '<div style="overflow: auto;">';
             while ($Qorders->next()) {
                 $this->_content .= '<span style="width: 33%; float: left; text-align: center;">';
                 if (osc_empty($Qorders->value('image')) === false) {
                     $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qorders->value('products_id')), $osC_Image->show($Qorders->value('image'), $Qorders->value('products_name'))) . '<br />';
                 }
                 $this->_content .= osc_link_object(osc_href_link(FILENAME_PRODUCTS, $Qorders->value('products_id')), $Qorders->value('products_name')) . '</span>';
             }
             $this->_content .= '</div>';
         }
         $Qorders->freeResult();
     }
 }
 function initialize()
 {
     global $osC_Database, $osC_Language, $osC_Product;
     if (isset($osC_Product) && is_a($osC_Product, 'osC_Product')) {
         $Qmanufacturer = $osC_Database->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p  where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id');
         $Qmanufacturer->bindTable(':table_manufacturers', TABLE_MANUFACTURERS);
         $Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
         $Qmanufacturer->bindTable(':table_products', TABLE_PRODUCTS);
         $Qmanufacturer->bindInt(':languages_id', $osC_Language->getID());
         $Qmanufacturer->bindInt(':products_id', $osC_Product->getID());
         $Qmanufacturer->execute();
         if ($Qmanufacturer->numberOfRows()) {
             $this->_content = '';
             if (!osc_empty($Qmanufacturer->value('manufacturers_image'))) {
                 $this->_content .= '<div style="text-align: center;">' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), osc_image(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name'))) . '</div>';
             }
             $this->_content .= '<ol style="list-style: none; margin: 0; padding: 0;">';
             if (!osc_empty($Qmanufacturer->value('manufacturers_url'))) {
                 $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $Qmanufacturer->valueInt('manufacturers_id')), sprintf($osC_Language->get('box_manufacturer_info_website'), $Qmanufacturer->value('manufacturers_name')), 'target="_blank"') . '</li>';
             }
             $this->_content .= '<li>' . osc_link_object(osc_href_link(FILENAME_DEFAULT, 'manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), $osC_Language->get('box_manufacturer_info_products')) . '</li>';
             $this->_content .= '</ol>';
         }
     }
 }
Exemple #6
0
 function getJavascriptBlock()
 {
     global $osC_Language, $osC_CreditCard;
     $osC_CreditCard = new osC_CreditCard();
     $js = '  if (payment_value == "' . $this->_code . '") {' . "\n" . '    var saferpay_cc_owner = document.checkout_payment.saferpay_cc_owner.value;' . "\n" . '    var saferpay_cc_number = document.checkout_payment.saferpay_cc_number.value;' . "\n" . '    saferpay_cc_number = saferpay_cc_number.replace(/[^\\d]/gi, "");' . "\n";
     if (MODULE_PAYMENT_SAFERPAY_CC_VERIFY_WITH_CVC == '1') {
         $js .= '    var saferpay_cc_cvc = document.checkout_payment.saferpay_cc_cvc.value;' . "\n";
     }
     if (CFG_CREDIT_CARDS_VERIFY_WITH_JS == '1') {
         $js .= '    var saferpay_cc_type_match = false;' . "\n";
     }
     $js .= '    if (saferpay_cc_owner == "" || saferpay_cc_owner.length < ' . (int) CC_OWNER_MIN_LENGTH . ') {' . "\n" . '      error_message = error_message + "' . sprintf($osC_Language->get('payment_saferpay_cc_js_credit_card_owner'), (int) CC_OWNER_MIN_LENGTH) . '\\n";' . "\n" . '      error = 1;' . "\n" . '    }' . "\n";
     $has_type_patterns = false;
     if (CFG_CREDIT_CARDS_VERIFY_WITH_JS == '1' && osc_empty(MODULE_PAYMENT_SAFERPAY_CC_ACCEPTED_TYPES) === false) {
         foreach (explode(',', MODULE_PAYMENT_SAFERPAY_CC_ACCEPTED_TYPES) as $type_id) {
             if ($osC_CreditCard->typeExists($type_id)) {
                 $has_type_patterns = true;
                 $js .= '    if ( (saferpay_cc_type_match == false) && (saferpay_cc_number.match(' . $osC_CreditCard->getTypePattern($type_id) . ') != null) ) { ' . "\n" . '      saferpay_cc_type_match = true;' . "\n" . '    }' . "\n";
             }
         }
     }
     if ($has_type_patterns === true) {
         $js .= '    if ((saferpay_cc_type_match == false) || (mod10(saferpay_cc_number) == false)) {' . "\n" . '      error_message = error_message + "' . $osC_Language->get('payment_saferpay_cc_js_credit_card_not_accepted') . '\\n";' . "\n" . '      error = 1;' . "\n" . '    }' . "\n";
     } else {
         $js .= '    if (saferpay_cc_number == "" || saferpay_cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" . '      error_message = error_message + "' . sprintf($osC_Language->get('payment_saferpay_cc_js_credit_card_number'), CC_NUMBER_MIN_LENGTH) . '\\n";' . "\n" . '      error = 1;' . "\n" . '    }' . "\n";
     }
     if (MODULE_PAYMENT_SAFERPAY_CC_VERIFY_WITH_CVC == '1') {
         $js .= '    if (saferpay_cc_cvc == "" || saferpay_cc_cvc.length < 3) {' . "\n" . '      error_message = error_message + "' . sprintf($osC_Language->get('payment_saferpay_cc_js_credit_card_cvc'), 3) . '\\n";' . "\n" . '      error = 1;' . "\n" . '    }' . "\n";
     }
     $js .= '  }' . "\n";
     return $js;
 }
Exemple #7
0
 function resize($image, $group_id)
 {
     if (osc_empty(CFG_APP_IMAGEMAGICK_CONVERT) || !file_exists(CFG_APP_IMAGEMAGICK_CONVERT)) {
         return $this->resizeWithGD($image, $group_id);
     }
     if (!file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'])) {
         mkdir(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code']);
         @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'], 0777);
     }
     exec(escapeshellarg(CFG_APP_IMAGEMAGICK_CONVERT) . ' -resize ' . (int) $this->_groups[$group_id]['size_width'] . 'x' . (int) $this->_groups[$group_id]['size_height'] . ($this->_groups[$group_id]['force_size'] == '1' ? '!' : '') . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[1]['code'] . '/' . $image) . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image));
     @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image, 0777);
 }
Exemple #8
0
 function load()
 {
     global $osC_Language;
     if (defined('MODULE_DEFAULT_GEOIP') && !osc_empty(MODULE_DEFAULT_GEOIP) && file_exists('includes/modules/geoip/' . MODULE_DEFAULT_GEOIP . '.php')) {
         $osC_Language->loadIniFile('modules/geoip/' . MODULE_DEFAULT_GEOIP . '.php');
         include 'includes/modules/geoip/' . MODULE_DEFAULT_GEOIP . '.php';
         $module = 'osC_GeoIP_' . MODULE_DEFAULT_GEOIP;
         return new $module();
     } else {
         return new osC_GeoIP_Admin();
     }
 }
Exemple #9
0
 function simpleQuery($query, $debug = false)
 {
     global $osC_MessageStack, $osC_Services;
     if ($this->isConnected()) {
         $this->number_of_queries++;
         if ($debug === false && $this->debug === true) {
             $debug = true;
         }
         if (isset($osC_Services) && $osC_Services->isStarted('debug')) {
             if ($debug === false && SERVICE_DEBUG_OUTPUT_DB_QUERIES == '1') {
                 $debug = true;
             }
             if (!osc_empty(SERVICE_DEBUG_EXECUTION_TIME_LOG) && SERVICE_DEBUG_LOG_DB_QUERIES == '1') {
                 @error_log('QUERY ' . $query . "\n", 3, SERVICE_DEBUG_EXECUTION_TIME_LOG);
             }
         } elseif ($debug === true) {
             $debug = false;
         }
         if ($debug === true) {
             $time_start = $this->getMicroTime();
         }
         $resource = @mysqli_query($this->link, $query);
         if ($debug === true) {
             $time_end = $this->getMicroTime();
             $query_time = number_format($time_end - $time_start, 5);
             if ($this->debug === true) {
                 $this->time_of_queries += $query_time;
             }
             echo '<div style="font-family: Verdana, Arial, sans-serif; font-size: 7px; font-weight: bold;">[<a href="#query' . $this->number_of_queries . '">#' . $this->number_of_queries . '</a>]</div>';
             $osC_MessageStack->add('debug', '<a name=\'query' . $this->number_of_queries . '\'></a>[#' . $this->number_of_queries . ' - ' . $query_time . 's] ' . $query, 'warning');
         }
         if ($resource !== false) {
             $this->error = false;
             $this->error_number = null;
             $this->error_query = null;
             if (mysqli_warning_count($this->link) > 0) {
                 $warning_query = @mysqli_query($this->link, 'show warnings');
                 while ($warning = mysqli_fetch_row($warning_query)) {
                     trigger_error(sprintf('[MYSQL] %s (%d): %s [QUERY] ' . $query, $warning[0], $warning[1], $warning[2]), E_USER_WARNING);
                 }
                 mysqli_free_result($warning_query);
             }
             return $resource;
         } else {
             $this->setError(mysqli_error($this->link), mysqli_errno($this->link), $query);
             return false;
         }
     } else {
         return false;
     }
 }
Exemple #10
0
 function osC_Account_Login()
 {
     global $osC_Language, $osC_Services, $breadcrumb;
     // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
     if (osc_empty(session_id())) {
         osc_redirect(osc_href_link(FILENAME_INFO, 'cookie', 'AUTO'));
     }
     $this->_page_title = $osC_Language->get('sign_in_heading');
     if ($osC_Services->isStarted('breadcrumb')) {
         $breadcrumb->add($osC_Language->get('breadcrumb_sign_in'), osc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
     }
     if ($_GET[$this->_module] == 'process') {
         $this->_process();
     }
 }
 public static function getValue($value)
 {
     global $osC_Database, $osC_Language;
     $string = '';
     $Qstatus = $osC_Database->query('select title, css_key from :table_shipping_availability where id = :id and languages_id = :languages_id');
     $Qstatus->bindTable(':table_shipping_availability', TABLE_SHIPPING_AVAILABILITY);
     $Qstatus->bindInt(':id', $value);
     $Qstatus->bindInt(':languages_id', $osC_Language->getID());
     $Qstatus->execute();
     if ($Qstatus->numberOfRows() === 1) {
         $string = $Qstatus->value('title');
         if (!osc_empty($Qstatus->value('css_key'))) {
             $string = '<span class="' . $Qstatus->value('css_key') . '">' . $string . '</span>';
         }
     }
     return $string;
 }
 function execute()
 {
     global $osC_Session, $toC_Wishlist, $osC_Product;
     $id = false;
     foreach ($_GET as $key => $value) {
         if ((ereg('^[0-9]+(_?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$', $key) || ereg('^[a-zA-Z0-9 -_]*$', $key)) && $key != $osC_Session->getName()) {
             $id = $key;
         }
         break;
     }
     //change the variants in the product info page, then attach the wid param to represent the variant product
     if (isset($_GET['wid']) && preg_match('/^[0-9]+(_?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $_GET['wid'])) {
         $id = $_GET['wid'];
     }
     if (strpos($id, '_') !== false) {
         $id = str_replace('_', '#', $id);
     }
     if ($id !== false && osC_Product::checkEntry($id)) {
         $osC_Product = new osC_Product($id);
     }
     if (isset($osC_Product)) {
         $variants = null;
         if (isset($_POST['variants']) && is_array($_POST['variants'])) {
             $variants = $_POST['variants'];
         } else {
             if (isset($_GET['variants']) && !empty($_GET['variants'])) {
                 $variants = osc_parse_variants_string($_GET['variants']);
             } else {
                 if (strpos($id, '#') !== false) {
                     $variants = osc_parse_variants_from_id_string($id);
                 }
             }
         }
         if (!osc_empty($variants)) {
             $toC_Wishlist->add($osC_Product->getID(), $variants);
         } else {
             $toC_Wishlist->add($osC_Product->getID());
         }
     }
     osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'wishlist'));
 }
Exemple #13
0
/**
 * Generate an internal URL address for the administration side
 *
 * @param string $page The page to link to
 * @param string $parameters The parameters to pass to the page (in the GET scope)
 * @access public
 */
function osc_href_link_admin($page = null, $parameters = null)
{
    if (ENABLE_SSL === true) {
        $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'admin/';
    } else {
        $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'admin/';
    }
    $link .= $page;
    if (empty($parameters) && !osc_empty(SID)) {
        $link .= '?' . SID;
    } else {
        $link .= '?' . $parameters;
        if (!osc_empty(SID)) {
            $link .= '&' . SID;
        }
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    return $link;
}
Exemple #14
0
 function stop()
 {
     global $osC_MessageStack, $osC_Template;
     $time_start = explode(' ', PAGE_PARSE_START_TIME);
     $time_end = explode(' ', microtime());
     $parse_time = number_format($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0]), 3);
     if (!osc_empty(SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
         if (!@error_log(strftime('%c') . ' - ' . $_SERVER['REQUEST_URI'] . ' (' . $parse_time . 's)' . "\n", 3, SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
             if (!file_exists(SERVICE_DEBUG_EXECUTION_TIME_LOG) || !is_writable(SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
                 $osC_MessageStack->add('debug', 'Error: Execution time log file not writeable: ' . SERVICE_DEBUG_EXECUTION_TIME_LOG . ' [' . __CLASS__ . ']', 'error');
             }
         }
     }
     if (SERVICE_DEBUG_EXECUTION_DISPLAY == '1') {
         $osC_MessageStack->add('debug', 'Execution Time: ' . $parse_time . 's [' . __CLASS__ . ']', 'warning');
     }
     if ($osC_Template->showDebugMessages() && $osC_MessageStack->size('debug') > 0) {
         echo $osC_MessageStack->get('debug');
     }
     return true;
 }
Exemple #15
0
 public static function stop()
 {
     $OSCOM_MessageStack = Registry::get('MessageStack');
     $OSCOM_Template = Registry::get('Template');
     $time_start = explode(' ', PAGE_PARSE_START_TIME);
     $time_end = explode(' ', microtime());
     $parse_time = number_format($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0]), 3);
     if (!osc_empty(SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
         if (!@error_log(strftime('%c') . ' - ' . $_SERVER['REQUEST_URI'] . ' (' . $parse_time . 's)' . "\n", 3, SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
             if (!file_exists(SERVICE_DEBUG_EXECUTION_TIME_LOG) || !is_writable(SERVICE_DEBUG_EXECUTION_TIME_LOG)) {
                 $OSCOM_MessageStack->add('debug', 'Error: Execution time log file not writeable: ' . SERVICE_DEBUG_EXECUTION_TIME_LOG, 'error');
             }
         }
     }
     if (SERVICE_DEBUG_EXECUTION_DISPLAY == '1') {
         $OSCOM_MessageStack->add('debug', 'Execution Time: ' . $parse_time . 's', 'warning');
     }
     if ($OSCOM_Template->showDebugMessages() && $OSCOM_MessageStack->exists('debug')) {
         echo $OSCOM_MessageStack->get('debug');
     }
     return true;
 }
Exemple #16
0
 public static function find($search)
 {
     global $osC_Database;
     $in_group = array();
     foreach (osc_toObjectInfo(self::getAllGroups())->get('entries') as $group) {
         $in_group[] = $group['configuration_group_id'];
     }
     $result = array('entries' => array());
     $Qcfg = $osC_Database->query('select * from :table_configuration where (configuration_key like :configuration_key or configuration_value like :configuration_value) and configuration_group_id in (:configuration_group_id) order by configuration_key');
     $Qcfg->bindTable(':table_configuration', TABLE_CONFIGURATION);
     $Qcfg->bindValue(':configuration_key', '%' . $search . '%');
     $Qcfg->bindValue(':configuration_value', '%' . $search . '%');
     $Qcfg->bindRaw(':configuration_group_id', implode(',', $in_group));
     $Qcfg->execute();
     while ($Qcfg->next()) {
         $result['entries'][] = $Qcfg->toArray();
         if (!osc_empty($Qcfg->value('use_function'))) {
             $result['entries'][sizeof($result['entries']) - 1]['configuration_value'] = osc_call_user_func($Qcfg->value('use_function'), $Qcfg->value('configuration_value'));
         }
     }
     $result['total'] = $Qcfg->numberOfRows();
     $Qcfg->freeResult();
     return $result;
 }
Exemple #17
0
 function process_button()
 {
     global $osC_Customer, $osC_Currencies, $osC_ShoppingCart;
     if (MODULE_PAYMENT_CHRONOPAY_CURRENCY == 'Selected Currency') {
         $currency = $osC_Currencies->getCode();
     } else {
         $currency = MODULE_PAYMENT_CHRONOPAY_CURRENCY;
     }
     switch ($osC_ShoppingCart->getBillingAddress('country_iso_code_3')) {
         case 'USA':
         case 'CAN':
             $state_code = $osC_ShoppingCart->getBillingAddress('state_code');
             break;
         default:
             $state_code = 'XX';
             break;
     }
     $total_price = $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $currency);
     $process_button_string = osc_draw_hidden_field('product_id', MODULE_PAYMENT_CHRONOPAY_PRODUCT_ID) . osc_draw_hidden_field('product_name', STORE_NAME) . osc_draw_hidden_field('product_price', $total_price) . osc_draw_hidden_field('product_price_currency', $currency) . osc_draw_hidden_field('cb_url', urlencode(osc_href_link(FILENAME_CHECKOUT, 'callback&module=' . $this->_code, 'SSL', null, null, true))) . osc_draw_hidden_field('cb_type', 'P') . osc_draw_hidden_field('decline_url', urlencode(osc_href_link(FILENAME_CHECKOUT, 'payment', 'SSL', null, null, true))) . osc_draw_hidden_field('language', 'EN') . osc_draw_hidden_field('f_name', $osC_ShoppingCart->getBillingAddress('firstname')) . osc_draw_hidden_field('s_name', $osC_ShoppingCart->getBillingAddress('lastname')) . osc_draw_hidden_field('street', $osC_ShoppingCart->getBillingAddress('street_address')) . osc_draw_hidden_field('city', $osC_ShoppingCart->getBillingAddress('city')) . osc_draw_hidden_field('state', $state_code) . osc_draw_hidden_field('zip', $osC_ShoppingCart->getBillingAddress('postcode')) . osc_draw_hidden_field('country', $osC_ShoppingCart->getBillingAddress('country_iso_code_3')) . osc_draw_hidden_field('phone', $osC_ShoppingCart->getBillingAddress('telephone_number')) . osc_draw_hidden_field('email', $osC_Customer->getEmailAddress()) . osc_draw_hidden_field('cs1', $osC_Customer->getID()) . osc_draw_hidden_field('cs2', $this->_order_id) . osc_draw_hidden_field('cs3', md5(MODULE_PAYMENT_CHRONOPAY_PRODUCT_ID . $this->_order_id . $osC_Customer->getID() . $total_price . MODULE_PAYMENT_CHRONOPAY_MD5_HASH));
     if (!osc_empty(MODULE_PAYMENT_CHRONOPAY_MD5_HASH)) {
         $process_button_string .= osc_draw_hidden_field('sign', md5(MODULE_PAYMENT_CHRONOPAY_PRODUCT_ID . '-' . $total_price . '-' . MODULE_PAYMENT_CHRONOPAY_MD5_HASH));
     }
     return $process_button_string;
 }
Exemple #18
0
 public function initialize()
 {
     $OSCOM_Product = Registry::exists('Product') ? Registry::get('Product') : null;
     $OSCOM_Database = Registry::get('Database');
     $OSCOM_Language = Registry::get('Language');
     if (isset($OSCOM_Product) && $OSCOM_Product instanceof \osCommerce\OM\Site\Shop\Product && $OSCOM_Product->isValid()) {
         $Qmanufacturer = $OSCOM_Database->query('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p  where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id');
         $Qmanufacturer->bindInt(':languages_id', $OSCOM_Language->getID());
         $Qmanufacturer->bindInt(':products_id', $OSCOM_Product->getID());
         $Qmanufacturer->execute();
         if ($Qmanufacturer->numberOfRows()) {
             $this->_content = '';
             if (!osc_empty($Qmanufacturer->value('manufacturers_image'))) {
                 $this->_content .= '<div style="text-align: center;">' . osc_link_object(OSCOM::getLink(null, 'Index', 'Manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), osc_image(DIR_WS_IMAGES . 'manufacturers/' . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name'))) . '</div>';
             }
             $this->_content .= '<ol style="list-style: none; margin: 0; padding: 0;">';
             if (!osc_empty($Qmanufacturer->value('manufacturers_url'))) {
                 $this->_content .= '<li>' . osc_link_object(OSCOM::getLink(null, 'Redirct', 'Manufacturer=' . $Qmanufacturer->valueInt('manufacturers_id')), sprintf(OSCOM::getDef('box_manufacturer_info_website'), $Qmanufacturer->value('manufacturers_name')), 'target="_blank"') . '</li>';
             }
             $this->_content .= '<li>' . osc_link_object(OSCOM::getLink(null, 'Index', 'Manufacturers=' . $Qmanufacturer->valueInt('manufacturers_id')), OSCOM::getDef('box_manufacturer_info_products')) . '</li>';
             $this->_content .= '</ol>';
         }
     }
 }
Exemple #19
0
<h1><?php 
echo $osC_Template->getPageTitle();
?>
</h1>

<link href="templates/<?php 
echo $osC_Template->getCode();
?>
/javascript/milkbox/milkbox.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="templates/<?php 
echo $osC_Template->getCode();
?>
/javascript/milkbox/milkbox.js"></script>

<?php 
if (!osc_empty($Qarticle->value('articles_image'))) {
    echo '<p style="float: right; padding: 0px 5px 5px 5px">' . $osC_Image->show($Qarticle->value('articles_image'), $Qarticle->value('articles_name'), '', 'product_info', 'articles') . '</p>';
}
?>
<p><?php 
echo $Qarticle->value('articles_description');
?>
</p>

<div class="submitFormButtons" style="text-align: right;">
  <?php 
echo osc_link_object(osc_href_link(FILENAME_DEFAULT), osc_draw_image_button('button_continue.gif', $osC_Language->get('button_continue')));
?>
</div>
Exemple #20
0
" method="post">

  <p><?php 
echo $osC_Language->get('introduction_edit_shipping_module');
?>
</p>

<?php 
$keys = '';
foreach ($module->getKeys() as $key) {
    $Qkey = $osC_Database->query('select configuration_title, configuration_value, configuration_description, use_function, set_function from :table_configuration where configuration_key = :configuration_key');
    $Qkey->bindTable(':table_configuration', TABLE_CONFIGURATION);
    $Qkey->bindValue(':configuration_key', $key);
    $Qkey->execute();
    $keys .= '<b>' . $Qkey->value('configuration_title') . '</b><br />' . $Qkey->value('configuration_description') . '<br />';
    if (!osc_empty($Qkey->value('set_function'))) {
        $keys .= osc_call_user_func($Qkey->value('set_function'), $Qkey->value('configuration_value'), $key);
    } else {
        $keys .= osc_draw_input_field('configuration[' . $key . ']', $Qkey->value('configuration_value'));
    }
    $keys .= '<br /><br />';
}
$keys = substr($keys, 0, strrpos($keys, '<br /><br />'));
?>

  <p><?php 
echo $keys;
?>
</p>

  <p align="center"><?php 
 function add($products_id, $variants = array())
 {
     global $osC_Database, $osC_Services, $osC_Customer, $osC_Product;
     //if wishlist empty, create a new wishlist
     if (!$this->hasWishlistID()) {
         $token = $this->generateToken();
         $Qnew = $osC_Database->query('insert into :table_wishlists (customers_id, wishlists_token) values (:customers_id, :wishlists_token)');
         $Qnew->bindTable(':table_wishlists', TABLE_WISHLISTS);
         $Qnew->bindInt(':customers_id', $osC_Customer->getID());
         $Qnew->bindValue(':wishlists_token', $token);
         $Qnew->execute();
         $this->_wishlists_id = $osC_Database->nextID();
         $this->_token = $token;
         $Qnew->freeResult();
     }
     if (!isset($osC_Product)) {
         $osC_Product = new osC_Product($products_id);
     }
     if ($osC_Product->getID() > 0) {
         if (!$this->exists($products_id)) {
             $product_price = $osC_Product->getPrice();
             $product_name = $osC_Product->getTitle();
             $product_image = $osC_Product->getImage();
             if ($osC_Services->isStarted('specials')) {
                 global $osC_Specials;
                 if ($new_price = $osC_Specials->getPrice($products_id)) {
                     $price = $new_price;
                 }
             }
             //if the product has variants, set the image, price etc according to the variants
             if ($osC_Product->hasVariants()) {
                 $products_variants = $osC_Product->getVariants();
                 if (is_array($variants) && !osc_empty($variants)) {
                     $product_id_string = osc_get_product_id_string($products_id, $variants);
                     $products_variant = $products_variants[$product_id_string];
                 } else {
                     $products_variant = $osC_Product->getDefaultVariant();
                 }
                 $variants_groups_id = $products_variant['groups_id'];
                 $variants_groups_name = $products_variant['groups_name'];
                 if (!osc_empty($variants_groups_name)) {
                     $product_name .= '<br />';
                     foreach ($variants_groups_name as $group_name => $value_name) {
                         $product_name .= '<em>' . $group_name . ': ' . $value_name . '</em>' . '<br />';
                     }
                 }
                 $product_price = $products_variant['price'];
                 $product_image = $products_variant['image'];
             }
             $this->_contents[$products_id] = array('products_id' => $products_id, 'name' => $product_name, 'image' => $product_image, 'price' => $product_price, 'date_added' => osC_DateTime::getShort(osC_DateTime::getNow()), 'variants' => $variants, 'comments' => '');
             //insert into wishlist products
             $Qnew = $osC_Database->query('insert into :table_wishlist_products (wishlists_id, products_id, date_added, comments) values (:wishlists_id, :products_id, now(), :comments)');
             $Qnew->bindTable(':table_wishlist_products', TABLE_WISHLISTS_PRODUCTS);
             $Qnew->bindInt(':wishlists_id', $this->_wishlists_id);
             $Qnew->bindInt(':products_id', $products_id);
             $Qnew->bindValue(':comments', '');
             $Qnew->execute();
             $wishlists_products_id = $osC_Database->nextID();
             $Qnew->freeResult();
             //if the wishlists products has variants
             $products_variants_groups_id = array();
             $products_variants_groups_name = array();
             if (isset($variants_groups_id) && isset($variants_groups_name)) {
                 foreach ($variants_groups_id as $groups_id => $values_id) {
                     $products_variants_groups_id[] = array('groups_id' => $groups_id, 'values_id' => $values_id);
                 }
                 foreach ($variants_groups_name as $groups_name => $values_name) {
                     $products_variants_groups_name[] = array('groups_name' => $groups_name, 'values_name' => $values_name);
                 }
             }
             if (!osc_empty($products_variants_groups_id)) {
                 foreach ($products_variants_groups_id as $key => $groups_id) {
                     $Qinsert = $osC_Database->query('insert into :table_wishlists_products_variants (wishlists_id, wishlists_products_id, products_variants_groups_id, products_variants_groups, products_variants_values_id, products_variants_values) values (:wishlists_id, :wishlists_products_id, :products_variants_groups_id, :products_variants_groups, :products_variants_values_id, :products_variants_values)');
                     $Qinsert->bindTable(':table_wishlists_products_variants', TABLE_WISHLISTS_PRODUCTS_VARIANTS);
                     $Qinsert->bindInt(':wishlists_id', $this->_wishlists_id);
                     $Qinsert->bindInt(':wishlists_products_id', $wishlists_products_id);
                     $Qinsert->bindInt(':products_variants_groups_id', $groups_id['groups_id']);
                     $Qinsert->bindInt(':products_variants_values_id', $groups_id['values_id']);
                     $Qinsert->bindValue(':products_variants_groups', $products_variants_groups_name[$key]['groups_name']);
                     $Qinsert->bindValue(':products_variants_values', $products_variants_groups_name[$key]['values_name']);
                     $Qinsert->execute();
                 }
             }
         }
     }
 }
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
?>

<h1><?php 
echo $osC_Template->getPageTitle();
?>
</h1>

<?php 
if (osC_Order::numberOfEntries() > 0) {
    $Qhistory = osC_Order::getListing(MAX_DISPLAY_ORDER_HISTORY);
    while ($Qhistory->next()) {
        if (!osc_empty($Qhistory->value('delivery_name'))) {
            $order_type = $osC_Language->get('order_shipped_to');
            $order_name = $Qhistory->value('delivery_name');
        } else {
            $order_type = $osC_Language->get('order_billed_to');
            $order_name = $Qhistory->value('billing_name');
        }
        ?>

<div class="moduleBox">

  <h6><span style="float: left;"><?php 
        echo $osC_Language->get('order_status') . ' ' . osC_Order::getLastPublicStatus($Qhistory->value('orders_id'));
        ?>
</span><?php 
        echo $osC_Language->get('order_number') . ' ' . $Qhistory->valueInt('orders_id');
    <div class="content">
    	<table border="0" width="100%" cellspacing="0" cellpadding="2">
            <?php 
    while ($Qstatus->next()) {
        ?>
            <tr>
                <td valign="top" width="70"><?php 
        echo osC_DateTime::getShort($Qstatus->value('date_added'));
        ?>
</td>
                <td valign="top" width="200"><?php 
        echo $Qstatus->value('orders_status_name');
        ?>
</td>
                <td valign="top"><?php 
        echo !osc_empty($Qstatus->valueProtected('comments')) ? nl2br($Qstatus->valueProtected('comments')) : '&nbsp;';
        ?>
</td>
            </tr>
            <?php 
    }
    ?>
    	</table>
    </div>
</div>

<?php 
}
?>
<div class="submitFormButtons">
	<a href="<?php 
 function listLog()
 {
     global $toC_Json, $osC_Database;
     $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
     $limit = empty($_REQUEST['limit']) ? MAX_DISPLAY_SEARCH_RESULTS : $_REQUEST['limit'];
     $Qlog = $osC_Database->query('select email_address, date_sent from :table_newsletters_log where newsletters_id = :newsletters_id order by date_sent desc');
     $Qlog->bindTable(':table_newsletters_log', TABLE_NEWSLETTERS_LOG);
     $Qlog->bindInt(':newsletters_id', $_REQUEST['newsletters_id']);
     $Qlog->setExtBatchLimit($start, $limit);
     $Qlog->execute();
     $records = array();
     while ($Qlog->next()) {
         $records[] = array('email_address' => $Qlog->valueProtected('email_address'), 'sent' => osc_icon(!osc_empty($Qlog->value('date_sent')) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif', null, null), 'date_sent' => osC_DateTime::getShort($Qlog->value('date_sent'), true));
     }
     $Qlog->freeResult();
     $response = array(EXT_JSON_READER_TOTAL => $Qlog->getBatchSize(), EXT_JSON_READER_ROOT => $records);
     echo $toC_Json->encode($response);
 }
        action: 'back_backup'
      },
      layoutConfig: { labelSeparator: ''},
      autoHeight: true,
      defaults: {anchor: '97%'},
      labelWidth: 160,
      
      items: [
        {
          border: false,
          html: '<?php 
$compression_array = array(array("id" => "none", "text" => $osC_Language->get("field_compression_none")));
if (!osc_empty(CFG_APP_GZIP) && file_exists(CFG_APP_GZIP)) {
    $compression_array[] = array("id" => "gzip", "text" => $osC_Language->get("field_compression_gzip"));
}
if (!osc_empty(CFG_APP_ZIP) && file_exists(CFG_APP_ZIP)) {
    $compression_array[] = array("id" => "zip", "text" => $osC_Language->get("field_compression_zip"));
}
echo '<p class="form-info">' . $osC_Language->get("introduction_new_backup") . '</p>';
echo '<p>' . osc_draw_radio_field("compression", $compression_array, "none", null, "<br />") . '</p>';
?>
'
        }
      ]
    });
    
    return this.frmBackup;
  },
  
  submitForm: function () {
    this.frmBackup.form.submit({
Exemple #26
0
 function process_button()
 {
     global $order, $osC_Currencies, $osC_Language;
     switch (MODULE_PAYMENT_IPAYMENT_CURRENCY) {
         case 'Always EUR':
             $trx_currency = 'EUR';
             break;
         case 'Always USD':
             $trx_currency = 'USD';
             break;
         case 'Either EUR or USD, else EUR':
             if ($_SESSION['currency'] == 'EUR' || $_SESSION['currency'] == 'USD') {
                 $trx_currency = $_SESSION['currency'];
             } else {
                 $trx_currency = 'EUR';
             }
             break;
         case 'Either EUR or USD, else USD':
             if ($_SESSION['currency'] == 'EUR' || $_SESSION['currency'] == 'USD') {
                 $trx_currency = $_SESSION['currency'];
             } else {
                 $trx_currency = 'USD';
             }
             break;
     }
     $payment_error_return = 'ipayment_cc_owner=' . urlencode($_POST['ipayment_cc_owner']) . '&ipayment_cc_expires_month=' . urlencode($_POST['ipayment_cc_expires_month']) . '&ipayment_cc_expires_year=' . urlencode($_POST['ipayment_cc_expires_year']) . '&ipayment_cc_checkcode=' . urlencode($_POST['ipayment_cc_checkcode']);
     $process_button_string = osc_draw_hidden_field('trxuser_id', MODULE_PAYMENT_IPAYMENT_USER_ID) . osc_draw_hidden_field('trxpassword', MODULE_PAYMENT_IPAYMENT_PASSWORD) . osc_draw_hidden_field('trx_amount', number_format($order->info['total'] * 100 * $osC_Currencies->value($trx_currency), 0, '', '')) . osc_draw_hidden_field('trx_currency', $trx_currency) . osc_draw_hidden_field('trx_paymenttyp', 'cc') . osc_draw_hidden_field('addr_name', $this->cc_card_owner) . osc_draw_hidden_field('addr_street', $order->billing['street_address']) . osc_draw_hidden_field('addr_city', $order->billing['city']) . osc_draw_hidden_field('addr_zip', $order->billing['postcode']) . osc_draw_hidden_field('addr_country', $order->billing['country']['iso_code_2']) . osc_draw_hidden_field('addr_telefon', $order->customer['telephone']) . osc_draw_hidden_field('addr_email', $order->customer['email_address']) . osc_draw_hidden_field('error_lang', $osC_Language->getCode() == 'en' ? 'en' : 'de') . osc_draw_hidden_field('silent', '1') . osc_draw_hidden_field('silent_error_url', osc_href_link(FILENAME_CHECKOUT, 'payment&payment_error=' . $this->_code . '&' . $payment_error_return, 'SSL')) . osc_draw_hidden_field('redirect_url', osc_href_link(FILENAME_CHECKOUT, 'process', 'SSL')) . osc_draw_hidden_field('cc_number', $this->cc_card_number) . osc_draw_hidden_field('cc_expdate_month', $this->cc_expiry_month) . osc_draw_hidden_field('cc_expdate_year', $this->cc_expiry_year);
     if (!empty($this->cc_checkcode)) {
         $process_button_string .= osc_draw_hidden_field('cc_checkcode', $this->cc_checkcode);
     }
     if (!osc_empty(MODULE_PAYMENT_IPAYMENT_SECURITY_KEY)) {
         $process_button_string .= osc_draw_hidden_field('trx_securityhash', md5(MODULE_PAYMENT_IPAYMENT_USER_ID . number_format($order->info['total'] * 100 * $osC_Currencies->value($trx_currency), 0, '', '') . $trx_currency . MODULE_PAYMENT_IPAYMENT_PASSWORD . MODULE_PAYMENT_IPAYMENT_SECURITY_KEY));
     }
     return $process_button_string;
 }
Exemple #27
0
 function getImage($variants = null)
 {
     $default_image = null;
     $default_variant_image = null;
     $current_variants = null;
     if (isset($this->_data['images']) && is_array($this->_data['images'])) {
         foreach ($this->_data['images'] as $image) {
             //get variant default image
             if ($this->hasVariants()) {
                 if (!osc_empty($this->_current_variants)) {
                     $current_variants = $this->_current_variants;
                 } else {
                     if ($variants !== null) {
                         $current_variants = $variants;
                     }
                 }
                 if ($current_variants !== null) {
                     $product_id_string = osc_get_product_id_string($this->getID(), $current_variants);
                     $product_variant = $this->_data['variants'][$product_id_string];
                     $default_variant_image = $product_variant['image'];
                     break;
                 } else {
                     if (is_array($this->_data['default_variant']) && !empty($this->_data['default_variant'])) {
                         if ($image['id'] == $this->_data['default_variant']['image']) {
                             $default_variant_image = $image['image'];
                         }
                     }
                 }
             }
             //get default image
             if ($image['default_flag'] == '1') {
                 $default_image = $image['image'];
             }
         }
     }
     if ($default_variant_image != null) {
         return $default_variant_image;
     }
     return $default_image;
 }
Exemple #28
0
 /**
  * Update the product information according to the variants
  * 
  * @access private
  * @param string product id string with variants
  * @param object product
  * @param string original product name
  * @param boolean flag to represent the new variant is adding into the wishlist
  * @return string the new product name
  */
 function _updateProduct($products_id_string, $osC_Product, $product_name, $add = true)
 {
     $variant_product = array();
     if (preg_match('/^[0-9]+(#?([0-9]+:?[0-9]+)+(;?([0-9]+:?[0-9]+)+)*)*$/', $products_id_string)) {
         $variants = osc_parse_variants_from_id_string($products_id_string);
     }
     $variants_groups = $osC_Product->getData('variants_groups');
     $products_variants = $osC_Product->getVariants();
     if (is_array($variants) && !osc_empty($variants)) {
         $products_variant = $products_variants[$products_id_string];
     } else {
         if ($add) {
             $products_variant = $osC_Product->getDefaultVariant();
             $default_variants_string = $products_variant['product_id_string'];
             $variants = osc_parse_variants_from_id_string($default_variants_string);
         }
     }
     $variants_groups_name = $products_variant['groups_name'];
     //process products name
     if (!osc_empty($variants_groups_name)) {
         $product_name .= '<br />';
         foreach ($variants_groups_name as $group_name => $value_name) {
             $product_name .= '<em class="label label-info">' . $group_name . ': ' . $value_name . '</em>' . '<br />';
         }
     }
     $variant_product['name'] = $product_name;
     // process product price and image according to the variants
     $variant_product['price'] = $osC_Product->getPrice($variants);
     $variant_product['image'] = $osC_Product->getImage($variants);
     return $variant_product;
 }
$Qstatus = $order->getStatusListing();
if ($Qstatus->numberOfRows() > 0) {
    ?>

<div class="moduleBox">
  <h6><?php 
    echo $osC_Language->get('order_history_heading');
    ?>
</h6>

  <div class="content">
    <table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php 
    while ($Qstatus->next()) {
        echo '    <tr>' . "\n" . '      <td valign="top" width="70">' . osC_DateTime::getShort($Qstatus->value('date_added')) . '</td>' . "\n" . '      <td valign="top" width="200">' . $Qstatus->value('orders_status_name') . '</td>' . "\n" . '      <td valign="top">' . (!osc_empty($Qstatus->valueProtected('comments')) ? nl2br($Qstatus->valueProtected('comments')) : '&nbsp;') . '</td>' . "\n" . '    </tr>' . "\n";
    }
    ?>

    </table>
  </div>
</div>

<?php 
}
?>
<div class="submitFormButtons">
  <?php 
echo osc_link_object(osc_href_link(FILENAME_ACCOUNT, 'orders' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'SSL'), osc_draw_image_button('button_back.gif', $osC_Language->get('button_back')));
?>
</div>
            $Qmanufacturer->bindInt(':manufacturers_id', $_GET['manufacturers_id']);
            $Qmanufacturer->bindInt(':languages_id', $osC_Language->getID());
            $Qmanufacturer->execute();
            if ($Qmanufacturer->numberOfRows() && !osc_empty($Qmanufacturer->value('manufacturers_url'))) {
                $Qupdate = $osC_Database->query('update :table_manufacturers_info set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = :manufacturers_id and languages_id = :languages_id');
                $Qupdate->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
                $Qupdate->bindInt(':manufacturers_id', $_GET['manufacturers_id']);
                $Qupdate->bindInt(':languages_id', $osC_Language->getID());
                $Qupdate->execute();
                osc_redirect($Qmanufacturer->value('manufacturers_url'));
            } else {
                // no url exists for the selected language, lets use the default language then
                $Qmanufacturer = $osC_Database->query('select mi.languages_id, mi.manufacturers_url from :table_manufacturers_info mi, :table_languages l where mi.manufacturers_id = :manufacturers_id and mi.languages_id = l.languages_id and l.code = :code');
                $Qmanufacturer->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
                $Qmanufacturer->bindTable(':table_languages', TABLE_LANGUAGES);
                $Qmanufacturer->bindInt(':manufacturers_id', $_GET['manufacturers_id']);
                $Qmanufacturer->bindValue(':code', DEFAULT_LANGUAGE);
                $Qmanufacturer->execute();
                if ($Qmanufacturer->numberOfRows() && !osc_empty($Qmanufacturer->value('manufacturers_url'))) {
                    $Qupdate = $osC_Database->query('update :table_manufacturers_info set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = :manufacturers_id and languages_id = :languages_id');
                    $Qupdate->bindTable(':table_manufacturers_info', TABLE_MANUFACTURERS_INFO);
                    $Qupdate->bindInt(':manufacturers_id', $_GET['manufacturers_id']);
                    $Qupdate->bindInt(':languages_id', $Qmanufacturer->valueInt('languages_id'));
                    $Qupdate->execute();
                    osc_redirect($Qmanufacturer->value('manufacturers_url'));
                }
            }
        }
        break;
}
osc_redirect(osc_href_link(FILENAME_DEFAULT));