Esempio n. 1
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;
}
 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);
 }
Esempio n. 3
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);
 }
Esempio n. 4
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);
     }
 }
Esempio n. 5
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);
 }
 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;
 }
Esempio n. 7
0
 function quote($method = '')
 {
     global $osC_Tax, $order, $cart, $shipping_weight, $shipping_num_boxes, $osC_Weight;
     if (MODULE_SHIPPING_TABLE_MODE == 'price') {
         $order_total = $cart->show_total();
     } else {
         $order_total = $shipping_weight = $osC_Weight->convert($shipping_weight, SHIPPING_WEIGHT_UNIT, MODULE_SHIPPING_TABLE_WEIGHT_UNIT);
     }
     $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)), 'tax' => 0);
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = $osC_Tax->getTaxRate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
 function getData()
 {
     global $PHP_SELF, $HTTP_GET_VARS;
     // Display the button
     $content = tep_draw_form('skroutz_easy', tep_href_link('skroutz.php', '', 'NONSSL', false), 'post') . '<div align="center">' . tep_image(DIR_WS_IMAGES . $this->logo, $this->title) . '</div>' . '<div style="margin: 5px 0">' . $this->description . '.</div>' . $this->list_header . ':' . '<ul style="margin: 0 0 0.5em 2em; padding-left: 0">' . '  <li>' . $this->list_item1 . '</li>' . '  <li>' . $this->list_item2 . '</li>' . '  <li>' . $this->list_item3 . '</li>' . '</ul>' . '<div align="center"><a href="http://www.skroutz.gr/easy" style="color: #F68B24">' . $this->more . '</a></div>' . tep_draw_input_field('submit', $this->button, 'style="width: 100%; word-wrap: break-word"', 'submit') . '</form>';
     return $content;
 }
Esempio n. 9
0
 function execute()
 {
     global $HTTP_GET_VARS, $languages_id, $oscTemplate;
     if (isset($HTTP_GET_VARS['products_id'])) {
         $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int) $languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
         if (tep_db_num_rows($manufacturer_query)) {
             $manufacturer = tep_db_fetch_array($manufacturer_query);
             $manufacturer_info_string = NULL;
             if (tep_not_null($manufacturer['manufacturers_image'])) {
                 $manufacturer_info_string .= '<div>' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</div>';
             }
             if (tep_not_null($manufacturer['manufacturers_url'])) {
                 $manufacturer_info_string .= '<div class="text-center"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(MODULE_BOXES_MANUFACTURER_INFO_BOX_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></div>';
             }
             $data = NULL;
             if ($this->group == 'boxes_product_page') {
                 $data .= '<div class="col-sm-4 product_box hidden-xs">';
             }
             $data .= '<div class="panel panel-default">' . '  <div class="panel-heading">' . MODULE_BOXES_MANUFACTURER_INFO_BOX_TITLE . '</div>' . '  <div class="panel-body">' . $manufacturer_info_string . '</div>';
             $data .= '  <div class="panel-footer clearfix"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">' . MODULE_BOXES_MANUFACTURER_INFO_BOX_OTHER_PRODUCTS . '</a></div>';
             $data .= '</div>';
             if ($this->group == 'boxes_product_page') {
                 $data .= '</div>';
             }
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
Esempio n. 10
0
 function quote($method = '')
 {
     global $order, $cart, $shipping_weight, $shipping_num_boxes;
     if (MODULE_SHIPPING_TABLE4_MODE == 'price') {
         $order_total = $cart->show_total();
     } else {
         $order_total = $shipping_weight;
     }
     $table4_cost = preg_split("/[:,]/", MODULE_SHIPPING_TABLE4_COST);
     $size = sizeof($table4_cost);
     for ($i = 0, $n = $size; $i < $n; $i += 2) {
         if ($order_total <= $table4_cost[$i]) {
             $shipping = $table4_cost[$i + 1];
             break;
         }
     }
     if (MODULE_SHIPPING_TABLE4_MODE == 'weight') {
         $shipping = $shipping * $shipping_num_boxes;
     }
     $this->quotes = array('id' => $this->code, 'module' => Translate('table4 titel'), 'methods' => array(array('id' => $this->code, 'title' => Translate('table4 omschrijving'), 'cost' => $shipping + MODULE_SHIPPING_TABLE4_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Esempio n. 11
0
	function get_cc_images() {
		$cc_images = '';
		reset($this->allowed_types);
		while (list($key, $value) = each($this->allowed_types)) {
			$cc_images .= tep_image(DIR_WS_ICONS . $key . '.gif', $value);
		}
		return $cc_images;
	}
Esempio n. 12
0
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_DOWNLOAD_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_DOWNLOAD_TEXT_WAY, 'cost' => 0)));
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Esempio n. 13
0
 function execute()
 {
     global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate;
     if (!isset($HTTP_GET_VARS['products_id'])) {
         if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int) $languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
             $data = '<div class="module specials-box">' . '  <h3 class="module-heading"><a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_BOX_TITLE . '</a></h3>' . '  <ul class="module-content boxproduct">' . '  	<li class="clearfix">' . '  		<a class="boxproduct-img" 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>' . '			<div class="boxproduct-info">' . '  			<a class="product-name boxproduct-name" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a>' . '				<div class="price-box">' . '  				<span class="new-price price">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>' . '  				<del class="old-price price">' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del>' . '				</div>' . '			</div>' . '  	</li>' . '	 </ul>' . '</div>';
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
Esempio n. 14
0
 function execute()
 {
     global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate;
     if (!isset($HTTP_GET_VARS['products_id'])) {
         if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int) $languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
             $data = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . MODULE_BOXES_SPECIALS_BOX_TITLE . '</a></div>' . '  <div class="ui-widget-content infoBoxContents" style="text-align: 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 /><del>' . $currencies->display_price_normal($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span></div>' . '</div>';
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
 function getOutput()
 {
     $output = '<table border="0" width="100%" cellspacing="0" cellpadding="4">' . '  <tr class="dataTableHeadingRow">' . '    <td class="dataTableHeadingContent" width="20">&nbsp;</td>' . '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_ADMIN_LOGINS_TITLE . '</td>' . '    <td class="dataTableHeadingContent" align="right">' . MODULE_ADMIN_DASHBOARD_ADMIN_LOGINS_DATE . '</td>' . '  </tr>';
     $logins_query = tep_db_query("select id, user_name, success, date_added from " . TABLE_ACTION_RECORDER . " where module = 'ar_admin_login' order by date_added desc limit 6");
     while ($logins = tep_db_fetch_array($logins_query)) {
         $output .= '  <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '    <td class="dataTableContent" align="center">' . tep_image(DIR_WS_IMAGES . 'icons/' . ($logins['success'] == '1' ? 'tick.gif' : 'cross.gif')) . '</td>' . '    <td class="dataTableContent"><a href="' . tep_href_link(FILENAME_ACTION_RECORDER, 'module=ar_admin_login&aID=' . (int) $logins['id']) . '">' . tep_output_string_protected($logins['user_name']) . '</a></td>' . '    <td class="dataTableContent" align="right">' . tep_date_short($logins['date_added']) . '</td>' . '  </tr>';
     }
     $output .= '</table>';
     return $output;
 }
Esempio n. 16
0
 function execute()
 {
     global $PHP_SELF, $lng, $request_type, $oscTemplate, $language;
     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) {
             $languages_string = '';
             reset($lng->catalog_languages);
             foreach ($lng->catalog_languages as $key => $value) {
                 if ($value['directory'] == $language) {
                     $current_lang_key = $key;
                     break;
                 }
             }
             reset($lng->catalog_languages);
             $home_page_redirect = defined('USU5_HOME_PAGE_REDIRECT') && USU5_HOME_PAGE_REDIRECT == 'true' ? true : false;
             while (list($key, $value) = each($lng->catalog_languages)) {
                 if (defined('USU5_MULTI_LANGUAGE_SEO_SUPPORT') && USU5_MULTI_LANGUAGE_SEO_SUPPORT == 'true' && defined('USU5_ENABLED') && USU5_ENABLED == 'true') {
                     if (false === ($language == $value['directory'])) {
                         // we don't want to show a link to the currently loaded language
                         if (false !== $home_page_redirect) {
                             // If we are using the root site redirect
                             $link = str_replace(array(FILENAME_DEFAULT, '/' . $current_lang_key), '', tep_href_link(FILENAME_DEFAULT));
                         } else {
                             $link = str_replace('/' . $current_lang_key, '', tep_href_link(FILENAME_DEFAULT));
                         }
                         if ($key !== DEFAULT_LANGUAGE) {
                             // if it is not the default language we are dealing with
                             if (false === strpos($link, '.php') && false !== $home_page_redirect) {
                                 $link_array = explode('?', $link);
                                 $qs = array_key_exists(1, $link_array) ? '?' . $link_array[1] : '';
                                 $link = $link_array[0] . FILENAME_DEFAULT . '/' . $key . $qs;
                             } else {
                                 $link_array = explode('?', $link);
                                 $qs = array_key_exists(1, $link_array) ? '?' . $link_array[1] : '';
                                 $link = str_replace('.php', '.php/' . $key . $qs, $link);
                             }
                         }
                         // USU5  shows the language link and image
                         $languages_string .= ' <a href="' . $link . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
                     }
                 } else {
                     // Just do the standard osCommerce links
                     // Standard osCommerce shows the language link and image
                     $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
                 }
             }
             $data = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_LANGUAGES_BOX_TITLE . '</div>' . '  <div class="ui-widget-content infoBoxContents" style="text-align: center;">' . $languages_string . '</div>' . '</div>';
             $oscTemplate->addBlock($data, $this->group);
         }
     }
 }
 function execute()
 {
     global $PHP_SELF, $oscTemplate;
     if (substr(basename($PHP_SELF), 0, 8) != 'checkout' && tep_not_null(MODULE_BOXES_CARD_ACCEPTANCE_LOGOS)) {
         $output = '<div class="module card-box">' . '  <h3 class="module-heading">' . MODULE_BOXES_CARD_ACCEPTANCE_BOX_TITLE . '</h3>' . '  <div class="module-content">';
         foreach (explode(';', MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) as $logo) {
             $output .= tep_image(DIR_WS_IMAGES . 'card_acceptance/' . basename($logo), '', '', '', '', 'img-cards');
         }
         $output .= '  </div>' . '</div>';
         $oscTemplate->addBlock($output, $this->group);
     }
 }
Esempio n. 18
0
 function quote($method = '')
 {
     global $osC_Tax, $order, $total_count;
     $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)), 'tax' => 0);
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = $osC_Tax->getTaxRate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Esempio n. 19
0
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => '<FONT COLOR=FF0000><B>' . MODULE_SHIPPING_FREESHIPPER_TEXT_WAY . '</B></FONT>', 'cost' => SHIPPING_HANDLING + MODULE_SHIPPING_FREESHIPPER_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
 function execute()
 {
     global $PHP_SELF, $oscTemplate;
     if (substr(basename($PHP_SELF), 0, 8) != 'checkout' && tep_not_null(MODULE_BOXES_CARD_ACCEPTANCE_LOGOS)) {
         $output = '<div class="panel panel-default">' . '  <div class="panel-heading">' . MODULE_BOXES_CARD_ACCEPTANCE_BOX_TITLE . '</div>' . '  <div class="panel-body text-center">';
         foreach (explode(';', MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) as $logo) {
             $output .= tep_image(DIR_WS_IMAGES . 'card_acceptance/' . basename($logo));
         }
         $output .= '  </div>' . '</div>';
         $oscTemplate->addBlock($output, $this->group);
     }
 }
 function getOutput()
 {
     global $languages_id;
     $output = '<table border="0" width="100%" cellspacing="0" cellpadding="4">' . '  <tr class="dataTableHeadingRow">' . '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_REVIEWS_TITLE . '</td>' . '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_REVIEWS_DATE . '</td>' . '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_REVIEWS_REVIEWER . '</td>' . '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_REVIEWS_RATING . '</td>' . '    <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_REVIEWS_REVIEW_STATUS . '</td>' . '  </tr>';
     $reviews_query = tep_db_query("select r.reviews_id, r.date_added, pd.products_name, r.customers_name, r.reviews_rating, r.reviews_status from " . TABLE_REVIEWS . " r, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = r.products_id and pd.language_id = '" . (int) $languages_id . "' order by r.date_added desc limit 6");
     while ($reviews = tep_db_fetch_array($reviews_query)) {
         $status_icon = $reviews['reviews_status'] == '1' ? tep_image('images/icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) : tep_image('images/icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
         $output .= '  <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . '    <td class="dataTableContent"><a href="' . tep_href_link('reviews.php', 'rID=' . (int) $reviews['reviews_id'] . '&action=edit') . '">' . $reviews['products_name'] . '</a></td>' . '    <td class="dataTableContent">' . tep_date_short($reviews['date_added']) . '</td>' . '    <td class="dataTableContent">' . tep_output_string_protected($reviews['customers_name']) . '</td>' . '    <td class="dataTableContent">' . tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif') . '</td>' . '    <td class="dataTableContent">' . $status_icon . '</td>' . '  </tr>';
     }
     $output .= '</table>';
     return $output;
 }
Esempio n. 22
0
 function add($class, $message, $type = 'error')
 {
     if ($type == 'error') {
         $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . '&nbsp;' . $message);
     } elseif ($type == 'warning') {
         $this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . '&nbsp;' . $message);
     } elseif ($type == 'success') {
         $this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . '&nbsp;' . $message);
     } else {
         $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => $message);
     }
 }
Esempio n. 23
0
 function quote($method = '')
 {
     global $order, $total_count;
     $this->quotes = array('id' => $this->code, 'module' => Translate('item titel'), 'methods' => array(array('id' => $this->code, 'title' => Translate('item omschrijving'), 'cost' => MODULE_SHIPPING_ITEM_COST * $total_count + MODULE_SHIPPING_ITEM_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Esempio n. 24
0
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FLAT_TEXT_WAY, 'cost' => MODULE_SHIPPING_FLAT_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (tep_not_null($this->icon)) {
         $this->quotes['icon'] = tep_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
 function execute()
 {
     global $PHP_SELF, $oscTemplate;
     if (substr(basename($PHP_SELF), 0, 8) != 'checkout' && tep_not_null(MODULE_BOXES_CARD_ACCEPTANCE_LOGOS)) {
         $output = '<div class="ui-widget infoBoxContainer">' . '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CARD_ACCEPTANCE_BOX_TITLE . '</div>' . '  <div class="ui-widget-content infoBoxContents" style="text-align: center;">';
         foreach (explode(';', MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) as $logo) {
             $output .= tep_image(DIR_WS_IMAGES . 'card_acceptance/' . basename($logo));
         }
         $output .= '  </div>' . '</div>';
         $oscTemplate->addBlock($output, $this->group);
     }
 }
 function add($message, $type = 'error')
 {
     if ($type == 'error') {
         $this->errors[] = array('params' => 'class="messageStackError"', 'text' => tep_image('images/icons/error.gif', ICON_ERROR) . '&nbsp;' . $message);
     } elseif ($type == 'warning') {
         $this->errors[] = array('params' => 'class="messageStackWarning"', 'text' => tep_image('images/icons/warning.gif', ICON_WARNING) . '&nbsp;' . $message);
     } elseif ($type == 'success') {
         $this->errors[] = array('params' => 'class="messageStackSuccess"', 'text' => tep_image('images/icons/success.gif', ICON_SUCCESS) . '&nbsp;' . $message);
     } else {
         $this->errors[] = array('params' => 'class="messageStackError"', 'text' => $message);
     }
     $this->size++;
 }
Esempio n. 27
0
function tep_display_banner($banner)
{
    global $request_type;
    if (is_array($banner)) {
        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']) . '">' . tep_image(($request_type == 'SSL' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
        }
        tep_update_banner_display_count($banner['banners_id']);
        return $banner_string;
    }
}
 /**
  * Retrieve payment selection array
  * 
  * @return array
  */
 public function selection()
 {
     global $order;
     $display = array('id' => $this->code, 'module' => tep_image(DIR_WS_IMAGES . '/' . $this->code . '_checkout_logo.png'));
     $neededFields = $this->_getNeededFields();
     $neededRpJS = $this->_getRatepayJavaSrcipt();
     if (!empty($neededFields)) {
         $display['fields'] = array_merge($neededFields, $neededRpJS);
     }
     if ($this->country != 'DE' && $this->country != 'AT' && $this->country != 'CH') {
         $display = null;
     }
     if (!Data::isRatepayAvailable()) {
         $display = null;
     }
     $countrySuffix = ucfirst(strtolower($this->country));
     $enabledVarName = 'enabled' . $countrySuffix;
     $minVarName = 'min' . $countrySuffix;
     $maxVarName = 'max' . $countrySuffix;
     $b2bVarName = 'b2b' . $countrySuffix;
     $alaVarName = 'ala' . $countrySuffix;
     if (!$this->{$enabledVarName}) {
         $display = null;
     }
     if (floatval($order->info['total']) < floatval($this->{$minVarName}) || floatval($order->info['total']) > floatval($this->{$maxVarName})) {
         $display = null;
     }
     if (!empty($order->billing['company']) && !$this->{$b2bVarName}) {
         $display = null;
     }
     if (!$this->{$alaVarName}) {
         if (sizeof($order->delivery) != sizeof($order->billing)) {
             $display = null;
         } else {
             if (is_array($order->billing)) {
                 foreach ($order->billing as $key => $val) {
                     if ($order->billing[$key] != $order->delivery[$key]) {
                         $display = null;
                     }
                     unset($val);
                 }
             }
         }
     }
     $dob = Db::getCustomersDob(null, Session::getSessionEntry('customer_id'));
     if (intval($dob) != 0 && !$this->_isAdult($dob)) {
         $display = null;
     }
     $this->setInfoVisited(false);
     return $display;
 }
 function execute()
 {
     global $PHP_SELF, $oscTemplate;
     if (substr(basename($PHP_SELF), 0, 8) != 'checkout' && tep_not_null(MODULE_BOXES_CARD_ACCEPTANCE_LOGOS)) {
         $output = NULL;
         foreach (explode(';', MODULE_BOXES_CARD_ACCEPTANCE_LOGOS) as $logo) {
             $output .= tep_image('images/card_acceptance/' . basename($logo), null, null, null, null, false);
         }
         ob_start();
         include 'includes/modules/boxes/templates/card_acceptance.php';
         $data = ob_get_clean();
         $oscTemplate->addBlock($data, $this->group);
     }
 }
Esempio n. 30
0
 function _setData()
 {
     global $osC_Database, $template;
     $this->_data = '<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable">' . '  <thead>' . '    <tr>' . '      <th>' . MODULE_SUMMARY_CUSTOMERS_HEADING_CUSTOMERS . '</th>' . '      <th>' . MODULE_SUMMARY_CUSTOMERS_HEADING_DATE . '</th>' . '      <th>' . MODULE_SUMMARY_CUSTOMERS_HEADING_STATUS . '</th>' . '    </tr>' . '  </thead>' . '  <tbody>';
     $Qcustomers = $osC_Database->query('select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_status, ci.customers_info_date_account_created from :table_customers c, :table_customers_info ci where c.customers_id = ci.customers_info_id order by ci.customers_info_date_account_created desc limit 6');
     $Qcustomers->bindTable(':table_customers', TABLE_CUSTOMERS);
     $Qcustomers->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
     $Qcustomers->execute();
     while ($Qcustomers->next()) {
         $this->_data .= '    <tr onMouseOver="rowOverEffect(this);" onMouseOut="rowOutEffect(this);">' . '      <td><a href="' . tep_href_link(FILENAME_CUSTOMERS, 'cID=' . $Qcustomers->valueInt('customers_id') . '&action=cEdit') . '">' . tep_image('templates/' . $template . '/images/icons/16x16/personal.png', ICON_PREVIEW, '16', '16') . '&nbsp;' . $Qcustomers->valueProtected('customers_firstname') . ' ' . $Qcustomers->valueProtected('customers_lastname') . '</a></td>' . '      <td>' . $Qcustomers->value('customers_info_date_account_created') . '</td>' . '      <td align="center">' . tep_image('templates/' . $template . '/images/icons/' . ($Qcustomers->valueInt('customers_status') === 1 ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif')) . '</td>' . '    </tr>';
     }
     $Qcustomers->freeResult();
     $this->_data .= '  </tbody>' . '</table>';
 }