function getOutput()
 {
     $cache_file = DIR_FS_CACHE . 'oscommerce_version_check.cache';
     $current_version = tep_get_version();
     $new_version = false;
     if (file_exists($cache_file)) {
         $date_last_checked = tep_datetime_short(date('Y-m-d H:i:s', filemtime($cache_file)));
         $releases = unserialize(implode('', file($cache_file)));
         foreach ($releases as $version) {
             $version_array = explode('|', $version);
             if (version_compare($current_version, $version_array[0], '<')) {
                 $new_version = true;
                 break;
             }
         }
     } else {
         $date_last_checked = MODULE_ADMIN_DASHBOARD_VERSION_CHECK_NEVER;
     }
     $output = '<table border="0" width="100%" cellspacing="0" cellpadding="4">' . '  <tr class="dataTableHeadingRow">' . '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_TITLE . '</td>' . '    <td class="dataTableHeadingContent" align="right">' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_DATE . '</td>' . '  </tr>';
     if ($new_version == true) {
         $output .= '  <tr>' . '    <td class="messageStackWarning" colspan="2">' . tep_image('images/icons/warning.gif', ICON_WARNING) . '&nbsp;<strong>' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_UPDATE_AVAILABLE . '</strong></td>' . '  </tr>';
     }
     $output .= '  <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '    <td class="dataTableContent"><a href="' . tep_href_link('version_check.php') . '">' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_CHECK_NOW . '</a></td>' . '    <td class="dataTableContent" align="right">' . $date_last_checked . '</td>' . '  </tr>' . '</table>';
     return $output;
 }
    function getOutput()
    {
        global $lng;
        if (!isset($lng) || isset($lng) && !is_object($lng)) {
            include DIR_WS_CLASSES . 'language.php';
            $lng = new language();
        }
        foreach ($lng->catalog_languages as $lkey => $lvalue) {
            if ($lvalue['id'] == $_SESSION['languages_id']) {
                $language_code = $lkey;
                break;
            }
        }
        $output = '<div class="g-plusone" data-href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id'], 'NONSSL', false) . '" data-size="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SIZE) . '" data-annotation="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION) . '"';
        if (MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION == 'Inline') {
            $output .= ' data-width="' . (int) MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_WIDTH . '" data-align="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ALIGN) . '"';
        }
        $output .= '></div>';
        $output .= '<script type="text/javascript">
  if ( typeof window.___gcfg == "undefined" ) {
    window.___gcfg = { };
  }

  if ( typeof window.___gcfg.lang == "undefined" ) {
    window.___gcfg.lang = "' . tep_output_string_protected($language_code) . '";
  }

  (function() {
    var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
    po.src = \'https://apis.google.com/js/plusone.js\';
    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>';
        return $output;
    }
示例#3
0
  function tep_session_start() {
    global $_GET, $_POST, $HTTP_COOKIE_VARS;

    $sane_session_id = true;

    if (isset($_GET[tep_session_name()])) {
      if (preg_match('/^[a-zA-Z0-9]+$/', $_GET[tep_session_name()]) == false) {
        unset($_GET[tep_session_name()]);

        $sane_session_id = false;
      }
    } elseif (isset($_POST[tep_session_name()])) {
      if (preg_match('/^[a-zA-Z0-9]+$/', $_POST[tep_session_name()]) == false) {
        unset($_POST[tep_session_name()]);

        $sane_session_id = false;
      }
    } elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {
      if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {
        $session_data = session_get_cookie_params();

        setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);

        $sane_session_id = false;
      }
    }

    if ($sane_session_id == false) {
      tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
    }

    return session_start();
  }
示例#4
0
 function execute()
 {
     global $HTTP_GET_VARS, $current_category_id, $languages_id, $oscTemplate;
     if (isset($current_category_id) && $current_category_id > 0) {
         $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int) $current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
     } else {
         $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
     }
     if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
         $bestsellers_list = '<ol style="margin: 0; padding-left: 25px;">';
         while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
             $bestsellers_list .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></li>';
         }
         $bestsellers_list .= '</ol>';
         if ($this->group == 'boxes_footer') {
             $data = '<div class="col-sm-3 col-lg-2">' . '  <div class="footerbox best-sellers">' . '    <h2>' . MODULE_BOXES_BEST_SELLERS_BOX_TITLE . '</h2>';
         } else {
             $data = '<div class="panel panel-default">' . '  <div class="panel-heading">' . MODULE_BOXES_BEST_SELLERS_BOX_TITLE . '</div>';
         }
         $data .= '  <div class="panel-body">' . $bestsellers_list . '</div>';
         $data .= '</div>';
         if ($this->group == 'boxes_footer') {
             $data .= '</div>';
         }
         $oscTemplate->addBlock($data, $this->group);
     }
 }
示例#5
0
function tep_display_banner($action, $identifier)
{
    if ($action == 'dynamic') {
        $banners_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
        $banners = tep_db_fetch_array($banners_query);
        if ($banners['count'] > 0) {
            $banner = tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
        } else {
            return '<strong>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</strong>';
        }
    } elseif ($action == 'static') {
        if (is_array($identifier)) {
            $banner = $identifier;
        } else {
            $banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int) $identifier . "'");
            if (tep_db_num_rows($banner_query)) {
                $banner = tep_db_fetch_array($banner_query);
            } else {
                return '<strong>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</strong>';
            }
        }
    } else {
        return '<strong>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</strong>';
    }
    if (tep_not_null($banner['banners_html_text'])) {
        $banner_string = $banner['banners_html_text'];
    } else {
        $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
    }
    tep_update_banner_display_count($banner['banners_id']);
    return $banner_string;
}
示例#6
0
function get_response_handler_url()
{
    $dummy = 'a';
    $admin_folder = tep_href_link($dummy);
    $catalog_folder = substr($admin_folder, 0, strlen($admin_folder) - strlen('admin/' . $dummy));
    return $catalog_folder . 'googlecheckout/responsehandler.php';
}
 function get_search_collections()
 {
     extract(tep_load('defs', 'database', 'sessions'));
     $cAbstract = new abstract_zones();
     $classes_array = $cAbstract->get_classes();
     foreach ($classes_array as $key => $value) {
         $cObject = new $value();
     }
     $keywords = isset($_GET['search']) && !empty($_GET['search']) ? $db->prepare_input($_GET['search']) : '';
     $text_query_raw = "select gtext_id, gtext_title from " . TABLE_GTEXT . " where (gtext_title like '%" . $db->input($keywords) . "%' or gtext_alt_title like '%" . $db->input($keywords) . "%') order by gtext_title limit 10";
     $text_array = $db->query_to_array($text_query_raw);
     $j = count($text_array);
     if ($j) {
         echo '<div><table class="tabledata">' . "\n";
         for ($i = 0; $i < $j; $i++) {
             echo '<tr>' . "\n";
             echo '  <td><a href="' . tep_href_link(FILENAME_GENERIC_TEXT, 'gtID=' . $text_array[$i]['gtext_id'] . '&action=new_generic_text') . '">' . $text_array[$i]['gtext_title'] . '</a></td>' . "\n";
             echo '  <td><a href="' . tep_href_link($cDefs->script, 'cID=' . $text_array[$i]['abstract_zone_id'] . '&action=list') . '">' . $text_array[$i]['abstract_zone_name'] . '</a></td>' . "\n";
             echo '<tr>' . "\n";
         }
         echo '</table></div>' . "\n";
     } else {
         echo 'Nothing Found';
     }
     $cSessions->close();
     return true;
 }
 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);
         }
     }
 }
 function execute()
 {
     global $oscTemplate, $languages_id;
     $page_query = tep_db_query("select p.pages_id, p.sort_order, p.status, s.pages_title, s.pages_html_text, s.intorext, s.externallink, s.link_target from " . TABLE_PAGES . " p LEFT JOIN " . TABLE_PAGES_DESCRIPTION . " s on p.pages_id = s.pages_id where p.status = 1 and p.page_type != 1 and s.language_id = '" . (int) $languages_id . "' order by p.sort_order, s.pages_title");
     $rows = 0;
     $data = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_EXTRAINFOPAGE_BOX_TITLE . '</div>' . '  <div class="ui-widget-content infoBoxContents"><table border="0" width="100%" cellspacing="0" cellpadding="1">';
     while ($page = tep_db_fetch_array($page_query)) {
         $rows++;
         $target = "";
         if ($page['link_target'] == 1) {
             $target = "_blank";
         }
         if ($page['pages_title'] != 'Contact Us') {
             $link = FILENAME_PAGES . '?pages_id=' . $page['pages_id'];
         } else {
             $link = FILENAME_CONTACT_US;
         }
         if ($page['intorext'] == 1) {
             $data .= '<tr><td class="bg_list2"><a target="' . $target . '" href="' . $page['externallink'] . '">' . $page['pages_title'] . '</a></td></tr>';
         } else {
             $data .= '<tr><td class="bg_list2"><a target="' . $target . '" href="' . tep_href_link(FILENAME_PAGES, 'pages_id=' . $page['pages_id'], 'NONSSL') . '">' . $page['pages_title'] . '</a></td></tr>';
         }
     }
     $data .= '</table></div>' . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
示例#10
0
 function execute()
 {
     global $currencies, $oscTemplate;
     if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {
         $random_product['products_name'] = tep_get_products_name($random_product['products_id']);
         $random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);
         if (tep_not_null($random_product['specials_new_products_price'])) {
             $whats_new_price = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />';
             $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
         } else {
             $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
         }
         if ($this->group == 'boxes_footer') {
             $data = '<div class="col-sm-3 col-lg-2">' . '  <div class="footerbox best-sellers">' . '    <h2><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></h2>';
         } else {
             $data = '<div class="panel panel-default">' . '  <div class="panel-heading"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></div>';
         }
         $data .= '  <div class="panel-body text-center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />' . $whats_new_price . '</div>';
         $data .= '</div>';
         if ($this->group == 'boxes_footer') {
             $data .= '</div>';
         }
         $oscTemplate->addBlock($data, $this->group);
     }
 }
示例#11
0
 function pre_confirmation_check()
 {
     global $HTTP_POST_VARS;
     include DIR_WS_CLASSES . 'cc_validation.php';
     $cc_validation = new cc_validation();
     $result = $cc_validation->validate($HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year']);
     $error = '';
     switch ($result) {
         case -1:
             $error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
             break;
         case -2:
         case -3:
         case -4:
             $error = TEXT_CCVAL_ERROR_INVALID_DATE;
             break;
         case false:
             $error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
             break;
     }
     if ($result == false || $result < 1) {
         $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
     }
     $this->cc_card_type = $cc_validation->cc_type;
     $this->cc_card_number = $cc_validation->cc_number;
 }
示例#12
0
 function execute()
 {
     global $customer_id, $languages_id, $PHP_SELF, $oscTemplate;
     if (tep_session_is_registered('customer_id')) {
         // retreive the last x products purchased
         $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int) $customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
         if (tep_db_num_rows($orders_query)) {
             $product_ids = '';
             while ($orders = tep_db_fetch_array($orders_query)) {
                 $product_ids .= (int) $orders['products_id'] . ',';
             }
             $product_ids = substr($product_ids, 0, -1);
             $customer_orders_string = '<ul class="list-unstyled">';
             $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int) $languages_id . "' order by products_name");
             while ($products = tep_db_fetch_array($products_query)) {
                 $customer_orders_string .= '<li><span class="pull-right"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '"><span class="glyphicon glyphicon-shopping-cart"></span></a></span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></li>';
             }
             $customer_orders_string .= '</ul>';
             if ($this->group == 'boxes_footer') {
                 $data = '<div class="col-sm-3 col-lg-2">' . '  <div class="footerbox order-history">' . '    <h2>' . MODULE_BOXES_ORDER_HISTORY_BOX_TITLE . '</h2>';
             } else {
                 $data = '<div class="panel panel-default">' . '  <div class="panel-heading">' . MODULE_BOXES_ORDER_HISTORY_BOX_TITLE . '</div>';
             }
             $data .= '  <div class="panel-body">' . $customer_orders_string . '</div>';
             $data .= '</div>';
             if ($this->group == 'boxes_footer') {
                 $data .= '</div>';
             }
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
示例#13
0
 function pre_confirmation_check()
 {
     global $oscTemplate, $order;
     parent::pre_confirmation_check();
     $oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/BrandDetection.js"></script>', 'header_tags');
     $oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/cc.js"></script>', 'header_tags');
     $months_array = array();
     $months_array[1] = array('01', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JANUARY);
     $months_array[2] = array('02', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_FEBRUARY);
     $months_array[3] = array('03', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_MARCH);
     $months_array[4] = array('04', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_APRIL);
     $months_array[5] = array('05', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_MAY);
     $months_array[6] = array('06', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JUNE);
     $months_array[7] = array('07', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JULY);
     $months_array[8] = array('08', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_AUGUST);
     $months_array[9] = array('09', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_SEPTEMBER);
     $months_array[10] = array('10', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_OCTOBER);
     $months_array[11] = array('11', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_NOVEMBER);
     $months_array[12] = array('12', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_DECEMBER);
     $today = getdate();
     $years_array = array();
     for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
         $years_array[$i] = array(tep_output_string(strftime('%Y', mktime(0, 0, 0, 1, 1, $i))), tep_output_string_protected(strftime('%Y', mktime(0, 0, 0, 1, 1, $i))));
     }
     $this->fastCheckout->setFastCheckoutFlag($this->fastCheckoutFlag);
     $payment = $this->getPayment($_SESSION['customer_id']);
     $script = '<script type="text/javascript">' . 'var cclogging = "' . MODULE_PAYMENT_PAYMILL_CC_LOGGING . '";' . 'var cc_expiery_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_EXPIRY_INVALID . '";' . 'var cc_owner_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_OWNER_INVALID . '";' . 'var cc_card_number_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CARDNUMBER_INVALID . '";' . 'var cc_cvc_number_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CVC_INVALID . '";' . 'var brand = "' . $payment['card_type'] . '";' . 'var paymill_total = ' . json_encode($this->format_raw($order->info['total'])) . ';' . 'var paymill_currency = ' . json_encode(strtoupper($order->info['currency'])) . ';' . 'var paymill_cc_months = ' . json_encode($months_array) . ';' . 'var paymill_cc_years = ' . json_encode($years_array) . ';' . 'var paymill_cc_number_val = "' . $payment['last4'] . '";' . 'var paymill_cc_cvc_val = "' . $payment['cvc'] . '";' . 'var paymill_cc_card_type = "' . utf8_decode($payment['card_type']) . '";' . 'var paymill_cc_holder_val = "' . $payment['card_holder'] . '";' . 'var paymill_cc_expiry_month_val = "' . $payment['expire_month'] . '";' . 'var paymill_cc_expiry_year_val = "' . $payment['expire_year'] . '";' . 'var paymill_cc_fastcheckout = ' . ($this->fastCheckout->canCustomerFastCheckoutCc($_SESSION['customer_id']) ? 'true' : 'false') . ';' . 'var checkout_payment_link = "' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'step=step2', 'SSL', true, false) . '&payment_error=' . $this->code . '&error=";' . 'var logos =  new Array();' . "logos['amex'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_AMEX) . ";" . "logos['carta-si'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_CARTASI) . ";" . "logos['dankort'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DANKORT) . ";" . "logos['carte-bleue'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_CARTEBLEUE) . ";" . "logos['discover'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DISCOVER) . ";" . "logos['diners-club'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DINERSCLUB) . ";" . "logos['china-unionpay'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_UNIONPAY) . ";" . "logos['maestro'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_MAESTRO) . ";" . "logos['jcb'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_JCB) . ";" . "logos['mastercard'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_MASTERCARD) . ";" . "logos['visa'] =  " . strtolower(MODULE_PAYMENT_PAYMILL_CC_VISA) . ";" . "var allBrandsDisabled = !logos['amex'] && !logos['carta-si'] && !logos['dankort'] && !logos['carte-bleue'] && !logos['discover'] && !logos['diners-club'] && !logos['china-unionpay'] && !logos['maestro'] && !logos['jcb'] && !logos['mastercard'] && !logos['visa'];" . '</script>';
     $oscTemplate->addBlock($script, 'header_tags');
     $oscTemplate->addBlock('<form id="paymill_form" action="' . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') . '" method="post"></form>', 'footer_scripts');
 }
 function process_button()
 {
     global $order;
     $last_order_id = tep_db_query("select orders_id from " . TABLE_ORDERS . " order by orders_id desc limit 1");
     $result = tep_db_fetch_array($last_order_id);
     $this->orderID = $result['orders_id'] + 1;
     $acceptURL = tep_href_link(FILENAME_CHECKOUT_PROCESS, 'referer=mokejimai', 'SSL');
     $cancelURL = tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');
     $callbackURL = tep_href_link('mokejimai_validation.php', '', 'SSL', false, false, true);
     $acceptURL = str_replace('&amp;', '&', $acceptURL);
     $cancelURL = str_replace('&amp;', '&', $cancelURL);
     $callbackURL = str_replace('&amp;', '&', $callbackURL);
     try {
         $request = WebToPay::buildRequest(array('projectid' => $this->projectID, 'sign_password' => $this->projectPass, 'orderid' => $this->orderID, 'amount' => intval(number_format($order->info['total'], 2, '', '')), 'currency' => $order->info['currency'], 'lang' => substr($_SESSION['language'], 0, 2) !== 'lt' ? 'ENG' : 'LTU', 'accepturl' => $acceptURL, 'cancelurl' => $cancelURL, 'callbackurl' => $callbackURL, 'country' => 'LT', 'logo' => '', 'p_firstname' => $order->customer['firstname'], 'p_lastname' => $order->customer['lastname'], 'p_email' => $order->customer['email_address'], 'p_street' => $order->customer['street_address'], 'p_city' => $order->customer['city'], 'p_state' => $order->customer['state'], 'p_zip' => $order->customer['postcode'], 'p_countrycode' => $order->customer['country']['iso_code_2'], 'test' => $this->testMode));
     } catch (WebToPayException $e) {
         echo get_class($e) . ': ' . $e->getMessage();
     }
     $html = '';
     if ($request) {
         foreach ($request as $key => $value) {
             $html .= tep_draw_hidden_field($key, $value);
         }
     }
     return $html;
 }
 function execute()
 {
     global $PHP_SELF, $oscTemplate, $languages_id, $currencies, $currency;
     if ($PHP_SELF == 'product_info.php' && isset($_GET['products_id'])) {
         $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_image from products p, products_description pd where p.products_id = '" . (int) $_GET['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'");
         if (tep_db_num_rows($product_info_query) === 1) {
             $product_info = tep_db_fetch_array($product_info_query);
             $data = array('card' => MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TYPE, 'title' => $product_info['products_name']);
             if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID)) {
                 $data['site'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID;
             }
             if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID)) {
                 $data['creator'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID;
             }
             $product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($product_info['products_description']))), 0, 197);
             if (strlen($product_description) == 197) {
                 $product_description .= ' ..';
             }
             $data['description'] = $product_description;
             $products_image = $product_info['products_image'];
             $pi_query = tep_db_query("select image from products_images where products_id = '" . (int) $product_info['products_id'] . "' order by sort_order limit 1");
             if (tep_db_num_rows($pi_query) === 1) {
                 $pi = tep_db_fetch_array($pi_query);
                 $products_image = $pi['image'];
             }
             $data['image'] = tep_href_link('images/' . $products_image, '', 'NONSSL', false, false);
             $result = '';
             foreach ($data as $key => $value) {
                 $result .= '<meta name="twitter:' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . "\n";
             }
             $oscTemplate->addBlock($result, $this->group);
         }
     }
 }
示例#16
0
 function html_start_sub1()
 {
     extract(tep_load('http_headers', 'database', 'message_stack'));
     if (DEFAULT_WARNING_PASSWORD_PROTECT_REMIND == 'true') {
         $cfq_query = $db->query("select configuration_id, configuration_group_id from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_WARNING_PASSWORD_PROTECT_REMIND'");
         $cfg_array = $db->fetch_array($cfq_query);
         $warning_string = '<a class="headerLink" href="' . tep_href_link(FILENAME_CONFIGURATION, 'action=edit&gID=' . $cfg_array['configuration_group_id'] . '&cID=' . $cfg_array['configuration_id']) . '">' . WARNING_PASSWORD_PROTECT_REMIND . '</a>';
         $msg->add($warning_string, 'error', 'header');
     }
     // check if the 'install' directory exists, and warn of its existence
     if (DEFAULT_WARNING_INSTALL_EXISTS == 'true') {
         $check_dir = DIR_FS_CATALOG . 'install';
         if (file_exists($check_dir)) {
             $install_string = sprintf(WARNING_INSTALL_DIRECTORY_EXISTS, $check_dir);
             $msg->add($install_string, 'error', 'header');
         }
     }
     if ((bool) ini_get('file_uploads') == false) {
         $msg->add(WARNING_FILE_UPLOADS_DISABLED, 'warning', 'header');
     }
     $images_path = tep_front_physical_path(DIR_WS_CATALOG_IMAGES);
     if (!is_writeable($images_path)) {
         $msg->add(WARNING_IMAGE_UPLOADS_DISABLED, 'warning', 'header');
     }
     $images_path = tep_front_physical_path(DIR_WS_CATALOG . FLY_THUMB_FOLDER);
     if (!is_writeable($images_path)) {
         $msg->add(WARNING_IMAGE_THUMBS_DISABLED, 'warning', 'header');
     }
     $http->send_cookies();
 }
示例#17
0
 function execute()
 {
     global $languages_id, $HTTP_GET_VARS, $currencies, $oscTemplate;
     $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and r.reviews_status = 1";
     if (isset($HTTP_GET_VARS['products_id'])) {
         $random_select .= " and p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "'";
     }
     $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
     $random_product = tep_random_select($random_select);
     $reviews_box_contents = '';
     if ($random_product) {
         // display random review box
         $rand_review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int) $random_product['reviews_id'] . "' and languages_id = '" . (int) $languages_id . "'");
         $rand_review = tep_db_fetch_array($rand_review_query);
         $rand_review_text = tep_break_string(tep_output_string_protected($rand_review['reviews_text']), 15, '-<br />');
         $reviews_box_contents .= '<div class="ui-widget-content infoBoxContents"><div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . $rand_review_text . ' ..</a><br /><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif', sprintf(MODULE_BOXES_REVIEWS_BOX_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div></div>';
     } elseif (isset($HTTP_GET_VARS['products_id'])) {
         // display 'write a review' box
         $reviews_box_contents .= '<table border="0" cellspacing="0" cellpadding="2" class="ui-widget-content infoBoxContents"><tr><td><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a></td><td><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . MODULE_BOXES_REVIEWS_BOX_WRITE_REVIEW . '</a></td></tr></table>';
     } else {
         // display 'no reviews' box
         $reviews_box_contents .= '<div class="ui-widget-content infoBoxContents">' . MODULE_BOXES_REVIEWS_BOX_NO_REVIEWS . '</div>';
     }
     $data = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_REVIEWS) . '">' . MODULE_BOXES_REVIEWS_BOX_TITLE . '</a></div>' . '  ' . $reviews_box_contents . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
 function pass()
 {
     $backup_file = null;
     if (is_dir(DIR_FS_BACKUP)) {
         $dir = dir(DIR_FS_BACKUP);
         $contents = array();
         while ($file = $dir->read()) {
             if (!is_dir(DIR_FS_BACKUP . $file)) {
                 $ext = substr($file, strrpos($file, '.') + 1);
                 if (in_array($ext, array('zip', 'sql', 'gz')) && !isset($contents[$ext])) {
                     $contents[$ext] = $file;
                     if ($ext != 'sql') {
                         // zip and gz (binaries) are prioritized over sql (plain text)
                         break;
                     }
                 }
             }
         }
         if (isset($contents['zip'])) {
             $backup_file = $contents['zip'];
         } elseif (isset($contents['gz'])) {
             $backup_file = $contents['gz'];
         } elseif (isset($contents['sql'])) {
             $backup_file = $contents['sql'];
         }
     }
     $result = true;
     if (isset($backup_file)) {
         $request = $this->getHttpRequest(tep_href_link('backups/' . $backup_file));
         $result = $request['http_code'] != 200;
     }
     return $result;
 }
示例#19
0
 function _process()
 {
     global $messageStack, $osC_Database, $osC_Customer;
     if (!isset($_POST['password_current']) || strlen(trim($_POST['password_current'])) < ACCOUNT_PASSWORD) {
         $messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
     } elseif (!isset($_POST['password_new']) || strlen(trim($_POST['password_new'])) < ACCOUNT_PASSWORD) {
         $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
     } elseif (!isset($_POST['password_confirmation']) || trim($_POST['password_new']) != trim($_POST['password_confirmation'])) {
         $messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
     }
     if ($messageStack->size('account_password') === 0) {
         $Qcheck = $osC_Database->query('select customers_password from :table_customers where customers_id = :customers_id');
         $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
         $Qcheck->bindInt(':customers_id', $osC_Customer->id);
         $Qcheck->execute();
         if (tep_validate_password(trim($_POST['password_current']), $Qcheck->value('customers_password'))) {
             $Qupdate = $osC_Database->query('update :table_customers set customers_password = :customers_password where customers_id = :customers_id');
             $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
             $Qupdate->bindValue(':customers_password', tep_encrypt_password(trim($_POST['password_new'])));
             $Qupdate->bindInt(':customers_id', $osC_Customer->id);
             $Qupdate->execute();
             $Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
             $Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
             $Qupdate->bindInt(':customers_info_id', $osC_Customer->id);
             $Qupdate->execute();
             $messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
             tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
         } else {
             $messageStack->add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
         }
     }
 }
示例#20
0
 function execute()
 {
     global $new_products_id_in_cart, $currencies, $oscTemplate;
     $cart_contents_string = '';
     if ($_SESSION['cart']->count_contents() > 0) {
         $cart_contents_string = '<ul class="list-unstyled">';
         $products = $_SESSION['cart']->get_products();
         for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
             $cart_contents_string .= '<li';
             if (isset($_SESSION['new_products_id_in_cart']) && $new_products_id_in_cart == $products[$i]['id']) {
                 $cart_contents_string .= ' class="newItemInCart"';
             }
             $cart_contents_string .= '>';
             $cart_contents_string .= $products[$i]['quantity'] . '&nbsp;x&nbsp;';
             $cart_contents_string .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';
             $cart_contents_string .= $products[$i]['name'];
             $cart_contents_string .= '</a></li>';
             if (isset($_SESSION['new_products_id_in_cart']) && $new_products_id_in_cart == $products[$i]['id']) {
                 unset($_SESSION['new_products_id_in_cart']);
             }
         }
         $cart_contents_string .= '<li class="text-right"><hr>' . $currencies->format($_SESSION['cart']->show_total()) . '</li>' . '</ul>';
     } else {
         $cart_contents_string .= '<p>' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '</p>';
     }
     $data = '<div class="panel panel-default">' . '  <div class="panel-heading"><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . MODULE_BOXES_SHOPPING_CART_BOX_TITLE . '</a></div>' . '  <div class="panel-body">' . $cart_contents_string . '</div>' . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
示例#21
0
function tep_session_start()
{
    $sane_session_id = true;
    if (isset($_GET[tep_session_name()])) {
        if (SESSION_FORCE_COOKIE_USE == 'True' || preg_match('/^[a-zA-Z0-9,-]+$/', $_GET[tep_session_name()]) == false) {
            unset($_GET[tep_session_name()]);
            $sane_session_id = false;
        }
    }
    if (isset($_POST[tep_session_name()])) {
        if (SESSION_FORCE_COOKIE_USE == 'True' || preg_match('/^[a-zA-Z0-9,-]+$/', $_POST[tep_session_name()]) == false) {
            unset($_POST[tep_session_name()]);
            $sane_session_id = false;
        }
    }
    if (isset($_COOKIE[tep_session_name()])) {
        if (preg_match('/^[a-zA-Z0-9,-]+$/', $_COOKIE[tep_session_name()]) == false) {
            $session_data = session_get_cookie_params();
            setcookie(tep_session_name(), '', time() - 42000, $session_data['path'], $session_data['domain']);
            unset($_COOKIE[tep_session_name()]);
            $sane_session_id = false;
        }
    }
    if ($sane_session_id == false) {
        tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL', false));
    }
    register_shutdown_function('session_write_close');
    return session_start();
}
示例#22
0
 function start($check_post = true)
 {
     extract(tep_load('defs', 'http_validator', 'database'));
     if (isset($cDefs->external) && !empty($cDefs->external)) {
         $check_post = false;
     }
     $this->id = $this->get_cookie($this->name);
     if (empty($this->id) && SESSION_FORCE_COOKIE_USE != 'true' && isset($_GET[$this->name])) {
         $this->id = $_GET[$this->name];
     }
     $result = false;
     if (empty($this->id)) {
         $result = $this->generate();
     } else {
         $result = $this->validate($this->id);
     }
     if ($check_post && count($_POST) && ($this->new_id || !$result)) {
         tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE, '', 'NONSSL', false));
     }
     if ($result) {
         $this->life = MAX_CATALOG_SESSION_TIME;
         $this->started = true;
     } else {
         $this->reset();
     }
 }
 function execute()
 {
     if (isset($_GET['tabaction'])) {
         $ppstatus_query = tep_db_query("select comments from orders_status_history where orders_id = '" . (int) $_GET['oID'] . "' and orders_status_id = '" . (int) OSCOM_APP_PAYPAL_TRANSACTIONS_ORDER_STATUS_ID . "' and comments like '%Transaction ID:%' order by date_added limit 1");
         if (tep_db_num_rows($ppstatus_query)) {
             $ppstatus = tep_db_fetch_array($ppstatus_query);
             $pp = array();
             foreach (explode("\n", $ppstatus['comments']) as $s) {
                 if (!empty($s) && strpos($s, ':') !== false) {
                     $entry = explode(':', $s, 2);
                     $pp[trim($entry[0])] = trim($entry[1]);
                 }
             }
             if (isset($pp['Transaction ID'])) {
                 $o_query = tep_db_query("select o.orders_id, o.payment_method, o.currency, o.currency_value, ot.value as total from orders o, orders_total ot where o.orders_id = '" . (int) $_GET['oID'] . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total'");
                 $o = tep_db_fetch_array($o_query);
                 switch ($_GET['tabaction']) {
                     case 'getTransactionDetails':
                         $this->getTransactionDetails($pp, $o);
                         break;
                     case 'doCapture':
                         $this->doCapture($pp, $o);
                         break;
                     case 'doVoid':
                         $this->doVoid($pp, $o);
                         break;
                     case 'refundTransaction':
                         $this->refundTransaction($pp, $o);
                         break;
                 }
                 tep_redirect(tep_href_link('orders.php', 'page=' . $_GET['page'] . '&oID=' . $_GET['oID'] . '&action=edit#section_status_history_content'));
             }
         }
     }
 }
 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);
         }
     }
 }
示例#25
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;
 }
 function execute()
 {
     global $languages_id, $HTTP_GET_VARS, $currencies, $oscTemplate;
     $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and r.reviews_status = 1";
     if (isset($HTTP_GET_VARS['products_id'])) {
         $random_select .= " and p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "'";
     }
     $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
     $random_product = tep_random_select($random_select);
     $reviews_box_contents = '';
     if ($random_product) {
         // display random review box
         $rand_review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int) $random_product['reviews_id'] . "' and languages_id = '" . (int) $languages_id . "'");
         $rand_review = tep_db_fetch_array($rand_review_query);
         $rand_review_text = tep_break_string(tep_output_string_protected($rand_review['reviews_text']), 15, '-<br />');
         $reviews_box_contents .= '<div class="text-center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><div><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, 'products_id=' . $random_product['products_id']) . '">' . $rand_review_text . '</a>...</div><div class="text-center" title="' . sprintf(MODULE_BOXES_REVIEWS_BOX_TEXT_OF_5_STARS, $random_product['reviews_rating']) . '">' . tep_draw_stars($random_product['reviews_rating']) . '</div>';
     } elseif (isset($HTTP_GET_VARS['products_id'])) {
         // display 'write a review' box
         $reviews_box_contents .= '<span class="fa fa-thumbs-up"></span> <a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . MODULE_BOXES_REVIEWS_BOX_WRITE_REVIEW . '</a>';
     } else {
         // display 'no reviews' box
         $reviews_box_contents .= '<p>' . MODULE_BOXES_REVIEWS_BOX_NO_REVIEWS . '</p>';
     }
     ob_start();
     include DIR_WS_MODULES . 'boxes/templates/reviews.php';
     $data = ob_get_clean();
     $oscTemplate->addBlock($data, $this->group);
 }
示例#27
0
 function start()
 {
     $sane_session_id = true;
     if (isset($_GET[$this->name])) {
         if (preg_match('/^[a-zA-Z0-9]+$/', $_GET[$this->name]) == false) {
             unset($_GET[$this->name]);
             $sane_session_id = false;
         }
     } elseif (isset($_POST[$this->name])) {
         if (preg_match('/^[a-zA-Z0-9]+$/', $_POST[$this->name]) == false) {
             unset($_POST[$this->name]);
             $sane_session_id = false;
         }
     } elseif (isset($_COOKIE[$this->name])) {
         if (preg_match('/^[a-zA-Z0-9]+$/', $_COOKIE[$this->name]) == false) {
             unset($_COOKIE[$this->name]);
             $sane_session_id = false;
         }
     }
     if ($sane_session_id == false) {
         tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
     } elseif (session_start()) {
         $this->setStarted(true);
         $this->setID();
         return true;
     }
     return false;
 }
示例#28
0
 function get_search()
 {
     extract(tep_load('defs', 'database', 'sessions'));
     $keywords = $db->prepare_input($_GET['search']);
     $text_query_raw = "select template_id, template_title, template_subject from " . TABLE_TEMPLATES . " where (template_title like '%" . $db->input($keywords) . "%' or template_subject like '%" . $db->input($keywords) . "%' or template_content like '%" . $db->input($keywords) . "%') order by template_title limit 10";
     $text_array = $db->query_to_array($text_query_raw);
     $j = count($text_array);
     if ($j) {
         echo '<div><table class="tabledata">' . "\n";
         echo '<tr class="dataTableHeadingRow">' . "\n";
         echo '<th>' . TABLE_HEADING_SUBJECT . '</th>' . "\n";
         echo '<th>' . TABLE_HEADING_TITLE . '</th>' . "\n";
         for ($i = 0; $i < $j; $i++) {
             echo '<tr class="dataTableRow"><td><a class="blocker" href="' . tep_href_link($cDefs->script, 'tID=' . $text_array[$i]['template_id'] . '&action=new_template') . '">' . $text_array[$i]['template_subject'] . '</a></td><td><b>' . $text_array[$i]['template_title'] . '</b>' . '</td></tr>' . "\n";
         }
         echo '</tr>' . "\n";
         echo '</table></div>' . "\n";
         echo '<div class="dataTableRowSelected linepad">' . TEXT_INFO_SEARCH_LIMIT . '</div>' . "\n";
     }
     if (!$j) {
         echo 'Nothing Found';
     }
     $cSessions->close();
     return true;
 }
示例#29
0
 function install()
 {
     if (!defined('MODULE_PAYMENT_MONEYBOOKERS_STATUS')) {
         tep_redirect(tep_href_link('ext/modules/payment/moneybookers/activation.php', 'action=coreRequired'));
     }
     $zone_id = 0;
     $zone_query = tep_db_query("select geo_zone_id from " . TABLE_GEO_ZONES . " where geo_zone_name = 'Moneybookers iDeal'");
     if (tep_db_num_rows($zone_query)) {
         $zone = tep_db_fetch_array($zone_query);
         $zone_id = $zone['geo_zone_id'];
     } else {
         tep_db_query("insert into " . TABLE_GEO_ZONES . " values (null, 'Moneybookers iDeal', 'The zone for the Moneybookers iDeal payment module', null, now())");
         $zone_id = tep_db_insert_id();
         $country_query = tep_db_query("select countries_id from " . TABLE_COUNTRIES . " where countries_iso_code_2 = 'NL'");
         if (tep_db_num_rows($country_query)) {
             $country = tep_db_fetch_array($country_query);
             tep_db_query("insert into " . TABLE_ZONES_TO_GEO_ZONES . " values (null, '" . (int) $country['countries_id'] . "', 0, '" . (int) $zone_id . "', null, now())");
         }
     }
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Moneybookers iDeal', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_STATUS', 'False', 'Do you want to accept Moneybookers iDeal payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_ZONE', '" . (int) $zone_id . "', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_PREPARE_ORDER_STATUS_ID', '" . MODULE_PAYMENT_MONEYBOOKERS_PREPARE_ORDER_STATUS_ID . "', 'Set the status of prepared orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Transactions Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_TRANSACTIONS_ORDER_STATUS_ID', '" . MODULE_PAYMENT_MONEYBOOKERS_TRANSACTIONS_ORDER_STATUS_ID . "', 'Set the status of callback transactions to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
 }
示例#30
0
 function execute()
 {
     global $languages_id, $HTTP_GET_VARS, $currencies, $oscTemplate;
     $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and r.reviews_status = 1";
     if (isset($HTTP_GET_VARS['products_id'])) {
         $random_select .= " and p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "'";
     }
     $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
     $random_product = tep_random_select($random_select);
     $reviews_box_contents = '';
     if ($random_product) {
         // display random review box
         $rand_review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int) $random_product['reviews_id'] . "' and languages_id = '" . (int) $languages_id . "'");
         $rand_review = tep_db_fetch_array($rand_review_query);
         $rand_review_text = tep_break_string(tep_output_string_protected($rand_review['reviews_text']), 15, '-<br />');
         $reviews_box_contents .= '	<ul class="module-content boxproduct">' . '		<li class="clearfix">' . '			<a class="boxproduct-img" href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', '') . '</a>' . '			<div class="boxproduct-info">' . '			<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&reviews_id=' . $random_product['reviews_id']) . '">' . $rand_review_text . ' ..</a>' . '			<div class="rating-img">' . tep_draw_rating($random_product['reviews_rating']) . '</div>' . '			</div>' . '		</li>' . '	</ul>';
     } elseif (isset($HTTP_GET_VARS['products_id'])) {
         // display 'write a review' box
         $reviews_box_contents .= '	<div class="module-content">' . '		<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_draw_icon('fa-pencil') . MODULE_BOXES_REVIEWS_BOX_WRITE_REVIEW . '</a>' . '	</div>';
     } else {
         // display 'no reviews' box
         $reviews_box_contents .= '<div class="module-content">' . MODULE_BOXES_REVIEWS_BOX_NO_REVIEWS . '</div>';
     }
     $data = '<div class="module reviews-box">' . '  <h3 class="module-heading"><a href="' . tep_href_link(FILENAME_REVIEWS) . '">' . MODULE_BOXES_REVIEWS_BOX_TITLE . '</a></h3>' . '  ' . $reviews_box_contents . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }