function olc_image_submit($src, $alt = '', $parameters = '', $Ajax_reset_cart_data_dirty = false)
{
    $rep = array(QUOTE => '"');
    $src = olc_parse_input_field_data($src, $rep);
    if (IS_ADMIN_FUNCTION) {
        $src = CURRENT_TEMPLATE_ADMIN_BUTTONS . $src;
    } else {
        $src = CURRENT_TEMPLATE_BUTTONS . $src;
    }
    /*
    if (IS_MULTI_SHOP)
    {
    	$src=olc_set_multi_shop_dir_info($src);
    }
    */
    $src = '<input type="image" class="image" src="' . $src . '"  style="border:0px"';
    if (olc_not_null($alt)) {
        $alt = olc_parse_input_field_data($alt, $rep);
        $src .= ' title="' . $alt . QUOTE;
    }
    $src .= ' alt="' . $alt . QUOTE;
    //W. Kaiser - AJAX
    if ($Ajax_reset_cart_data_dirty) {
        //Reset "cart_data_dirty"-flag, if form is submitted
        $parameters .= ' onclick="javascript:sticky_cart_data_dirty=false;"';
    }
    if (olc_not_null($parameters)) {
        $src .= BLANK . $parameters;
    }
    $src .= '/>';
    return $src;
}
Exemplo n.º 2
0
 function quote($method = '')
 {
     global $order, $shipping_weight, $shipping_num_boxes;
     if (!$order) {
         $order = new order();
         $shipping_weight = $_SESSION['cart']->show_weight();
     }
     $order_delivery_country = $order->delivery['country'];
     if (MODULE_SHIPPING_TABLE_MODE == 'price') {
         $order_total = $_SESSION['cart']->show_total();
     } else {
         $order_total = $shipping_weight;
     }
     $table_cost = split("[:,]", MODULE_SHIPPING_TABLE_COST);
     $size = sizeof($table_cost);
     for ($i = 0, $n = $size; $i < $n; $i += 2) {
         if ($order_total <= $table_cost[$i]) {
             $shipping = $table_cost[$i + 1];
             break;
         }
     }
     if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
         $shipping = $shipping * $shipping_num_boxes;
     }
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_TABLE_TEXT_WAY, 'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = olc_get_tax_rate($this->tax_class, $order_delivery_country['id'], $order->delivery['zone_id']);
     }
     if (olc_not_null($this->icon)) {
         $this->quotes['icon'] = olc_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Exemplo n.º 3
0
function olc_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false, $AJAX_validation = false)
{
    $field = '<select name="' . $name . '" id="' . $name . QUOTE;
    if ($AJAX_validation) {
        $field .= '" onchange="pull_down_menu_change(this);"';
    }
    //W. Kaiser - AJAX
    if (olc_not_null($parameters)) {
        $field .= BLANK . $parameters;
    }
    $field .= '>';
    if (empty($default) && isset($GLOBALS[$name])) {
        $default = $GLOBALS[$name];
    }
    $special = array(QUOTE => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;');
    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
        $id = $values[$i]['id'];
        $field .= '<option value="' . htmlentities(olc_parse_input_field_data($id, array(QUOTE => '&quot;'))) . QUOTE;
        if ($default == $id) {
            $field .= ' selected="selected"';
        }
        //$field .= '>' . htmlentities(olc_parse_input_field_data($values[$i]['text'],$special)) . '</option>';
        $field .= '>' . olc_parse_input_field_data($values[$i]['text'], $special) . '</option>';
    }
    $field .= '</select>';
    //W. Kaiser - AJAX
    if (USE_AJAX) {
        $field = "<span id=\"" . $name . "_select\">" . $field . "</span>";
    }
    //W. Kaiser - AJAX
    if ($required) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    return $field;
}
function olc_get_countries($countries_id = '', $with_iso_codes = false)
{
    $countries_id_text = 'countries_id';
    $countries_name_text = 'countries_name';
    $select = "select countries_name";
    $select_countries_id = $select . ", " . $countries_id_text;
    $from = " from " . TABLE_COUNTRIES;
    $countries_array = array();
    if (olc_not_null($countries_id)) {
        $where = $from . " where countries_id = '" . $countries_id . APOS;
        if ($with_iso_codes) {
            $countries_iso_code_text = 'countries_iso_code_';
            $countries_iso_code_2_text = $countries_iso_code_text . '2';
            $countries_iso_code_3_text = $countries_iso_code_text . '3';
            $countries = olc_db_query($select_countries_id . ", " . $countries_iso_code_2_text . $where);
            $countries_values = olc_db_fetch_array($countries);
            $countries_array = array($countries_name_text => $countries_values[$countries_name_text], $countries_iso_code_2_text => $countries_values[$countries_iso_code_2_text], $countries_iso_code_3_text => $countries_values[$countries_iso_code_3_text]);
        } else {
            $countries = olc_db_query($select . $where);
            $countries_values = olc_db_fetch_array($countries);
            $countries_array = array($countries_name_text => $countries_values[$countries_name_text]);
        }
    } else {
        $countries = olc_db_query($select_countries_id . $from . " order by " . $countries_name_text);
        while ($countries_values = olc_db_fetch_array($countries)) {
            $countries_array[] = array($countries_id_text => $countries_values[$countries_id_text], $countries_name_text => $countries_values[$countries_name_text]);
        }
    }
    return $countries_array;
}
 function quote($method = '')
 {
     // W. Kaiser - Show missing amount for free shipping
     $CurrentAmount = $_SESSION['cart']->show_total();
     //	W. Kaiser - Free shipping national/international
     require_once DIR_FS_INC . 'olc_get_free_shipping_amount.inc.php';
     olc_get_free_shipping_amount();
     if (FREE_AMOUNT > 0) {
         $MissingAmount = FREE_AMOUNT - $CurrentAmount;
         if ($MissingAmount > 0 && MODULE_SHIPPING_FREECOUNT_DISPLAY == FALSE_STRING_L) {
             return;
         }
         //	W. Kaiser - Free shipping national/international
         $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREECOUNT_TEXT_TITLE);
         if ($MissingAmount > 0) {
             $this->quotes['error'] = MODULE_SHIPPING_FREECOUNT_TEXT_WAY . HTML_B_START . olc_format_price($MissingAmount, 1, 1, 1) . '</b>)';
         } else {
             $this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREECOUNT_TEXT_WAY, 'cost' => 0));
             if (olc_not_null($this->icon)) {
                 $this->quotes['icon'] = olc_image($this->icon, $this->title);
             }
         }
     }
     return $this->quotes;
     //W. Kaiser - Show missing amount for free shippin
 }
function olc_display_banner($action, $identifier)
{
    if ($action == 'dynamic') {
        $banners_query = olc_db_query(SELECT_COUNT . " as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . APOS);
        $banners = olc_db_fetch_array($banners_query);
        if ($banners['count'] > 0) {
            $banner = olc_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . APOS);
        } else {
            return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</b>';
        }
    } elseif ($action == 'static') {
        if (is_array($identifier)) {
            $banner = $identifier;
        } else {
            $banner_query = olc_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . $identifier . APOS);
            if (olc_db_num_rows($banner_query)) {
                $banner = olc_db_fetch_array($banner_query);
            } else {
                return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> Banner with id \'' . $identifier . '\' not found, or status inactive</b>';
            }
        }
    } else {
        return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'' . HTML_B_END;
    }
    if (olc_not_null($banner['banners_html_text'])) {
        $banner_string = $banner['banners_html_text'];
    } else {
        $banner_string = HTML_A_START . olc_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . olc_image(DIR_WS_IMAGES . 'banner/' . $banner['banners_image'], $banner['banners_title']) . HTML_A_END;
    }
    olc_update_banner_display_count($banner['banners_id']);
    return $banner_string;
}
function olc_get_path($current_category_id = EMPTY_STRING)
{
    global $cPath_array;
    if (olc_not_null($current_category_id)) {
        $cp_size = sizeof($cPath_array);
        if ($cp_size == 0) {
            $cPath_new = $current_category_id;
        } else {
            $cPath_new = EMPTY_STRING;
            $sql0 = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '#'";
            $sql = str_replace(HASH, $cPath_array[$cp_size - 1], $sql0);
            $last_category_query = olc_db_query($sql);
            $last_category = olc_db_fetch_array($last_category_query);
            $sql = str_replace(HASH, $current_category_id, $sql0);
            $current_category_query = olc_db_query($sql);
            $current_category = olc_db_fetch_array($current_category_query);
            if ($last_category['parent_id'] == $current_category['parent_id']) {
                for ($i = 0, $n = $cp_size - 1; $i < $n; $i++) {
                    $cPath_new .= UNDERSCORE . $cPath_array[$i];
                }
            } else {
                for ($i = 0; $i < $cp_size; $i++) {
                    $cPath_new .= UNDERSCORE . $cPath_array[$i];
                }
            }
            $cPath_new .= UNDERSCORE . $current_category_id;
            if (substr($cPath_new, 0, 1) == UNDERSCORE) {
                $cPath_new = substr($cPath_new, 1);
            }
        }
    } else {
        $cPath_new = implode(UNDERSCORE, $cPath_array);
    }
    return 'cPath=' . $cPath_new;
}
function paypal_payment_status($order_id)
{
    include_once PAYPAL_IPN_DIR . 'inc.php';
    $paypal_payment_status_query = olc_db_query("select p.payment_status from " . TABLE_PAYPAL . " p left join " . TABLE_ORDERS . " o on p.paypal_id = o.payment_id where o.orders_id ='" . (int) $order_id . APOS);
    $paypal_payment_status = olc_db_fetch_array($paypal_payment_status_query);
    //quick work around for unkown order status id
    return $paypal_payment_status_value = olc_not_null($paypal_payment_status['payment_status']) ? $paypal_payment_status['payment_status'] : '';
}
function olc_validate_password($plain, $encrypted)
{
    if (olc_not_null($plain) && olc_not_null($encrypted)) {
        // split apart the hash / salt
        return $encrypted == md5($plain);
    } else {
        return false;
    }
}
 function quote($method = '')
 {
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_VERSANDMAIL_TEXT_TITLE);
     $this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_VERSANDMAIL_TEXT_WAY, 'cost' => 0));
     if (olc_not_null($this->icon)) {
         $this->quotes['icon'] = olc_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Exemplo n.º 11
0
function olc_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true)
{
    $field = '<textarea name="' . olc_parse_input_field_data($name, array('"' => '&quot;')) . '" wrap="' . olc_parse_input_field_data($wrap, array('"' => '&quot;')) . '" cols="' . olc_parse_input_field_data($width, array('"' => '&quot;')) . '" rows="' . olc_parse_input_field_data($height, array('"' => '&quot;')) . '"';
    if (olc_not_null($parameters)) {
        $field .= BLANK . $parameters;
    }
    $field .= '>' . $text . '</textarea>';
    return $field;
}
function olc_hide_session_id()
{
    global $session_started;
    if ($session_started) {
        if (defined('SID')) {
            if (olc_not_null(SID)) {
                return olc_draw_hidden_field(olc_session_name(), olc_session_id());
            }
        }
    }
}
function olc_validate_password_enc($enc, $enc_org)
{
    if (olc_not_null($enc) && olc_not_null($enc_org)) {
        $stack = explode(':', $enc_org);
        if ($enc == $stack[0]) {
            return true;
        } else {
            return false;
        }
    }
    return false;
}
 function checkdnsrr($host, $type)
 {
     if (olc_not_null($host) && olc_not_null($type)) {
         @exec("nslookup -type={$type} {$host}", $output);
         while (list($k, $line) = each($output)) {
             if (eregi("^{$host}", $line)) {
                 return true;
             }
         }
     }
     return false;
 }
 function vat_validation($vat_id = '', $customers_id = '', $customers_status = '', $country_id = '', $guest = false)
 {
     $this->vat_info = array();
     $this->live_check = ACCOUNT_COMPANY_VAT_LIVE_CHECK;
     if (olc_not_null($vat_id)) {
         $this->getInfo($vat_id, $customers_id, $customers_status, $country_id, $guest);
     } else {
         if ($guest) {
             $this->vat_info = array('status' => DEFAULT_CUSTOMERS_STATUS_ID_GUEST);
         } else {
             $this->vat_info = array('status' => DEFAULT_CUSTOMERS_STATUS_ID);
         }
     }
 }
 function quote($method = '')
 {
     if ($_SESSION['cart']->show_total() < MODULE_SHIPPING_FREECOUNTAUSL_AMOUNT && MODULE_SHIPPING_FREECOUNTAUSL_DISPLAY == FALSE_STRING_L) {
         return;
     }
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREECOUNTAUSL_TEXT_TITLE);
     if ($_SESSION['cart']->show_total() < MODULE_SHIPPING_FREECOUNTAUSL_AMOUNT) {
         $this->quotes['error'] = MODULE_SHIPPING_FREECOUNTAUSL_TEXT_WAY;
     } else {
         $this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREECOUNTAUSL_TEXT_WAY, 'cost' => 0));
     }
     if (olc_not_null($this->icon)) {
         $this->quotes['icon'] = olc_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Exemplo n.º 17
0
function olc_expire_banners()
{
    $banners_query = olc_db_query("select b.banners_id, b.expires_date, b.expires_impressions, sum(bh.banners_shown) as banners_shown from " . TABLE_BANNERS . " b, " . TABLE_BANNERS_HISTORY . " bh where b.status = '1' and b.banners_id = bh.banners_id group by b.banners_id");
    if (olc_db_num_rows($banners_query)) {
        while ($banners = olc_db_fetch_array($banners_query)) {
            if (olc_not_null($banners['expires_date'])) {
                if (date('Y-m-d H:i:s') >= $banners['expires_date']) {
                    olc_set_banner_status($banners['banners_id'], '0');
                }
            } elseif (olc_not_null($banners['expires_impressions'])) {
                if ($banners['banners_shown'] >= $banners['expires_impressions']) {
                    olc_set_banner_status($banners['banners_id'], '0');
                }
            }
        }
    }
}
Exemplo n.º 18
0
function olc_draw_hidden_field($name, $value = '', $parameters = '')
{
    $name = olc_parse_input_field_data($name, array('"' => '&quot;'));
    $field = '<input type="hidden" name="' . $name;
    if (strpos($parameters, 'id=') === false) {
        $field .= '" id="' . $name;
    }
    $field .= '" value="';
    if (!$value) {
        $value = $GLOBALS[$name];
    }
    $field .= olc_parse_input_field_data($value, array('"' => '&quot;')) . '"';
    if (olc_not_null($parameters)) {
        $field .= BLANK . $parameters;
    }
    $field .= '/>';
    return $field;
}
 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     if (olc_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 = olc_draw_form('pages', CURRENT_SCRIPT, '', 'get');
         if ($current_page_number > 1) {
             $display_links .= HTML_A_START . olc_href_link(CURRENT_SCRIPT, $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, olc_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="' . olc_href_link(CURRENT_SCRIPT, $parameters . $page_name . '=' . ($current_page_number + 1), NONSSL) . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . HTML_A_END;
         } 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 .= olc_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         if (SID) {
             $display_links .= olc_draw_hidden_field(session_name(), session_id());
         }
         $display_links .= '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
Exemplo n.º 20
0
 function quote($method = '')
 {
     global $order, $total_count;
     if (!$order) {
         $order = new order();
     }
     if (!$shipping_weight) {
         $shipping_weight = $_SESSION['cart']->show_weight();
     }
     $order_delivery_country = $order->delivery['country'];
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_ITEM_TEXT_WAY, 'cost' => MODULE_SHIPPING_ITEM_COST * $total_count + MODULE_SHIPPING_ITEM_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = olc_get_tax_rate($this->tax_class, $order_delivery_country['id'], $order->delivery['zone_id']);
     }
     if (olc_not_null($this->icon)) {
         $this->quotes['icon'] = olc_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
function olc_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true, $AJAX_validate = false, $AJAX_required = false, $AJAX_caption = "", $AJAX_add_span = false)
{
    $field = '<input type="' . olc_parse_input_field_data($type, array(QUOTE => '&quot;')) . '" name="' . olc_parse_input_field_data($name, array(QUOTE => '&quot;')) . QUOTE;
    /*
    if (false && (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
    	$value=$GLOBALS[$name];
    	//$field .= ' class="text" value="' . olc_parse_input_field_data($GLOBALS[$name], array(QUOTE => '&quot;')) . QUOTE;
    } elseif (olc_not_null($value)) {
    	//$field .= ' class="text" value="' . olc_parse_input_field_data($value, array(QUOTE => '&quot;')) . QUOTE;
    }
    */
    $field .= ' class="text" value="' . olc_parse_input_field_data($value, array(QUOTE => '&quot;')) . QUOTE;
    //W. Kaiser - AJAX
    if (AJAX_VALIDATE) {
        if (strpos($parameters, " id=") === false) {
            $parameters .= " id=\"" . $name . "\"";
        }
        if ($AJAX_validate) {
            $parameters .= " onchange=\"set_validation_required(this);AJAX_validate_element('" . $AJAX_caption . "','" . $name . "'," . $AJAX_required . ")\"";
            //$parameters .= " onkeydown=\"on_key_press();\"";
            //$parameters .= " onchange=\"set_validation_required(this);\"";
            $parameters .= " onfocus=\"clear_validation_required();\"";
        }
    }
    //W. Kaiser - AJAX
    if (olc_not_null($parameters)) {
        $field .= BLANK . $parameters;
    }
    $field .= '/>';
    //W. Kaiser - AJAX
    if (USE_AJAX) {
        if ($AJAX_validate) {
            if ($AJAX_add_span) {
                //If more then 1 valid answer is validated, offer selectionbox for selection of value
                //Allocate span for potential SELECT-box
                $field .= '<span id="' . $name . '_select"></span>';
            }
        }
    }
    //W. Kaiser - AJAX
    return $field;
}
Exemplo n.º 22
0
function olc_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '')
{
    $name = $name = '"' . olc_parse_input_field_data($name, array(QUOTE => '&quot;')) . '"';
    $selection = '<input type="' . olc_parse_input_field_data($type, array(QUOTE => '&quot;')) . '" name=' . $name;
    $id_text = "id=";
    if (strpos($parameters, $id_text) === false) {
        $selection .= BLANK . $id_text . $name;
    }
    if (olc_not_null($value)) {
        $selection .= ' value="' . olc_parse_input_field_data($value, array(QUOTE => '&quot;')) . '"';
    }
    if ($checked == true || $GLOBALS[$name] == 'on' || $value && $GLOBALS[$name] == $value) {
        $selection .= ' checked="checked"';
    }
    if (olc_not_null($parameters)) {
        $selection .= BLANK . $parameters;
    }
    $selection .= '/>';
    return $selection;
}
Exemplo n.º 23
0
 function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '')
 {
     if (empty($currency_type)) {
         $currency_type = SESSION_CURRENCY;
     }
     $currency = $this->currencies[$currency_type];
     if ($calculate_currency_value == true) {
         $rate = olc_not_null($currency_value) ? $currency_value : $currency['value'];
         $format_string = $currency[$this->symbol_left_text] . BLANK . number_format(olc_round($number * $rate, $currency[$this->decimal_places_text]), $currency[$this->decimal_places_text], $currency[$this->decimal_point_text], $currency[$this->thousands_point_text]) . BLANK . $currency[$this->symbol_right_text];
         // if the selected currency is in the european euro-conversion and the default currency is euro,
         // the currency will displayed in the national currency and euro currency
         if (DEFAULT_CURRENCY == 'EUR') {
             if (strpos('.DEM.BEF.LUF.ESP.FRF.IEP.ITL.NLG.ATS.PTE.FIM.GRD', $currency_type) > 0) {
                 $format_string .= ' <small>[' . $this->format($number, true, 'EUR') . ']</small>';
             }
         }
     } else {
         $format_string = $currency[$this->symbol_left_text] . BLANK . number_format(olc_round($number, $currency[$this->decimal_places_text]), $currency[$this->decimal_places_text], $currency[$this->decimal_point_text], $currency[$this->thousands_point_text]) . BLANK . $currency[$this->symbol_right_text];
     }
     $format_string = str_replace($currency[$this->decimal_zeroes_text], $currency[$this->decimal_zeroes_dashes_text], $format_string);
     return trim($format_string);
 }
            $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . olc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $_GET['abID']) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
            break;
        default:
            if (is_object($abInfo)) {
                $sql = "select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $abInfo->affiliate_products_id . "' and language_id = '" . SESSION_LANGUAGE_ID . APOS;
                $product_description_query = olc_db_query($sql);
                $product_description = olc_db_fetch_array($product_description_query);
                $heading[] = array('text' => HTML_B_START . $abInfo->affiliate_banners_title . HTML_B_END);
                $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=new') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=delete') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END);
                $contents[] = array('text' => $product_description['products_name']);
                $contents[] = array('text' => HTML_BR . TEXT_BANNERS_DATE_ADDED . BLANK . olc_date_short($abInfo->affiliate_date_added));
                $contents[] = array('text' => '' . sprintf(TEXT_BANNERS_STATUS_CHANGE, olc_date_short($abInfo->affiliate_date_status_change)));
            }
            break;
    }
    if (olc_not_null($heading) && olc_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . NEW_LINE;
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . NEW_LINE;
    }
    ?>
	</tr>
	</table></td>
	</tr>
	<?php 
}
?>
</table></td>

<?php 
			'products_options_values' => $attributes_values['products_options_values_name'],
			'options_values_price' => $attributes_values['options_values_price'],
			'price_prefix' => $attributes_values['price_prefix']);
			olc_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
		}
	}
}
if(is_callable(array($order_total_modules, 'apply_credit')))
$order_total_modules->apply_credit();
*/
// store the session info for notification update - gsb
$sql_data_array = array('sendto' => $sendto, 'billto' => $billto, 'firstname' => $order->billing['firstname'], 'lastname' => $order->billing['lastname'], 'payment' => $payment, 'payment_title' => $this->codeTitle, 'payment_amount' => $this->grossPaymentAmount($this->currency()), 'payment_currency' => $this->currency(), 'payment_currency_val' => $currencies->get_value($this->currency()), 'language' => SESSION_LANGUAGE, 'language_id' => SESSION_LANGUAGE_ID, 'currency' => $currency, 'currency_value' => $currencies->get_value($currency), 'content_type' => $order->content_type, 'txn_signature' => $this->setTransactionID());
if (SHOW_AFFILIATE) {
    // inclusion for affiliate program
    global $affiliate_ref, $affiliate_clickthroughs_id, $affiliate_clientdate, $affiliate_clientbrowser, $affiliate_clientip;
    if (olc_not_null($affiliate_ref)) {
        if (olc_session_is_registered('affiliate_ref')) {
            $sql_data_array['affiliate_id'] = $affiliate_ref;
            $sql_data_array['affiliate_clickthroughs_id'] = $affiliate_clickthroughs_id;
            $sql_data_array['affiliate_date'] = $affiliate_clientdate;
            $sql_data_array['affiliate_browser'] = $affiliate_clientbrowser;
            $sql_data_array['affiliate_ipaddress'] = $affiliate_clientip;
        }
    }
}
if ($session_exists) {
    olc_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array, 'update', $orders_id_param);
    $PayPal_osC->txn_signature = $this->digest;
} else {
    $sql_data_array['orders_id'] = $orders_id;
    olc_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array);
Exemplo n.º 26
0
 function build_message($params = '')
 {
     if ($params == '') {
         $params = array();
     }
     if (count($params) > 0) {
         reset($params);
         while (list($key, $value) = each($params)) {
             $this->build_params[$key] = $value;
         }
     }
     if (olc_not_null($this->html_images)) {
         reset($this->html_images);
         while (list(, $value) = each($this->html_images)) {
             $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html);
         }
     }
     $null = NULL;
     $attachments = olc_not_null($this->attachments) ? true : false;
     $html_images = olc_not_null($this->html_images) ? true : false;
     $html = olc_not_null($this->html) ? true : false;
     $text = olc_not_null($this->text) ? true : false;
     switch (true) {
         case $text == true && $attachments == false:
             /* HPDL PHP3 */
             //          $message =& $this->add_text_part($null, $this->text);
             $message = $this->add_text_part($null, $this->text);
             break;
         case $text == false && $attachments == true && $html == false:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
             for ($i = 0; $i < count($this->attachments); $i++) {
                 $this->add_attachment_part($message, $this->attachments[$i]);
             }
             break;
         case $text == true && $attachments == true:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
             $this->add_text_part($message, $this->text);
             for ($i = 0; $i < count($this->attachments); $i++) {
                 $this->add_attachment_part($message, $this->attachments[$i]);
             }
             break;
         case $html == true && $attachments == false && $html_images == false:
             if (olc_not_null($this->html_text)) {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_alternative_part($null);
                 $message = $this->add_alternative_part($null);
                 $this->add_text_part($message, $this->html_text);
                 $this->add_html_part($message);
             } else {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_html_part($null);
                 $message = $this->add_html_part($null);
             }
             break;
         case $html == true && $attachments == false && $html_images == true:
             if (olc_not_null($this->html_text)) {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_alternative_part($null);
                 $message = $this->add_alternative_part($null);
                 $this->add_text_part($message, $this->html_text);
                 /* HPDL PHP3 */
                 //            $related =& $this->add_related_part($message);
                 $related = $this->add_related_part($message);
             } else {
                 /* HPDL PHP3 */
                 //            $message =& $this->add_related_part($null);
                 //            $related =& $message;
                 $message = $this->add_related_part($null);
                 $related = $message;
             }
             $this->add_html_part($related);
             for ($i = 0; $i < count($this->html_images); $i++) {
                 $this->add_html_image_part($related, $this->html_images[$i]);
             }
             break;
         case $html == true && $attachments == true && $html_images == false:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
             if (olc_not_null($this->html_text)) {
                 /* HPDL PHP3 */
                 //            $alt =& $this->add_alternative_part($message);
                 $alt = $this->add_alternative_part($message);
                 $this->add_text_part($alt, $this->html_text);
                 $this->add_html_part($alt);
             } else {
                 $this->add_html_part($message);
             }
             for ($i = 0; $i < count($this->attachments); $i++) {
                 $this->add_attachment_part($message, $this->attachments[$i]);
             }
             break;
         case $html == true && $attachments == true && $html_images == true:
             /* HPDL PHP3 */
             //          $message =& $this->add_mixed_part();
             $message = $this->add_mixed_part();
             if (olc_not_null($this->html_text)) {
                 /* HPDL PHP3 */
                 //            $alt =& $this->add_alternative_part($message);
                 $alt = $this->add_alternative_part($message);
                 $this->add_text_part($alt, $this->html_text);
                 /* HPDL PHP3 */
                 //            $rel =& $this->add_related_part($alt);
                 $rel = $this->add_related_part($alt);
             } else {
                 /* HPDL PHP3 */
                 //            $rel =& $this->add_related_part($message);
                 $rel = $this->add_related_part($message);
             }
             $this->add_html_part($rel);
             for ($i = 0; $i < count($this->html_images); $i++) {
                 $this->add_html_image_part($rel, $this->html_images[$i]);
             }
             for ($i = 0; $i < count($this->attachments); $i++) {
                 $this->add_attachment_part($message, $this->attachments[$i]);
             }
             break;
     }
     if (isset($message) && is_object($message)) {
         $output = $message->encode();
         $this->output = $output['body'];
         reset($output['headers']);
         while (list($key, $value) = each($output['headers'])) {
             $headers[] = $key . ': ' . $value;
         }
         $this->headers = array_merge($this->headers, $headers);
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 27
0
 function quote($method = '')
 {
     global $order, $shipping_weight, $shipping_num_boxes;
     if (!$order) {
         $order = new order();
     }
     if (!$shipping_weight) {
         $shipping_weight = $_SESSION['cart']->show_weight();
     }
     $order_delivery_country = $order->delivery['country'];
     $dest_country = $order_delivery_country['iso_code_2'];
     $dest_zone = 0;
     $error = false;
     for ($j = 1; $j <= $this->num_chp; $j++) {
         $countries_table = constant('MODULE_SHIPPING_CHP_COUNTRIES_' . $j);
         $country_zones = split("[,]", $countries_table);
         if (in_array($dest_country, $country_zones)) {
             $dest_zone = $j;
             break;
         }
     }
     if ($dest_zone == 0) {
         $error = true;
     } else {
         $shipping = -1;
         $chp_cost_eco = @constant('MODULE_SHIPPING_CHP_COST_ECO_' . $j);
         $chp_cost_pri = @constant('MODULE_SHIPPING_CHP_COST_PRI_' . $j);
         $chp_cost_urg = @constant('MODULE_SHIPPING_CHP_COST_URG_' . $j);
         $methods = array();
         if ($chp_cost_eco != '') {
             $chp_table_eco = split("[:,]", $chp_cost_eco);
             for ($i = 0; $i < sizeof($chp_table_eco); $i += 2) {
                 if ($shipping_weight <= $chp_table_eco[$i]) {
                     $shipping_eco = $chp_table_eco[$i + 1];
                     break;
                 }
             }
             if ($shipping_eco == -1) {
                 $shipping_cost = 0;
                 $shipping_method = MODULE_SHIPPING_CHP_UNDEFINED_RATE;
             } else {
                 $shipping_cost_1 = $shipping_eco + MODULE_SHIPPING_CHP_HANDLING;
             }
             if ($shipping_eco != 0) {
                 $methods[] = array('id' => 'ECO', 'title' => 'Economy', 'cost' => (MODULE_SHIPPING_CHP_HANDLING + $shipping_cost_1) * $shipping_num_boxes);
             }
         }
         if ($chp_cost_pri != '') {
             $chp_table_pri = split("[:,]", $chp_cost_pri);
             for ($i = 0; $i < sizeof($chp_table_pri); $i += 2) {
                 if ($shipping_weight <= $chp_table_pri[$i]) {
                     $shipping_pri = $chp_table_pri[$i + 1];
                     break;
                 }
             }
             if ($shipping_pri == -1) {
                 $shipping_cost = 0;
                 $shipping_method = MODULE_SHIPPING_CHP_UNDEFINED_RATE;
             } else {
                 $shipping_cost_2 = $shipping_pri + MODULE_SHIPPING_CHP_HANDLING;
             }
             if ($shipping_pri != 0) {
                 $methods[] = array('id' => 'PRI', 'title' => 'Priority', 'cost' => (MODULE_SHIPPING_CHP_HANDLING + $shipping_cost_2) * $shipping_num_boxes);
             }
         }
         if ($chp_cost_urg != '') {
             $chp_table_urg = split("[:,]", $chp_cost_urg);
             for ($i = 0; $i < sizeof($chp_table_urg); $i += 2) {
                 if ($shipping_weight <= $chp_table_urg[$i]) {
                     $shipping_urg = $chp_table_urg[$i + 1];
                     break;
                 }
             }
             if ($shipping_urg == -1) {
                 $shipping_cost = 0;
                 $shipping_method = MODULE_SHIPPING_CHP_UNDEFINED_RATE;
             } else {
                 $shipping_cost_3 = $shipping_urg + MODULE_SHIPPING_CHP_HANDLING;
             }
             if ($shipping_urg != 0) {
                 $methods[] = array('id' => 'URG', 'title' => 'Urgent', 'cost' => (MODULE_SHIPPING_CHP_HANDLING + $shipping_cost_3) * $shipping_num_boxes);
             }
         }
     }
     $this->quotes = array('id' => $this->code, 'module' => $this->title . LPAREN . $shipping_num_boxes . ' x ' . number_format($shipping_weight, CURRENCY_DECIMAL_PLACES, CURRENCY_DECIMAL_POINT, CURRENCY_THOUSANDS_POINT) . BLANK . MODULE_SHIPPING_CHP_TEXT_UNITS . RPAREN);
     $this->quotes['methods'] = $methods;
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = olc_get_tax_rate($this->tax_class, $order_delivery_country['id'], $order->delivery['zone_id']);
     }
     if (olc_not_null($this->icon)) {
         $this->quotes['icon'] = olc_image($this->icon, $this->title);
     }
     if ($error == true) {
         $this->quotes['error'] = MODULE_SHIPPING_CHP_INVALID_ZONE;
     }
     if (olc_not_null($method) && isset($this->types[$method])) {
         for ($i = 0; $i < sizeof($methods); $i++) {
             if ($method == $methods[$i]['id']) {
                 $methodsc = array();
                 $methodsc[] = array('id' => $methods[$i]['id'], 'title' => $methods[$i]['title'], 'cost' => $methods[$i]['cost']);
                 break;
             }
         }
         $this->quotes['methods'] = $methodsc;
     }
     return $this->quotes;
 }
    if (EMAIL_USE_HTML == TRUE_STRING_S) {
        $mimemessage->add_html($message);
    } else {
        $mimemessage->add_text($message);
    }
    // Send message
    $mimemessage->build_message();
    while ($mail = olc_db_fetch_array($mail_query)) {
        $mimemessage->send($mail['affiliate_firstname'] . BLANK . $mail['affiliate_lastname'], $mail['affiliate_email_address'], '', $from, $subject);
    }
    olc_redirect(olc_href_link(FILENAME_AFFILIATE_CONTACT, 'mail_sent_to=' . urlencode($mail_sent_to)));
}
if ($_GET['action'] == 'preview' && !$_POST['affiliate_email_address']) {
    $messageStack->add(ERROR_NO_AFFILIATE_SELECTED, 'error');
}
if (olc_not_null($_GET['mail_sent_to'])) {
    $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $_GET['mail_sent_to']), 'notice');
}
require DIR_WS_INCLUDES . 'header.php';
?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td class="columnLeft2" nowrap="nowrap" valign="top"><table border="0" cellspacing="1" cellpadding="1" class="columnLeft" nowrap="nowrap">
<!-- left_navigation //-->
<?php 
require DIR_WS_INCLUDES . 'column_left.php';
?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
 }
 if ($dto_to_check) {
     if ($dto_to_check != DOB_FORMAT_STRING) {
         $where_str .= $sql_and . "<= '" . olc_date_raw($dto_to_check) . APOS;
     }
 }
 $sql_and = " and (if (s.status, s.specials_new_products_price, p.products_price) ";
 if ($pfrom_to_check != EMPTY_STRING) {
     $where_str .= $sql_and . ">= " . $pfrom_to_check / CURRENCY_VALUE . RPAREN;
 }
 if ($pto_to_check != EMPTY_STRING) {
     $where_str .= $sql_and . "<= " . $pto_to_check / CURRENCY_VALUE . RPAREN;
 }
 $order_str = ' group by pd.products_name order by pd.products_name';
 $products_listing_sql_main = $select_str . $from_str . $where_str . $order_str;
 if (defined("MODULE_TAG_CLOUD_STATUS") && MODULE_TAG_CLOUD_STATUS == TRUE_STRING_L && !olc_not_null($_GET['categories_id']) && !olc_not_null($_GET['manufacturers_id']) && !strlen($_GET['pfrom']) && !strlen($_GET['pto']) && ($cloudTag = $keywords) != EMPTY_STRING) {
     $s = 'tag_cloud_tags';
     if (!isset($_SESSION[$s])) {
         $_SESSION[$s] = array();
     }
     $cloudTag = substr($cloudTag, 0, 64);
     if (!in_array($cloudTag, $_SESSION[$s])) {
         $_SESSION[$s][] = $cloudTag;
         $cloudTag = addslashes($cloudTag);
         $cloudLang = SESSION_LANGUAGE_ID;
         $tagTest = olc_db_fetch_array(olc_db_query(SELECT_COUNT . "AS count " . "FROM \n\t\t\t\tmodule_tag_cloud " . "WHERE \n\t\t\t\ttag = '" . $cloudTag . "' AND language_id = " . $cloudLang));
         $prodTest = olc_db_num_rows(olc_db_query("SELECT 1 " . $from_str . $where_str . " LIMIT 1"));
         if ($prodTest) {
             if (!isset($_GET["searchTagCloud"])) {
                 if ($tagTest["count"]) {
                     olc_db_query("UPDATE module_tag_cloud " . "SET searches = searches + 1, not_found = 0 " . "WHERE tag = '" . $cloudTag . "' AND language_id = " . $cloudLang);
Exemplo n.º 30
0
 function tableBox($contents, $direct_output = false)
 {
     if (IS_AJAX_PROCESSING) {
         for ($i = 0, $n = sizeof($contents); $i < $n; $i++) {
             $content = $contents[$i];
             if (is_array($content[0])) {
                 for ($x = 0, $n2 = sizeof($content); $x < $n2; $x++) {
                     $text = $content[$x]['text'];
                     if ($text) {
                         if ($tableBox_string != EMPTY_STRING) {
                             $tableBox_string .= $text . "\n\n";
                         }
                         if ($text) {
                             $tableBox_string .= $text;
                         }
                     }
                 }
             } else {
                 $text = $content['text'];
                 if ($text) {
                     $tableBox_string .= $text;
                 }
             }
         }
     } else {
         $tableBox_string = '<table border="' . $this->table_border . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"';
         if (olc_not_null($this->table_parameters)) {
             $tableBox_string .= BLANK . $this->table_parameters;
         }
         $tableBox_string .= '>' . NEW_LINE;
         for ($i = 0, $n = sizeof($contents); $i < $n; $i++) {
             $content = $contents[$i];
             $content_is_array = is_array($content[0]);
             if ($content_is_array) {
                 $content_form = $content['form'];
                 $is_form = olc_not_null($content_form);
                 if ($is_form) {
                     $tableBox_string .= $content_form . NEW_LINE;
                 }
             }
             $tableBox_string .= '  <tr';
             if (olc_not_null($this->table_row_parameters)) {
                 $tableBox_string .= BLANK . $this->table_row_parameters;
             }
             $tableBox_string .= '>' . NEW_LINE;
             if ($content_is_array) {
                 for ($x = 0, $n2 = sizeof($content); $x < $n2; $x++) {
                     $content_x = $content[$x];
                     if (isset($content_x['text']) && olc_not_null($content_x['text'])) {
                         $tableBox_string .= '    <td';
                         if (isset($content_x['align']) && olc_not_null($content_x['align'])) {
                             $tableBox_string .= ' align="' . $content_x['align'] . '"';
                         }
                         if (isset($content_x['params']) && olc_not_null($content_x['params'])) {
                             $tableBox_string .= BLANK . $content_x['params'];
                         } elseif (olc_not_null($this->table_data_parameters)) {
                             $tableBox_string .= BLANK . $this->table_data_parameters;
                         }
                         $tableBox_string .= '>';
                         if (isset($content_x['form']) && olc_not_null($content_x['form'])) {
                             $tableBox_string .= $content_x['form'];
                         }
                         $tableBox_string .= $content_x['text'];
                         if (isset($content_x['form']) && olc_not_null($content_x['form'])) {
                             $tableBox_string .= '</form>';
                         }
                         $tableBox_string .= '</td>' . NEW_LINE;
                     }
                 }
             } else {
                 $tableBox_string .= '    <td';
                 /*
                 if (isset($content['align']) && olc_not_null($content['align']))
                 $tableBox_string .= ' align="' . $content['align'] . '"';
                 if (isset($content['params']) && olc_not_null($content['params'])) {
                 	$tableBox_string .= BLANK . $content['params'];
                 } elseif (olc_not_null($this->table_data_parameters)) {
                 	$tableBox_string .= BLANK . $this->table_data_parameters;
                 }
                 $tableBox_string .= '>' . $content['text'] . '</td>' . NEW_LINE;
                 */
                 $tableBox_string .= '>' . $content . '</td>' . NEW_LINE;
             }
             $tableBox_string .= '  </tr>' . NEW_LINE;
             if ($is_form) {
                 $tableBox_string .= '</form>' . NEW_LINE;
             }
         }
         $tableBox_string .= '</table>' . NEW_LINE;
         if ($direct_output == true) {
             echo $tableBox_string;
         }
     }
     return $tableBox_string;
 }