}
            } else {
                $product_price = $currencies->display_price($products_prices[0][0]['regular'], $products_tax_rate);
                $products_prices[0]['special_status'] == 1 && $products_prices[0][0]['special'] > 0 ? $product_price_special = $currencies->display_price($products_prices[0][0]['special'], $products_tax_rate) : ($product_price_special = '');
                $sizeof = count($products_prices[0]);
                if ($sizeof > 2) {
                    $array_keys = array_keys($products_prices[0]);
                    for ($count = 2, $n = $sizeof; $count < $n; $count++) {
                        $qty = $array_keys[$count];
                        $price_breaks_array[] = array('qty' => $qty, 'price_break' => $currencies->display_price($products_prices[0][$qty]['regular'], $products_tax_rate), 'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : '');
                    }
                }
            }
            $product_image = xos_get_product_images($products_new['products_image']);
            $popup_content_id = xos_get_delivery_times_values($products_new['products_delivery_time_id'], 'popup_content_id');
            $products_new_array[] = array('link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $products_new['products_id']), 'href_buy_now' => xos_href_link(FILENAME_PRODUCTS_NEW, xos_get_all_get_params(array('action')) . 'action=buy_now&p=' . $products_new['products_id']), 'date_added' => xos_date_long($products_new['products_date_added']), 'image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $products_new['products_name'], '', '', 'class="img-responsive"'), 'td_width_img' => SMALL_PRODUCT_IMAGE_MAX_WIDTH + 10, 'manufacturer' => $products_new['manufacturers_name'], 'tax_description' => xos_get_products_tax_description($products_new['products_tax_class_id'], $products_tax_rate), 'products_delivery_time' => xos_get_delivery_times_values($products_new['products_delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $products_new['products_id'], $request_type) : '', 'price' => $product_price, 'price_special' => $product_price_special, 'price_breaks' => $price_breaks_array, 'info' => $products_new['products_info'], 'products_p_unit' => $products_new['products_p_unit'], 'products_model' => $products_new['products_model'], 'products_quantity' => $products_new['products_quantity'], 'name' => $products_new['products_name']);
            unset($price_breaks_array);
        }
        if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_top', true);
        }
        if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_bottom', true);
        }
        $smarty->assign('new_products', true);
    }
    $smarty->assign(array('nav_bar_number' => $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW), 'nav_bar_result' => '<nav><ul class="pagination">' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>', 'interval_days_back' => INTERVAL_DAYS_BACK, 'products_new' => $products_new_array));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'products_new');
}
$output_products_new = $smarty->fetch(SELECTED_TPL . '/products_new.tpl', $cache_id);
$smarty->assign('central_contents', $output_products_new);
require DIR_WS_INCLUDES . 'header.php';
require DIR_WS_INCLUDES . 'footer.php';
$orders_total = xos_count_customer_orders();
if ($orders_total > 0) {
    $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int) $_SESSION['customer_id'] . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int) $_SESSION['languages_id'] . "' and s.public_flag = '1' group by o.orders_id order by o.orders_id DESC";
    $history_split = new splitPageResultsBootstrap($history_query_raw, MAX_DISPLAY_ORDER_HISTORY, 'o.orders_id');
    $history_query = xos_db_query($history_split->sql_query);
    $orders_array = array();
    while ($history = xos_db_fetch_array($history_query)) {
        $products_query = xos_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $history['orders_id'] . "'");
        $products = xos_db_fetch_array($products_query);
        $oder_total_query = xos_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $history['orders_id'] . "' and class = 'ot_total' order by orders_total_id DESC limit 1");
        $oder_total = xos_db_fetch_array($oder_total_query);
        if (xos_not_null($history['delivery_name'])) {
            $order_type = 'shipped_to';
            $order_name = $history['delivery_name'];
        } else {
            $order_type = 'billed_to';
            $order_name = $history['billing_name'];
        }
        $orders_array[] = array('link_filename_account_history_info' => xos_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL'), 'order_id' => $history['orders_id'], 'order_status_name' => $history['orders_status_name'], 'date_purchased' => xos_date_long($history['date_purchased']), 'order_type' => $order_type, 'order_name' => xos_output_string_protected($order_name), 'products_count' => $products['count'], 'order_total' => strip_tags($oder_total['text']));
    }
    $smarty->assign(array('orders' => true, 'nav_bar_number' => $history_split->display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS), 'nav_bar_result' => '<nav><ul class="pagination">' . $history_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>'));
}
$smarty->assign(array('orders_array' => $orders_array, 'link_filename_account' => xos_href_link(FILENAME_ACCOUNT, '', 'SSL')));
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'account_history');
$output_account_history = $smarty->fetch(SELECTED_TPL . '/account_history.tpl');
$smarty->assign('central_contents', $output_account_history);
$smarty->display(SELECTED_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
return 'overwrite_all';
    $order_totals_array = array();
    for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
        $order_totals_array[] = array('totals_title' => $order->totals[$i]['title'], 'totals_text' => $order->totals[$i]['text'], 'totals_tax' => $order->totals[$i]['class'] == 'ot_shipping' || $order->totals[$i]['class'] == 'ot_loworderfee' || $order->totals[$i]['class'] == 'ot_cod_fee' ? xos_display_tax_value($order->totals[$i]['tax']) : -1);
    }
    $statuses_query = xos_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int) $_GET['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int) $_SESSION['languages_id'] . "' and os.public_flag = '1' order by osh.date_added, osh.orders_status_history_id");
    $statuses_array = array();
    while ($statuses = xos_db_fetch_array($statuses_query)) {
        $statuses_array[] = array('order_date_added' => xos_date_short($statuses['date_added']), 'order_status_name' => $statuses['orders_status_name'], 'order_comments' => empty($statuses['comments']) ? '&nbsp;' : nl2br(xos_output_string_protected($statuses['comments'])));
    }
    $back = sizeof($_SESSION['navigation']->path) - 2;
    if (!empty($_SESSION['navigation']->path[$back])) {
        $get_params_array = $_SESSION['navigation']->path[$back]['get'];
        $get_params_array['rmp'] = '0';
        $back_link = xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']);
    } else {
        $back_link = 'javascript:history.go(-1)';
    }
    $smarty->assign(array('order_id' => $_GET['order_id'], 'orders_status' => $order->info['orders_status'], 'date_purchased' => xos_date_long($order->info['date_purchased']), 'order_total' => $order->info['total'], 'order_products' => $order_products_array, 'billing_address' => xos_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br />'), 'payment_method' => $order->info['payment_method'], 'order_totals' => $order_totals_array, 'statuses' => $statuses_array, 'link_back' => $back_link));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'account_history_info');
    $language_directory_query = xos_db_query("select directory from " . TABLE_LANGUAGES . " where use_in_id > '1' and directory = '" . $order->info['language_directory'] . "'");
    if (xos_db_num_rows($language_directory_query)) {
        $smarty->configLoad('languages/' . $order->info['language_directory'] . '.conf', 'order_info');
    }
    if (DOWNLOAD_ENABLED == 'true') {
        include DIR_WS_MODULES . 'downloads.php';
    }
    $output_account_history_info = $smarty->fetch(SELECTED_TPL . '/account_history_info.tpl');
    $smarty->assign('central_contents', $output_account_history_info);
    $smarty->display(SELECTED_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
                $smarty->assign('qty_for_these_options', $att_qty > 0 ? $att_qty : '<span class="red-mark">' . $att_qty . '</span>');
            }
            $smarty->assign(array('link_options_noscript' => xos_href_link(FILENAME_OPTIONS_WINDOW, 'p=' . $product_info['products_id'] . '&products_name=' . urlencode($product_info['products_name'])), 'get_otions_list' => 'getOptionsList(\'' . xos_href_link(FILENAME_OPTIONS_LIST, 'p=' . xos_get_prid($_GET['p']), 'NONSSL', true, false) . '\');', 'products_options' => $product_options_array));
        }
        $reviews_query = xos_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int) $_GET['p'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $_SESSION['languages_id'] . "'");
        $reviews = xos_db_fetch_array($reviews_query);
        if ($reviews['count'] > 0) {
            $smarty->assign('reviews_count', $reviews['count']);
        }
        if (xos_not_null($product_info['products_url'])) {
            $smarty->assign('link_products_url', xos_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false));
        }
        if ($product_info['products_date_available'] > 0) {
            $smarty->assign('products_date_available', xos_date_long($product_info['products_date_available']));
        } else {
            $smarty->assign('products_date_added', xos_date_long($product_info['products_date_added']));
        }
        if (PRODUCT_REVIEWS_ENABLED == 'true') {
            $smarty->assign('link_filename_product_reviews', xos_href_link(FILENAME_PRODUCT_REVIEWS, xos_get_all_get_params(array('lnc', 'cur', 'tpl'))));
        }
        $smarty->assign(array('input_products_quantity' => xos_draw_input_field('products_quantity', '1', 'id="products_quantity" style="text-align: center; width: 60px;" class="form-control" maxlength="5"'), 'hidden_field_products_id' => xos_draw_hidden_field('p', $product_info['products_id']), 'javascript' => $jscript_op, 'form_begin' => xos_draw_form('cart_quantity', xos_href_link(FILENAME_PRODUCT_INFO, xos_get_all_get_params(array('action')) . 'action=add_product')), 'form_end' => '</form>'));
        $smarty->caching = 0;
        include DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS;
        include DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS;
        if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true') && !isset($_GET['noscript'])) {
            $smarty->caching = 1;
        }
    }
    $smarty->assign('link_filename_default', xos_href_link(FILENAME_DEFAULT));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_info');
}
Beispiel #5
0
 require DIR_WS_INCLUDES . 'boxes.php';
 require DIR_WS_INCLUDES . 'header.php';
 require DIR_WS_INCLUDES . 'footer.php';
 if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) {
     $smarty->caching = 1;
     $cache_id = 'L3|cc_reviews|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency'];
 }
 if (!$smarty->isCached(SELECTED_TPL . '/reviews.tpl', $cache_id)) {
     $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_or_pages_status = '1' and p.products_id = p2c.products_id and p2c.categories_or_pages_id = c.categories_or_pages_id and p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "' and rd.languages_id = '" . (int) $_SESSION['languages_id'] . "' order by r.reviews_id DESC";
     $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
     if ($reviews_split->number_of_rows > 0) {
         $reviews_query = xos_db_query($reviews_split->sql_query);
         $reviews_array = array();
         while ($reviews = xos_db_fetch_array($reviews_query)) {
             $product_image = xos_get_product_images($reviews['products_image']);
             $reviews_array[] = array('link_filename_product_reviews_info' => xos_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'p=' . $reviews['products_id'] . '&r=' . $reviews['reviews_id']), 'date_added' => xos_date_long($reviews['date_added']), 'products_image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $reviews['products_name']), 'td_width_img' => SMALL_PRODUCT_IMAGE_MAX_WIDTH + 10, 'reviews_rating' => $reviews['reviews_rating'], 'review_text' => xos_break_string(xos_output_string_protected($reviews['reviews_text']), 60, '-<br />'), 'stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'customers_name' => xos_output_string_protected($reviews['customers_name']), 'products_name' => $reviews['products_name']);
         }
         if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
             $smarty->assign('nav_bar_top', true);
         }
         if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
             $smarty->assign('nav_bar_bottom', true);
         }
         $smarty->assign('reviews', true);
     }
     $smarty->assign(array('nav_bar_number' => $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS), 'nav_bar_result' => TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))), 'nav_bar_result_in_pull_down_menu' => $reviews_split->display_links_in_pull_down_menu(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))), 'reviews_array' => $reviews_array));
     $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'reviews');
 }
 $output_reviews = $smarty->fetch(SELECTED_TPL . '/reviews.tpl', $cache_id);
 $smarty->assign('central_contents', $output_reviews);
 $smarty->caching = 0;
require DIR_WS_INCLUDES . 'boxes.php';
require DIR_WS_INCLUDES . 'header.php';
require DIR_WS_INCLUDES . 'footer.php';
if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) {
    $smarty->caching = 1;
    $cache_id = 'L3|cc_product_reviews|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency'] . '-' . $_SESSION['sppc_customer_group_id'] . '-' . $_SESSION['sppc_customer_group_show_tax'] . '-' . $_SESSION['sppc_customer_group_tax_exempt'] . '-' . $_GET['c'] . '-' . $_GET['m'] . '-' . $_GET['p'];
}
if (!$smarty->isCached(SELECTED_TPL . '/product_reviews.tpl', $cache_id)) {
    $product_info = xos_db_fetch_array($product_info_query);
    $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int) $product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int) $_SESSION['languages_id'] . "' order by r.reviews_id desc";
    $reviews_split = new splitPageResultsBootstrap($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
    if ($reviews_split->number_of_rows > 0) {
        $reviews_query = xos_db_query($reviews_split->sql_query);
        $product_reviews_array = array();
        while ($reviews = xos_db_fetch_array($reviews_query)) {
            $product_reviews_array[] = array('link_filename_product_reviews_info' => xos_href_link(FILENAME_PRODUCT_REVIEWS_INFO, xos_get_all_get_params(array('lnc', 'cur', 'tpl')) . 'r=' . $reviews['reviews_id']), 'date_added' => xos_date_long($reviews['date_added']), 'reviews_rating' => $reviews['reviews_rating'], 'review_text' => xos_break_string(xos_output_string_protected($reviews['reviews_text']), 60, '-<br />'), 'stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'customers_name' => xos_output_string_protected($reviews['customers_name']));
        }
        if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_top', true);
        }
        if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_bottom', true);
        }
        $smarty->assign(array('product_reviews_array' => $product_reviews_array, 'product_reviews' => true));
    }
    $products_image_name = xos_get_product_images($product_info['products_image']);
    if (xos_not_null($products_image_name)) {
        $smarty->assign(array('product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), addslashes($product_info['products_name']), '', '', 'class="img-responsive"')));
    }
    $smarty->assign(array('products_name' => $product_info['products_name'], 'products_model' => $product_info['products_model'], 'link_filename_product_reviews_write' => xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'rmp')), 'SSL'), 'nav_bar_number' => $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS), 'nav_bar_result' => '<nav><ul class="pagination">' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_reviews');
             $popup_img = DIR_WS_IMAGES . 'products/large/' . $products_img_name['name'];
             $pop_size = @GetImageSize("{$popup_img}");
             if ($pop_size[0] > $pop_width) {
                 $pop_width = $pop_size[0];
             }
             if ($pop_size[1] > $pop_height) {
                 $pop_height = $pop_size[1];
             }
         }
         if ($small_width_total > $pop_width) {
             $pop_width = $small_width_total;
         }
         $product_image = array_shift($products_image_name);
         $smarty->assign(array('box_width' => (int) ($pop_width + 50), 'box_height' => (int) ($pop_height + $small_height + 55), 'link_product_img' => xos_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $review['products_id'] . '&img_name=' . rawurlencode($product_image['name'])), 'link_product_img_noscript' => xos_href_link(FILENAME_IMAGES_WINDOW, 'pID=' . $review['products_id'], 'NONSSL', true, false, false, false, false), 'product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($product_image['name']), addslashes($review['products_name']), '', '', 'style="margin: 5px;"')));
     }
     $smarty->assign(array('date_added' => xos_date_long($review['date_added']), 'review_rating' => $review['reviews_rating'], 'review_text' => xos_break_string(nl2br(xos_output_string_protected($review['reviews_text'])), 60, '-<br />'), 'stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $review['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])), 'customers_name' => xos_output_string_protected($review['customers_name']), 'products_name' => $review['products_name'], 'products_p_unit' => $review['products_p_unit'], 'products_model' => $review['products_model'], 'products_quantity' => $review['products_quantity'], 'products_price' => $product_price, 'products_price_special' => $product_price_special, 'products_price_breaks' => $price_breaks_array, 'products_tax_description' => xos_get_products_tax_description($review['products_tax_class_id'], $products_tax_rate), 'td_width_img' => MEDIUM_PRODUCT_IMAGE_MAX_WIDTH + 10, 'link_filename_product_reviews_write' => xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'rmp')), 'SSL'), 'link_buy_now' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action')) . 'action=buy_now')));
     $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_reviews_info');
 }
 // link_back will not be cached (nocache)
 $back = sizeof($_SESSION['navigation']->path) - 2;
 if (!empty($_SESSION['navigation']->path[$back])) {
     $get_params_array = $_SESSION['navigation']->path[$back]['get'];
     $get_params_array['rmp'] = '0';
     $smarty->assign('link_back', xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']), true);
 } else {
     $smarty->assign('link_back', 'javascript:history.go(-1)', true);
 }
 $output_product_reviews_info = $smarty->fetch(SELECTED_TPL . '/product_reviews_info.tpl', $cache_id);
 $smarty->assign('central_contents', $output_product_reviews_info);
 $smarty->caching = 0;
 $smarty->display(SELECTED_TPL . '/frame.tpl');
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'admin/templates/' . ADMIN_TPL . '/php/includes/modules/product_preview.php') == 'overwrite_all')) {
    $product_query = xos_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_info, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int) $_GET['pID'] . "'");
    $product = xos_db_fetch_array($product_query);
    $pInfo = new objectInfo($product);
    $product_image = xos_get_product_images($pInfo->products_image);
    $products_prices = xos_get_product_prices($pInfo->products_price);
    $languages = xos_get_languages();
    $products_array = array();
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        $pInfo->products_url = xos_get_products_url($pInfo->products_id, $languages[$i]['id']);
        if ($pInfo->products_date_available > date('Y-m-d')) {
            $date = sprintf(TEXT_PRODUCT_DATE_AVAILABLE, xos_date_long($pInfo->products_date_available));
        } else {
            $date = sprintf(TEXT_PRODUCT_DATE_ADDED, xos_date_long($pInfo->products_date_added));
        }
        $products_array[] = array('lang_image' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']), 'name' => xos_get_products_name($pInfo->products_id, $languages[$i]['id']), 'price' => $currencies->format($products_prices[0][0]['regular']), 'image' => $product_image['name'] ? xos_image(DIR_WS_CATALOG_IMAGES . 'products/small/' . $product_image['name'], $pInfo->products_name, '', '', 'align="right" hspace="5" vspace="5"') : '', 'info' => xos_get_products_info($pInfo->products_id, $languages[$i]['id']), 'description' => xos_get_products_description($pInfo->products_id, $languages[$i]['id']), 'info_url' => $pInfo->products_url ? sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url) : '', 'date_available_or_date_added' => $date);
    }
    if (isset($_GET['origin'])) {
        $pos_params = strpos($_GET['origin'], '?', 0);
        if ($pos_params != false) {
            $back_url = substr($_GET['origin'], 0, $pos_params);
            $back_url_params = substr($_GET['origin'], $pos_params + 1);
        } else {
            $back_url = $_GET['origin'];
            $back_url_params = '';
        }
    } else {
        $back_url = FILENAME_CATEGORIES;
        $back_url_params = 'cPath=' . $cPath . '&pID=' . $pInfo->products_id;
Beispiel #9
0
    }
    // Now get all downloadable products in that order
    $downloads_query = xos_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd, " . TABLE_ORDERS_STATUS . " os where o.customers_id = '" . (int) $_SESSION['customer_id'] . "' and o.orders_id = '" . (int) $last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != '' and o.orders_status = os.orders_status_id and os.downloads_flag = '1' and os.language_id = '" . (int) $_SESSION['languages_id'] . "'");
    if (xos_db_num_rows($downloads_query) > 0) {
        $download_products_array = array();
        while ($downloads = xos_db_fetch_array($downloads_query)) {
            // MySQL 3.22 does not have INTERVAL
            list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
            $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);
            $download_expiry = date('Y-m-d H:i:s', $download_timestamp);
            // The link will appear only if:
            // - Download remaining count is > 0, AND
            // - The file is present in the DOWNLOAD directory, AND EITHER
            // - No expiry date is enforced (maxdays == 0), OR
            // - The expiry date is not reached
            if ($downloads['download_count'] > 0 && file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']) && ($downloads['download_maxdays'] == 0 || $download_timestamp > time())) {
                $products_name = '<a href="' . xos_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '</a>';
            } else {
                $products_name = $downloads['products_name'];
            }
            $download_products_array[] = array('name' => $products_name, 'expiry_date' => xos_date_long($download_expiry), 'count' => $downloads['download_count']);
        }
        if (!strstr(basename($_SERVER['PHP_SELF']), FILENAME_ACCOUNT_HISTORY_INFO)) {
            $smarty->assign('download_link', '<a href="' . xos_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>');
        }
        $smarty->assign('download_products', $download_products_array);
        $output_downloads = $smarty->fetch(SELECTED_TPL . '/includes/modules/downloads.tpl');
        $smarty->clearAssign(array('download_link', 'download_products'));
        $smarty->assign('downloads', $output_downloads);
    }
}