function execute()
 {
     global $PHP_SELF, $currencies, $request_type, $currency, $oscTemplate;
     if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
         if (isset($currencies) && is_object($currencies) && count($currencies->currencies) > 1) {
             reset($currencies->currencies);
             $currencies_array = array();
             while (list($key, $value) = each($currencies->currencies)) {
                 $currencies_array[] = array('id' => $key, 'text' => $value['title']);
             }
             $hidden_get_variables = '';
             reset($_GET);
             while (list($key, $value) = each($_GET)) {
                 if (is_string($value) && $key != 'currency' && $key != tep_session_name() && $key != 'x' && $key != 'y') {
                     $hidden_get_variables .= tep_draw_hidden_field($key, $value);
                 }
             }
             $form_output = tep_draw_form('currencies', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '</form>';
             ob_start();
             include 'includes/modules/boxes/templates/currencies.php';
             $data = ob_get_clean();
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
Пример #2
0
 function pull_down_image_zones($abstract_zone_id)
 {
     extract(tep_load('database'));
     $abstract_query = "select az.abstract_zone_id as id, az.abstract_zone_name as text from " . TABLE_ABSTRACT_ZONES . " az, " . TABLE_ABSTRACT_TYPES . " abt where abstract_types_class='image_zones' and abt.abstract_types_id=az.abstract_types_id";
     $abstract_array = $db->query_to_array($abstract_query);
     return tep_draw_pull_down_menu('configuration_value', $abstract_array, $abstract_zone_id);
 }
Пример #3
0
 function execute()
 {
     global $PHP_SELF, $lng, $request_type, $oscTemplate, $language, $request_type, $HTTP_GET_VARS, $current_lang_key;
     if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
         if (!isset($lng) || isset($lng) && !is_object($lng)) {
             include DIR_WS_CLASSES . 'language.php';
             $lng = new language();
         }
         if (count($lng->catalog_languages) > 1) {
             reset($lng->catalog_languages);
             $languages_array = array();
             while (list($key, $value) = each($lng->catalog_languages)) {
                 $languages_array[] = array('id' => $key, 'text' => $value['name']);
             }
             foreach ($lng->catalog_languages as $key => $value) {
                 if ($value['directory'] == $language) {
                     $current_lang_key = $key;
                     break;
                 }
             }
             reset($HTTP_GET_VARS);
             while (list($key, $value) = each($HTTP_GET_VARS)) {
                 if (is_string($value) && $key != 'language' && $key != tep_session_name() && $key != 'x' && $key != 'y') {
                     $hidden_get_variables .= tep_draw_hidden_field($key, $value);
                 }
             }
             $data = '<div class="headerBox languages">' . '  <span class="headerTitle languages-title">' . MODULE_BOXES_HEADER_LANGUAGES_BOX_TITLE . '</span>' . '  <div class="headerBoxContents">' . '    ' . tep_draw_form('languages', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . '    ' . tep_draw_pull_down_menu('language', $languages_array, $current_lang_key, 'onchange="this.form.submit();"') . $hidden_get_variables . tep_hide_session_id() . '</form>' . '  </div>' . '</div>';
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
Пример #4
0
 function getData()
 {
     global $HTTP_GET_VARS, $request_type, $oscTemplate;
     $data = '';
     $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
     if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
         if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
             // Display a list
             $manufacturers_list = '<ul class="nav nav-list">';
             while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
                 $manufacturers_name = strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name'];
                 if (isset($HTTP_GET_VARS['manufacturers_id']) && $HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id']) {
                     $manufacturers_name = '<strong>' . $manufacturers_name . '</strong>';
                 }
                 $manufacturers_list .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a></li>';
             }
             $manufacturers_list .= '</ul>';
             $content = $manufacturers_list;
         } else {
             // Display a drop-down
             $manufacturers_array = array();
             if (MAX_MANUFACTURERS_LIST < 2) {
                 $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
             }
             while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
                 $manufacturers_name = strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name'];
                 $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers_name);
             }
             $content = tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', $request_type, false), 'get') . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : '', 'onchange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id() . '</form>';
         }
         $data = '<div class="panel panel-default">' . '  <div class="panel-heading">' . MODULE_BOXES_MANUFACTURERS_BOX_TITLE . '</div>' . '  <div class="panel-body">' . $content . '</div>' . '</div>';
     }
     return $data;
 }
Пример #5
0
 function _draw_stocked_attributes()
 {
     global $languages_id;
     $out = '';
     $attributes = $this->_build_attributes_array(true, false);
     if (sizeof($attributes) > 0) {
         for ($o = 0; $o < sizeof($attributes); $o++) {
             $s = sizeof($attributes[$o]['ovals']);
             for ($a = 0; $a < $s; $a++) {
                 $attribute_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_id = '" . (int) $this->products_id . "' AND products_stock_attributes REGEXP '(^|,)" . (int) $attributes[$o]['oid'] . "-" . (int) $attributes[$o]['ovals'][$a]['id'] . "(,|\$)' AND products_stock_quantity > 0");
                 $out_of_stock = tep_db_num_rows($attribute_stock_query) == 0;
                 if ($out_of_stock && $this->show_out_of_stock == 'True') {
                     switch ($this->mark_out_of_stock) {
                         case 'Left':
                             $attributes[$o]['ovals'][$a]['text'] = TEXT_OUT_OF_STOCK . ' - ' . $attributes[$o]['ovals'][$a]['text'];
                             break;
                         case 'Right':
                             $attributes[$o]['ovals'][$a]['text'] .= ' - ' . TEXT_OUT_OF_STOCK;
                             break;
                     }
                 } elseif ($out_of_stock && $this->show_out_of_stock != 'True') {
                     unset($attributes[$o]['ovals'][$a]);
                 }
             }
             $out .= '<tr><td align="right" class="main"><b>' . $attributes[$o]['oname'] . ':</b></td><td class="main" align="left">' . tep_draw_pull_down_menu('id[' . $attributes[$o]['oid'] . ']', array_values($attributes[$o]['ovals']), $attributes[$o]['default'], 'onchange="stkmsg(this.form);"') . '</td></tr>';
         }
         $out .= $this->_draw_out_of_stock_message_js($attributes);
         return $out;
     }
 }
 function showInterface()
 {
     global $pInfo;
     if (MODULE_SHIPPING_FREIGHTQUOTE_STATUS != 'True') {
         return false;
     }
     $template = array('TITLE' => TEXT_PRODUCTS_FREIGHTQUOTE, 'LABEL_ENABLE' => TEXT_PRODUCTS_FREIGHTQUOTE_ENABLE, 'LABEL_CLASS' => TEXT_PRODUCTS_FREIGHTQUOTE_CLASS, 'LABEL_DIMENSIONS' => TEXT_PRODUCTS_FREIGHTQUOTE_DIMENSIONS, 'LABEL_NMFC' => TEXT_PRODUCTS_FREIGHTQUOTE_NMFC, 'LABEL_HZMT' => TEXT_PRODUCTS_FREIGHTQUOTE_HZMT, 'LABEL_COMMODITY_TYPE' => TEXT_PRODUCTS_FREIGHTQUOTE_COMMODITY_TYPE, 'LABEL_PACKAGE_TYPE' => TEXT_PRODUCTS_FREIGHTQUOTE_PACKAGE_TYPE, 'LABEL_CONTENT_TYPE' => TEXT_PRODUCTS_FREIGHTQUOTE_CONTENT_TYPE);
     $boolean_dropdown = array(array('id' => 'true', 'text' => 'True'), array('id' => 'false', 'text' => 'False'));
     $classes = array(array('id' => '50', 'text' => '50'), array('id' => '55', 'text' => '55'), array('id' => '60', 'text' => '60'), array('id' => '65', 'text' => '65'), array('id' => '70', 'text' => '70'), array('id' => '77.5', 'text' => '77.5'), array('id' => '85', 'text' => '85'), array('id' => '92.5', 'text' => '92.5'), array('id' => '100', 'text' => '100'), array('id' => '110', 'text' => '110'), array('id' => '125', 'text' => '125'), array('id' => '150', 'text' => '150'), array('id' => '175', 'text' => '175'), array('id' => '200', 'text' => '200'), array('id' => '250', 'text' => '250'), array('id' => '300', 'text' => '300'), array('id' => '400', 'text' => '400'), array('id' => '500', 'text' => '500'));
     $packages = array(array('id' => 'Bags', 'text' => 'Bags'), array('id' => 'Bales', 'text' => 'Bales'), array('id' => 'Boxes', 'text' => 'Boxes'), array('id' => 'Bundles', 'text' => 'Bundles'), array('id' => 'Carpets', 'text' => 'Carpets'), array('id' => 'Coils', 'text' => 'Coils'), array('id' => 'Crates', 'text' => 'Crates'), array('id' => 'Cylinders', 'text' => 'Cylinders'), array('id' => 'Drums', 'text' => 'Drums'), array('id' => 'Pails', 'text' => 'Pails'), array('id' => 'Reels', 'text' => 'Reels'), array('id' => 'Rolls', 'text' => 'Rolls'), array('id' => 'TubesPipes', 'text' => 'Tubes/Pipes'), array('id' => 'Motorcycle', 'text' => 'Motorcycle'), array('id' => 'ATV', 'text' => 'ATV'), array('id' => 'Pallets_48x40', 'text' => 'Pallets 48x40'), array('id' => 'Pallets_other', 'text' => 'Pallets Other'), array('id' => 'Pallets_120x120', 'text' => 'Pallets 120x120'), array('id' => 'Pallets_120x100', 'text' => 'Pallets 120x100'), array('id' => 'Pallets_120x80', 'text' => 'Pallets 120x80'), array('id' => 'Pallets_europe', 'text' => 'Pallets Europe'), array('id' => 'Pallets_48x48', 'text' => 'Pallets 48x48'), array('id' => 'Pallets_60x48', 'text' => 'Pallets 60x48'));
     $commodities = array(array('id' => 'GeneralMerchandise', 'text' => 'General Merchandise'), array('id' => 'Machinery', 'text' => 'Machinery'), array('id' => 'HouseholdGoods', 'text' => 'Household Goods'), array('id' => 'FragileGoods', 'text' => 'Fragile Goods'), array('id' => 'ComputerHardware', 'text' => 'Computer Hardware'), array('id' => 'BottledProducts', 'text' => 'Bottled Products'), array('id' => 'BottleBeverages', 'text' => 'Bottle Beverages'), array('id' => 'NonPerishableFood', 'text' => 'Non Perishable Food'), array('id' => 'SteelSheet', 'text' => 'Steel Sheet'), array('id' => 'BrandedGoods', 'text' => 'Branded Goods'), array('id' => 'PrecisionInstruments', 'text' => 'Precision Instruments'), array('id' => 'ChemicalsHazardous', 'text' => 'Chemicals Hazardous'), array('id' => 'FineArt', 'text' => 'Fine Art'), array('id' => 'Automobiles', 'text' => 'Automobiles'), array('id' => 'CellPhones', 'text' => 'Cell Phones'), array('id' => 'NewMachinery', 'text' => 'New Machinery'), array('id' => 'UsedMachinery', 'text' => 'Used Machinery'), array('id' => 'HotTubs', 'text' => 'Hot Tubs'));
     $contents = array(array('id' => 'NewCommercialGoods', 'text' => 'New Commercial Goods'), array('id' => 'UsedCommercialGoods', 'text' => 'Used Commercial Goods'), array('id' => 'HouseholdGoods', 'text' => 'Household Goods'), array('id' => 'FragileGoods', 'text' => 'Fragile Goods'), array('id' => 'Automobile', 'text' => 'Automobile'), array('id' => 'Motorcycle', 'text' => 'Motorcycle'), array('id' => 'AutoOrMotorcycle', 'text' => 'Auto or Motorcycle'));
     $template['DROPDOWN_CLASS'] = tep_draw_pull_down_menu('products_freightquote_class', $classes, $pInfo->products_freightquote_class);
     $template['FIELD_ENABLE'] = tep_draw_checkbox_field('products_freightquote_enable', '1', $pInfo->products_freightquote_enable == '1' ? true : false);
     $template['FIELDS_DIMENSIONS'] = tep_draw_input_field('products_freightquote_length', $pInfo->products_freightquote_length, 'maxlength=3 style="width:50px"') . 'L x ' . tep_draw_input_field('products_freightquote_width', $pInfo->products_freightquote_width, 'maxlength=3 style="width:50px"') . 'W x ' . tep_draw_input_field('products_freightquote_height', $pInfo->products_freightquote_height, 'maxlength=3 style="width:50px"') . 'H';
     $template['FIELD_NMFC'] = tep_draw_input_field('products_freightquote_nmfc', $pInfo->products_freightquote_nmfc, 'maxlength=100');
     $template['DROPDOWN_HZMT'] = tep_draw_pull_down_menu('products_freightquote_hzmt', $boolean_dropdown, $pInfo->products_freightquote_hzmt == 'true' ? 'true' : 'false');
     $template['DROPDOWN_PACKAGE_TYPES'] = tep_draw_pull_down_menu('products_freightquote_package_type', $packages, $pInfo->products_freightquote_package_type);
     $template['DROPDOWN_COMMODITY_TYPES'] = tep_draw_pull_down_menu('products_freightquote_commodity_type', $commodities, $pInfo->products_freightquote_commodity_type);
     $template['DROPDOWN_CONTENT_TYPES'] = tep_draw_pull_down_menu('products_freightquote_content_type', $contents, $pInfo->products_freightquote_content_type);
     $template_file = file_get_contents($this->fqDirectory . 'freightquote_interface.tpl');
     foreach ($template as $key => $val) {
         $template_file = str_replace($key, $val, $template_file);
     }
     echo $template_file;
 }
    function getSetField()
    {
        global $languages_id;
        $statuses_array = array();
        $flags_query = tep_db_query("describe orders_status public_flag");
        if (tep_db_num_rows($flags_query) == 1) {
            $statuses_query = tep_db_query("select orders_status_id, orders_status_name from orders_status where language_id = '" . (int) $languages_id . "' and public_flag = '0' order by orders_status_name");
        } else {
            $statuses_query = tep_db_query("select orders_status_id, orders_status_name from orders_status where language_id = '" . (int) $languages_id . "' order by orders_status_name");
        }
        while ($statuses = tep_db_fetch_array($statuses_query)) {
            $statuses_array[] = array('id' => $statuses['orders_status_id'], 'text' => $statuses['orders_status_name']);
        }
        $input = tep_draw_pull_down_menu('transactions_order_status_id', $statuses_array, OSCOM_APP_PAYPAL_TRANSACTIONS_ORDER_STATUS_ID, 'id="inputTransactionsOrderStatusId"');
        $result = <<<EOT
<div>
  <p>
    <label for="inputTransactionsOrderStatusId">{$this->title}</label>

    {$this->description}
  </p>

  <div>
    {$input}
  </div>
</div>
EOT;
        return $result;
    }
    function choose_audience()
    {
        global $HTTP_GET_VARS, $languages_id;
        $products_array = array();
        $products_query = tep_db_query("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.language_id = '" . $languages_id . "' and pd.products_id = p.products_id and p.products_status = '1' order by pd.products_name");
        while ($products = tep_db_fetch_array($products_query)) {
            $products_array[] = array('id' => $products['products_id'], 'text' => $products['products_name']);
        }
        $choose_audience_string = '<script type="text/javascript"><!--
function mover(move) {
  if (move == \'remove\') {
    for (x=0; x<(document.notifications.products.length); x++) {
      if (document.notifications.products.options[x].selected) {
        with(document.notifications.elements[\'chosen[]\']) {
          options[options.length] = new Option(document.notifications.products.options[x].text,document.notifications.products.options[x].value);
        }
        document.notifications.products.options[x] = null;
        x = -1;
      }
    }
  }
  if (move == \'add\') {
    for (x=0; x<(document.notifications.elements[\'chosen[]\'].length); x++) {
      if (document.notifications.elements[\'chosen[]\'].options[x].selected) {
        with(document.notifications.products) {
          options[options.length] = new Option(document.notifications.elements[\'chosen[]\'].options[x].text,document.notifications.elements[\'chosen[]\'].options[x].value);
        }
        document.notifications.elements[\'chosen[]\'].options[x] = null;
        x = -1;
      }
    }
  }
  return true;
}

function selectAll(FormName, SelectBox) {
  temp = "document." + FormName + ".elements[\'" + SelectBox + "\']";
  Source = eval(temp);

  for (x=0; x<(Source.length); x++) {
    Source.options[x].selected = "true";
  }

  if (x<1) {
    alert(\'' . JS_PLEASE_SELECT_PRODUCTS . '\');
    return false;
  } else {
    return true;
  }
}
//--></script>';
        $global_button = tep_draw_button(BUTTON_GLOBAL, 'circle-triangle-n', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm&global=true'), 'primary');
        $cancel_button = tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']));
        $choose_audience_string .= '<form name="notifications" action="' . tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm') . '" method="post" onsubmit="return selectAll(\'notifications\', \'chosen[]\')"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n" . '  <tr>' . "\n" . '    <td align="center" class="smallText"><strong>' . TEXT_PRODUCTS . '</strong><br />' . tep_draw_pull_down_menu('products', $products_array, '', 'size="20" style="width: 20em;" multiple') . '</td>' . "\n" . '    <td align="center" class="smallText">&nbsp;<br />' . $global_button . '<br /><br /><br /><input type="button" value="' . BUTTON_SELECT . '" style="width: 8em;" onClick="mover(\'remove\');"><br /><br /><input type="button" value="' . BUTTON_UNSELECT . '" style="width: 8em;" onClick="mover(\'add\');"><br /><br /><br />' . tep_draw_button(IMAGE_SEND, 'mail-closed', null, 'primary') . '<br /><br />' . $cancel_button . '</td>' . "\n" . '    <td align="center" class="smallText"><strong>' . TEXT_SELECTED_PRODUCTS . '</strong><br />' . tep_draw_pull_down_menu('chosen[]', array(), '', 'size="20" style="width: 20em;" multiple') . '</td>' . "\n" . '  </tr>' . "\n" . '</table></form>';
        return $choose_audience_string;
    }
Пример #9
0
 function getData()
 {
     global $HTTP_GET_VARS, $request_type, $oscTemplate, $template_id;
     $data = '';
     $content = tep_draw_form('goto', 'bts_header_builder.php', '', 'get');
     $content .= tep_draw_pull_down_menu('template_id', tep_get_templates_tree(), $current_category_id, 'onchange="this.form.submit();"');
     $content .= tep_hide_session_id() . '</form>';
     $data = '<div class="panel panel-default">' . '  <div class="panel-heading">' . MODULE_BOXES_TEMPLATES_BOX_TITLE . '</div>' . '  <div class="panel-body">' . $content . '</div>' . '</div>';
     return $data;
 }
Пример #10
0
function sbs_get_country_list($name, $selected = '', $parameters = '')
{
    $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
    $countries = sbs_get_countries();
    $size = sizeof($countries);
    for ($i = 0; $i < $size; $i++) {
        $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
    }
    return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
}
 function selection()
 {
     for ($i = 1; $i < 13; $i++) {
         $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)));
     }
     $today = getdate();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $expires_year[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     $selection = array('id' => $this->code, 'module' => $this->public_title, 'fields' => array(array('title' => MODULE_PAYMENT_PAYPAL_PAYFLOW_PRO_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('paypal_payflow_pro_number')), array('title' => MODULE_PAYMENT_PAYPAL_PAYFLOW_PRO_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('paypal_payflow_pro_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('paypal_payflow_pro_expires_year', $expires_year)), array('title' => MODULE_PAYMENT_PAYPAL_PAYFLOW_PRO_TEXT_CREDIT_CARD_CVV2, 'field' => tep_draw_input_field('paypal_payflow_pro_cvv2', '', 'size="4"'))));
     return $selection;
 }
Пример #12
0
/**
 * $Id: manufacturers.php 63 2005-12-16 21:41:48Z Michael $
 * osCommerce, Open Source E-Commerce Solutions
 * http://www.oscommerce.com
 * Copyright (c) 2003 osCommerce
 * Released under the GNU General Public License
 * adapted 2005 for xoops by FlinkUX <http://www.flinkux.de>
 * @package xosC
 * @author Michael Hammelmann <*****@*****.**>
*/
function show_manufacturers()
{
    global $xoopsDB, $xoopsConfig, $xoopsTpl, $xoopsConfig;
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/configure.php";
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/database_tables.php";
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/filenames.php";
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/database.php";
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/sessions.php";
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/general.php";
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/html_output.php";
    include_once XOOPS_ROOT_PATH . "/modules/osC/includes/classes/boxes.php";
    if (!defined('XBLOCK_CONFIG')) {
        $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
        while ($configuration = tep_db_fetch_array($configuration_query)) {
            define($configuration['cfgKey'], $configuration['cfgValue']);
        }
        define('XBLOCK_CONFIG', "1");
    }
    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
    if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {
        $info_box_contents = array();
        $info_box_contents[] = array('text' => BOX_HEADING_MANUFACTURERS);
        new infoBoxHeading($info_box_contents, false, false);
        if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {
            // Display a list
            $manufacturers_list = '';
            while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
                $manufacturers_name = strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name'];
                if (isset($HTTP_GET_VARS['manufacturers_id']) && $HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id']) {
                    $manufacturers_name = '<b>' . $manufacturers_name . '</b>';
                }
                $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';
            }
            $manufacturers_list = substr($manufacturers_list, 0, -4);
            $info_box_contents = array();
            $info_box_contents[] = array('text' => $manufacturers_list);
        } else {
            // Display a drop-down
            $manufacturers_array = array();
            if (MAX_MANUFACTURERS_LIST < 2) {
                $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
            }
            while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
                $manufacturers_name = strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name'];
                $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers_name);
            }
            $info_box_contents = array();
            $info_box_contents[] = array('form' => tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'), 'text' => tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : '', 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id());
        }
        $block = new infoBox($info_box_contents);
    }
    return $block->content;
}
Пример #13
0
 function selection()
 {
     global $order;
     for ($i = 1; $i < 13; $i++) {
         $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)));
     }
     $today = getdate();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $expires_year[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER, 'field' => tep_draw_input_field('intensepay_cc_name', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('intensepay_cc_num')), array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('intensepay_cc_exp_mon', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('intensepay_cc_exp_year', $expires_year)), array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVV2, 'field' => tep_draw_input_field('intensepay_cc_cvv2', '', 'style="width:40px" maxlength="4"'))));
     return $selection;
 }
Пример #14
0
 function confirmation()
 {
     global $order;
     for ($i = 1; $i < 13; $i++) {
         $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)));
     }
     $today = getdate();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $expires_year[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_OWNER, 'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('cc_number_nh-dns')), array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)), array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_CVC, 'field' => tep_draw_input_field('cc_cvc_nh-dns', '', 'size="5" maxlength="4"'))));
     return $confirmation;
 }
Пример #15
0
 function selection()
 {
     global $order;
     for ($i = 1; $i < 13; $i++) {
         $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)));
     }
     $today = getdate();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $expires_year[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER, 'field' => tep_draw_input_field('ipayment_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('ipayment_cc_number')), array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('ipayment_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('ipayment_cc_expires_year', $expires_year)), array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER, 'field' => tep_draw_input_field('ipayment_cc_checkcode', '', 'size="4" maxlength="3"') . '&nbsp;<small>' . MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER_LOCATION . '</small>')));
     return $selection;
 }
Пример #16
0
 function selection()
 {
     global $order;
     for ($i = 1; $i < 13; $i++) {
         $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B - (%m)', mktime(0, 0, 0, $i, 1, 2000)));
     }
     $today = getdate();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $expires_year[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     $onFocus = 'onfocus="methodSelect(\'pmt-' . $this->code . '\')"';
     $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_VELOCITY_TEXT_CREDIT_CARD_OWNER, 'field' => tep_draw_input_field('velocity_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'id="' . $this->code . '-cc-owner"' . $onFocus . ' autocomplete="off"'), 'tag' => $this->code . '-cc-owner'), array('title' => MODULE_PAYMENT_VELOCITY_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('velocity_cc_number', '', 'id="' . $this->code . '-cc-number"' . $onFocus . ' autocomplete="off"'), 'tag' => $this->code . '-cc-number'), array('title' => MODULE_PAYMENT_VELOCITY_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('velocity_cc_expires_month', $expires_month, strftime('%m'), 'id="' . $this->code . '-cc-expires-month"' . $onFocus) . '&nbsp;' . tep_draw_pull_down_menu('velocity_cc_expires_year', $expires_year, '', 'id="' . $this->code . '-cc-expires-year"' . $onFocus), 'tag' => $this->code . '-cc-expires-month'), array('title' => MODULE_PAYMENT_VELOCITY_TEXT_CVV, 'field' => tep_draw_password_field('velocity_cc_cvv', '', 'size="4" maxlength="4"' . ' id="' . $this->code . '-cc-cvv"' . $onFocus . ' autocomplete="off"'), 'tag' => $this->code . '-cc-cvv')));
     return $selection;
 }
Пример #17
0
 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     global $PHP_SELF;
     if (tep_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // calculate number of pages needing links
     $num_pages = intval($query_numrows / $max_rows_per_page);
     // $num_pages now contains int of pages needed unless there is a remainder from division
     if ($query_numrows % $max_rows_per_page) {
         $num_pages++;
     }
     // has remainder so add one page
     $pages_array = array();
     for ($i = 1; $i <= $num_pages; $i++) {
         $pages_array[] = array('id' => $i, 'text' => $i);
     }
     if ($num_pages > 1) {
         $display_links = tep_draw_form('pages', basename($PHP_SELF), '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number - 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
         } else {
             $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
         }
         $display_links .= sprintf(TEXT_RESULT_PAGE, tep_draw_pull_down_menu($page_name, $pages_array, '', 'onChange="this.form.submit();"'), $num_pages);
         if ($current_page_number < $num_pages && $num_pages != 1) {
             $display_links .= '&nbsp;&nbsp;<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number + 1), 'NONSSL') . '" 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 .= tep_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         if (SID) {
             $display_links .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
         }
         $display_links .= '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
Пример #18
0
 /**
  * Creates an array of fields that defines the required params
  * when using this module as a potential payment method.
  *
  * @return array
  */
 function selection()
 {
     global $order;
     // Setup the possibly expiry months
     for ($i = 1; $i < 13; $i++) {
         $expiryMonths[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)));
     }
     // Setup the possible expiry years
     $currentYear = date("Y");
     for ($i = $currentYear; $i < $currentYear + 10; $i++) {
         $expiryYears[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     // Build the selection array
     $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_EXALT_TEXT_CREDIT_CARD_OWNER, 'field' => tep_draw_input_field('exalt_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_EXALT_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('exalt_cc_number')), array('title' => MODULE_PAYMENT_EXALT_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('exalt_cc_expires_month', $expiryMonths) . '&nbsp;' . tep_draw_pull_down_menu('exalt_cc_expires_year', $expiryYears)), array('title' => MODULE_PAYMENT_EXALT_TEXT_CREDIT_CARD_CVV, 'field' => tep_draw_input_field('exalt_cc_cvc', '', 'size="5" maxlength="4"'))));
     return $selection;
 }
Пример #19
0
 function getAdminPricing()
 {
     global $pInfo;
     $content = '<tr bgcolor="#ebebff">';
     $content .= '<td class="main">' . TEXT_PRODUCTS_TIME . '</td>';
     $content .= '<td class="main">' . tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('price_class_time', $this->iterate, $pInfo->products_price_class, '') . '</td>';
     $content .= '</tr>';
     $content .= '<tr bgcolor="#ebebff">';
     $content .= '<td class="main">' . TEXT_PRODUCTS_PRICE_NET . '</td>';
     $content .= '<td class="main">' . tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"') . '</td>';
     $content .= '</tr>';
     $content .= '<tr bgcolor="#ebebff">';
     $content .= '<td class="main">' . TEXT_PRODUCTS_PRICE_GROSS . '</td>';
     $content .= '<td class="main">' . tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"') . '</td>';
     $content .= '</tr>';
     return $content;
 }
Пример #20
0
 function selection()
 {
     global $order;
     if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
         for ($i = 1; $i < 13; $i++) {
             $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)));
         }
         $today = getdate();
         for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
             $expires_year[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
         }
         $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER, 'field' => $order->billing['firstname'] . ' ' . $order->billing['lastname']), array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('psigate_cc_number')), array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('psigate_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('psigate_cc_expires_year', $expires_year))));
     } else {
         $selection = array('id' => $this->code, 'module' => $this->title);
     }
     return $selection;
 }
Пример #21
0
function gr_edit($id, $key = '')
{
    $name = $key ? 'configuration[' . $key . ']' : 'configuration_value';
    $gr_campaig = array(array('id' => '0', 'text' => TEXT_NONE));
    $api_key = MODULE_ORDER_TOTAL_GETRESPONSE_API_KEY;
    if (!empty($api_key)) {
        try {
            $client = new jsonRPCClient('http://api2.getresponse.com');
            $result = $client->get_campaigns($api_key);
            foreach ($result as $k) {
                $gr_campaig[] = array('id' => $k['name'], 'text' => $k['name']);
            }
        } catch (Exception $e) {
            error_log($e->getMessage());
        }
    }
    return tep_draw_pull_down_menu($name, $gr_campaig, $id);
}
Пример #22
0
	function selection() {

		
		   global $order;
		   if (MODULE_PAYMENT_WM_PURSE_WME) $purse_type[] = array('id' => 'WME', 'text' => 'WME Euro (EUR)');
		   if (MODULE_PAYMENT_WM_PURSE_WMZ) $purse_type[] = array('id' => 'WMZ', 'text' => 'WMZ U.S. Dollar (USD)');
		   if (MODULE_PAYMENT_WM_PURSE_WMU) $purse_type[] = array('id' => 'WMU', 'text' => 'WMU Ukraine Hryvnia (UAH)');
		   if (MODULE_PAYMENT_WM_PURSE_WMR) $purse_type[] = array('id' => 'WMR', 'text' => 'WMR Russian Rouble (RUB)');

		   $selection = array(
		   'id' => $this->code,
		   'module' => $this->title,
		   'fields' => array(array('title' => 'Choose type', 'field' => tep_draw_pull_down_menu('wm_purse_type', $purse_type)))
		   );

		   return $selection;
		
		//return array('id' => $this->code, 'module' => $this->title);
	}
Пример #23
0
 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     global $PHP_SELF;
     if (tep_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 = tep_draw_form('pages', $PHP_SELF, '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . tep_href_link($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, tep_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="' . tep_href_link($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);
             foreach ($pairs as $pair) {
                 list($key, $value) = explode('=', $pair);
                 $display_links .= tep_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         $display_links .= tep_hide_session_id() . '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
Пример #24
0
function ShowAttributesTable($product_id)
{
    global $languages_id;
    $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int) $product_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int) $languages_id . "'");
    $products_attributes = tep_db_fetch_array($products_attributes_query);
    if ($products_attributes['total'] > 0) {
        $output = '<table border="0" cellspacing="1" cellpadding="7" width="180">';
        $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int) $product_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int) $languages_id . "' order by popt.products_options_name");
        $count = 0;
        while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
            $count++;
            $products_options_array = array();
            $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int) $product_id . "' and pa.options_id = '" . (int) $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int) $languages_id . "'");
            while ($products_options = tep_db_fetch_array($products_options_query)) {
                $stock = GetStockMaat($product_id, $products_options['products_options_values_name'], SOAP_STOCK_TYPE);
                if ($stock > 0) {
                    $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name'] . ' (' . GetStockMaat($product_id, $products_options['products_options_values_name'], SOAP_STOCK_TYPE) . ' op voorraad)');
                } else {
                    $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name'] . ' (niet op voorraad)');
                }
                if ($products_options['options_values_price'] != '0') {
                    $products_options_array[sizeof($products_options_array) - 1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ') ';
                }
            }
            if (isset($cart->contents[$product_id]['attributes'][$products_options_name['products_options_id']])) {
                $selected_attribute = $cart->contents[$product_id]['attributes'][$products_options_name['products_options_id']];
            } else {
                $selected_attribute = false;
            }
            if (!empty($products_options_array)) {
                $output .= '<tr>';
                $output .= '<td class="main">' . $products_options_name['products_options_name'] . ':</td>';
                $output .= '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '</td>';
                $output .= '</tr>';
            }
        }
        $output .= '</table>';
    }
    return $output;
}
Пример #25
0
 function execute()
 {
     global $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency, $oscTemplate;
     if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
         if (isset($currencies) && is_object($currencies) && count($currencies->currencies) > 1) {
             reset($currencies->currencies);
             $currencies_array = array();
             while (list($key, $value) = each($currencies->currencies)) {
                 $currencies_array[] = array('id' => $key, 'text' => $value['title']);
             }
             $hidden_get_variables = '';
             reset($HTTP_GET_VARS);
             while (list($key, $value) = each($HTTP_GET_VARS)) {
                 if (is_string($value) && $key != 'currency' && $key != tep_session_name() && $key != 'x' && $key != 'y') {
                     $hidden_get_variables .= tep_draw_hidden_field($key, $value);
                 }
             }
             $data = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CURRENCIES_BOX_TITLE . '</div>' . '  <div class="ui-widget-content infoBoxContents">' . '    ' . tep_draw_form('currencies', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . '    ' . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '</form>' . '  </div>' . '</div>';
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
Пример #26
0
 function selection()
 {
     global $order;
     for ($i = 1; $i < 13; $i++) {
         $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)));
     }
     $today = getdate();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $expires_year[] = array('id' => strftime('%y', mktime(0, 0, 0, 1, 1, $i)), 'text' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)));
     }
     // Depending on whether CreLoaded is collecting the CC# or not.  If
     // CreLoaded is collecting then we must allow the user to enter it,
     // here we output the form fields to collect the cc#
     if (!$this->quantum_gets_cc) {
         $selection = array('id' => $this->code, 'module' => $this->public_title, 'fields' => array(array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_OWNER, 'field' => tep_draw_input_field('quantumqgwdbe_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_NUMBER, 'field' => tep_draw_input_field('quantumqgwdbe_cc_number')), array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_EXPIRES, 'field' => tep_draw_pull_down_menu('quantumqgwdbe_cc_expires_month', $expires_month) . '&nbsp;' . tep_draw_pull_down_menu('quantumqgwdbe_cc_expires_year', $expires_year))));
         if ($this->uses_cvv) {
             array_push($selection['fields'], array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_CREDIT_CARD_CVV, 'field' => tep_draw_input_field('quantumqgwdbe_cvv', '', "SIZE=4, MAXLENGTH=4") . ' ' . '<a href="cvv.html" target="_blank">' . '<u><i>' . '(What is CVV?)' . '</i></u></a>', 'field' => tep_draw_input_field('quantumqgwdbe_cvv', '', "SIZE=4, MAXLENGTH=4")), array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_NOT_CVV, 'field' => tep_draw_checkbox_field('quantumqgwdbe_notcvv', '1')), array('title' => MODULE_PAYMENT_QUANTUMQGWDBE_TEXT_REASON_NOT_CVV, 'field' => tep_draw_pull_down_menu('quantumqgwdbe_cvvtype', $this->cvvtype, '2')));
         }
     } else {
         $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => 'Continue', 'field' => tep_draw_hidden_field('quantumqgwdbe_cc_owner', ''))));
     }
     return $selection;
 }
Пример #27
0
 function _draw_stocked_attributes()
 {
     global $languages_id;
     $out = '';
     $attributes = $this->_build_attributes_array(true, false);
     if (sizeof($attributes) > 0) {
         $combinations = array();
         $selected_combination = 0;
         $this->_build_attributes_combinations($attributes, $this->show_out_of_stock == 'True', $this->mark_out_of_stock, $combinations, $selected_combination);
         $combname = '';
         foreach ($attributes as $attrib) {
             $combname .= ', ' . $attrib['oname'];
         }
         $combname = substr($combname, 2) . ':';
         $out .= "<tr>\n";
         $out .= '  <td align="right" class=main><b>' . $combname . "</b></td>\n  <td class=main>";
         $out .= tep_draw_pull_down_menu('attrcomb', $combinations, $combinations[$selected_combination]['id']);
         $out .= "</td>\n";
         $out .= "</tr>\n";
     }
     $out .= $this->_draw_out_of_stock_message_js($attributes);
     return $out;
 }
Пример #28
0
function ajax_get_zones_html($country, $default_zone = '', $ajax_output = true)
{
    $output = '';
    $zones_array = array();
    $zones_query = tep_db_query("select zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country . "' order by zone_name");
    while ($zones_values = tep_db_fetch_array($zones_query)) {
        $zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']);
    }
    if (tep_db_num_rows($zones_query)) {
        $output .= tep_draw_pull_down_menu('zone_id', $zones_array, $default_zone);
    } else {
        $output .= tep_draw_input_field('state', $default_zone);
    }
    if (tep_not_null(ENTRY_STATE_TEXT)) {
        $output .= '&nbsp;<span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>';
    }
    if ($ajax_output) {
        header('Content-type: text/html; charset=' . CHARSET);
        echo $output;
    } else {
        return $output;
    }
}
    function getSetField()
    {
        global $OSCOM_PayPal, $languages_id;
        $statuses_array = array(array('id' => '0', 'text' => $OSCOM_PayPal->getDef('cfg_ps_order_status_id_default')));
        $statuses_query = tep_db_query("select orders_status_id, orders_status_name from orders_status where language_id = '" . (int) $languages_id . "' order by orders_status_name");
        while ($statuses = tep_db_fetch_array($statuses_query)) {
            $statuses_array[] = array('id' => $statuses['orders_status_id'], 'text' => $statuses['orders_status_name']);
        }
        $input = tep_draw_pull_down_menu('order_status_id', $statuses_array, OSCOM_APP_PAYPAL_PS_ORDER_STATUS_ID, 'id="inputPsOrderStatusId"');
        $result = <<<EOT
<div>
  <p>
    <label for="inputPsOrderStatusId">{$this->title}</label>

    {$this->description}
  </p>

  <div>
    {$input}
  </div>
</div>
EOT;
        return $result;
    }
Пример #30
0
    function getSetField()
    {
        global $OSCOM_PayPal;
        $zone_class_array = array(array('id' => '0', 'text' => $OSCOM_PayPal->getDef('cfg_ec_zone_global')));
        $zone_class_query = tep_db_query("select geo_zone_id, geo_zone_name from geo_zones order by geo_zone_name");
        while ($zone_class = tep_db_fetch_array($zone_class_query)) {
            $zone_class_array[] = array('id' => $zone_class['geo_zone_id'], 'text' => $zone_class['geo_zone_name']);
        }
        $input = tep_draw_pull_down_menu('zone', $zone_class_array, OSCOM_APP_PAYPAL_EC_ZONE, 'id="inputEcZone"');
        $result = <<<EOT
<div>
  <p>
    <label for="inputEcZone">{$this->title}</label>

    {$this->description}
  </p>

  <div>
    {$input}
  </div>
</div>
EOT;
        return $result;
    }