$options_values_price = $order->products[$i]['attributes'][$j]['price_formated']; } $order_attributes_array[] = array('option_name' => $order->products[$i]['attributes'][$j]['option'], 'option_value_name' => $order->products[$i]['attributes'][$j]['value'], 'option_price' => $options_values_price, 'option_price_prefix' => $order->products[$i]['attributes'][$j]['prefix']); } } $order_products_array[] = array('qty' => $order->products[$i]['qty'], 'model' => $order->products[$i]['model'], 'name' => $order->products[$i]['name'], 'packaging_unit' => $order->products[$i]['packaging_unit'], 'tax' => xos_display_tax_value($order->products[$i]['tax']), 'price' => $order->products[$i]['price_formated'], 'final_single_price' => $order->products[$i]['final_price_formated'], 'final_price' => $order->products[$i]['total_price_formated'], 'products_attributes_option_price' => $attributes_options_values_price, 'product_attributes' => $order_attributes_array); unset($order_attributes_array); } $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']) ? ' ' : 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 ($messageStack->size('checkout_address') > 0) { $smarty->assign('message_stack', $messageStack->output('checkout_address')); $smarty->assign('message_stack_error', $messageStack->output('checkout_address', 'error')); $smarty->assign('message_stack_warning', $messageStack->output('checkout_address', 'warning')); $smarty->assign('message_stack_success', $messageStack->output('checkout_address', 'success')); } if ($process == false) { $smarty->assign('address_label', xos_address_label($_SESSION['customer_id'], $_SESSION['billto'], true, ' ', '<br />')); if ($addresses_count > 1) { $radio_buttons = 0; $addresses_query = xos_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $_SESSION['customer_id'] . "'"); $addresses_array = array(); while ($addresses = xos_db_fetch_array($addresses_query)) { $format_id = xos_get_address_format_id($addresses['country_id']); $addresses['address_book_id'] == $_SESSION['billto'] ? $actual_address = true : ($actual_address = false); $addresses_array[] = array('radio_field' => xos_draw_radio_field('address', $addresses['address_book_id'], $addresses['address_book_id'] == $_SESSION['billto'], 'id="address_' . $radio_buttons . '"'), 'actual_address' => $actual_address, 'address_name' => xos_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']), 'full_address' => xos_address_format($format_id, $addresses, true, ' ', ', '), 'radio_select' => $radio_buttons); $radio_buttons++; } $smarty->assign(array('several_addresses' => true, 'addresses' => $addresses_array)); } } if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) { $smarty->assign('not_max_address_book_entries', true); } if ($process == true) { $smarty->assign(array('process' => true, 'link_filename_checkout_payment_address' => xos_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'))); } $smarty->assign(array('form_begin' => xos_draw_form('checkout_address', xos_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'), 'post', 'onsubmit="return true;"', true), 'form_end' => '</form>', 'hidden_field_submit' => xos_draw_hidden_field('action', 'submit'), 'link_filename_checkout_shipping' => xos_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'))); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'checkout_payment_address'); $output_checkout_payment_address = $smarty->fetch(SELECTED_TPL . '/checkout_payment_address.tpl'); $smarty->assign('central_contents', $output_checkout_payment_address);
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;
// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with XOS-Shop. If not, see <http://www.gnu.org/licenses/>. //------------------------------------------------------------------------------ // this file is based on: // osCommerce, Open Source E-Commerce Solutions // http://www.oscommerce.com // Copyright (c) 2013 osCommerce // filename: action_recorder.php // // Released under the GNU General Public License //////////////////////////////////////////////////////////////////////////////// if (!(@(include DIR_FS_SMARTY . 'admin/templates/' . ADMIN_TPL . '/php/includes/boxes/infobox_action_recorder.php') == 'overwrite_all')) { $contents = array(); switch ($action) { default: if (isset($aInfo) && is_object($aInfo)) { $heading_title = '<b>' . $aInfo->module . '</b>'; $contents[] = array('text' => TEXT_INFO_IDENTIFIER . '<br />' . (!empty($aInfo->identifier) ? '<a href="' . xos_href_link(FILENAME_ACTION_RECORDER, 'search=' . $aInfo->identifier) . '"><u>' . xos_output_string_protected($aInfo->identifier) . '</u></a>' : '(empty)')); $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . xos_datetime_short($aInfo->date_added)); } break; } $smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_contents' => $contents)); $output_infobox_action_recorder = $smarty->fetch(ADMIN_TPL . '/includes/boxes/infobox_action_recorder.tpl'); $smarty->clearAssign(array('info_box_heading_title', 'info_box_contents')); $smarty->assign('infobox_action_recorder', $output_infobox_action_recorder); }
$order = xos_db_fetch_array($order_query); if ($order['orders_status'] == MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID) { $sql_data_array = array('orders_id' => $_POST['invoice'], 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => ''); xos_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); xos_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID) . "', last_modified = now() where orders_id = '" . (int) $_POST['invoice'] . "'"); } $total_query = xos_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $_POST['invoice'] . "' and class = 'ot_total' limit 1"); $total = xos_db_fetch_array($total_query); $comment_status = $_POST['payment_status'] . ' (' . ucfirst($_POST['payer_status']) . '; ' . $currencies->format($_POST['mc_gross'], false, $_POST['mc_currency']) . ')'; if ($_POST['payment_status'] == 'Pending') { $comment_status .= '; ' . $_POST['pending_reason']; } elseif ($_POST['payment_status'] == 'Reversed' || $_POST['payment_status'] == 'Refunded') { $comment_status .= '; ' . $_POST['reason_code']; } if ($_POST['mc_gross'] != number_format($total['value'], $currencies->get_decimal_places($order['currency']))) { $comment_status .= '; PayPal transaction value (' . xos_output_string_protected($_POST['mc_gross']) . ') does not match order value (' . number_format($total['value'], $currencies->get_decimal_places($order['currency'])) . ')'; } // if ($_POST['mc_gross'] != number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency']))) { // $comment_status .= '; PayPal transaction value (' . xos_output_string_protected($_POST['mc_gross']) . ') does not match order value (' . number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency'])) . ')'; // } $sql_data_array = array('orders_id' => $_POST['invoice'], 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? (int) MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : (int) DEFAULT_ORDERS_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => 'PayPal IPN Verified [' . $comment_status . ']'); xos_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); } } } else { if (SEND_EMAILS == 'true' && xos_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_DEBUG_EMAIL)) { $email_body = '$_POST:' . "\n\n"; reset($_POST); while (list($key, $value) = each($_POST)) { $email_body .= $key . '=' . $value . "\n"; }
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';
if ($order_totals[$i]['tax'] > -1) { $tax_rates[$order_totals[$i]['tax']] = '1'; } } } if (is_array($payment_modules->modules)) { if ($confirmation = $payment_modules->confirmation()) { $confirmation_fields_array = array(); for ($i = 0, $n = sizeof($confirmation['fields']); $i < $n; $i++) { $confirmation_fields_array[] = array('title' => $confirmation['fields'][$i]['title'], 'field' => $confirmation['fields'][$i]['field']); } $smarty->assign(array('confirmation' => true, 'confirmation_title' => $confirmation['title'], 'confirmation_fields' => $confirmation_fields_array)); } } if (xos_not_null($order->info['comments'])) { $smarty->assign(array('comments' => nl2br(xos_output_string_protected($order->info['comments'])), 'hidden_field_comments' => xos_draw_hidden_field('comments', $order->info['comments']))); } if (isset(${$_SESSION['payment']}->form_action_url)) { $form_action_url = ${$_SESSION['payment']}->form_action_url; } else { $form_action_url = xos_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); } if (is_array($payment_modules->modules)) { $smarty->assign('input_process_button', $payment_modules->process_button()); } if (sizeof($tax_rates) > 1 && $_SESSION['sppc_customer_group_tax_exempt'] != '1') { $smarty->assign('tax_groups', true); } $popup_status_query = xos_db_query("select status from " . TABLE_CONTENTS . " where type = 'system_popup' and status = '1' and content_id = '8' LIMIT 1"); $smarty->assign(array('form_begin' => xos_draw_form('checkout_confirmation', $form_action_url, 'post', 'onsubmit="return check_form();"'), 'form_end' => '</form>', 'link_filename_popup_content_8' => xos_db_num_rows($popup_status_query) ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=8', $request_type) : '', 'order_products' => $order_products_array, 'billing_address' => xos_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br />'), 'payment_method' => $order->info['payment_method'], 'link_filename_shopping_cart' => xos_href_link(FILENAME_SHOPPING_CART), 'link_filename_checkout_payment_address' => xos_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'), 'link_filename_checkout_payment' => xos_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'), 'link_filename_checkout_shipping' => xos_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'order_totals' => $order_totals_array)); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'checkout_confirmation');
function xos_address_format($address_format_id, $address, $html, $boln, $eoln) { $address_format_query = xos_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int) $address_format_id . "'"); $address_format = xos_db_fetch_array($address_format_query); $company = xos_output_string_protected($address['company']); if (isset($address['firstname']) && xos_not_null($address['firstname'])) { $firstname = xos_output_string_protected($address['firstname']); $lastname = xos_output_string_protected($address['lastname']); } elseif (isset($address['name']) && xos_not_null($address['name'])) { $firstname = xos_output_string_protected($address['name']); $lastname = ''; } else { $firstname = ''; $lastname = ''; } $street = xos_output_string_protected($address['street_address']); $suburb = xos_output_string_protected($address['suburb']); $city = xos_output_string_protected($address['city']); $state = xos_output_string_protected($address['state']); if (isset($address['country_id']) && xos_not_null($address['country_id'])) { $country = xos_get_country_name($address['country_id']); if (isset($address['zone_id']) && xos_not_null($address['zone_id'])) { $state = xos_get_zone_code($address['country_id'], $address['zone_id'], $state); } } elseif (isset($address['country']) && xos_not_null($address['country'])) { $country = xos_output_string_protected($address['country']); } else { $country = ''; } $postcode = xos_output_string_protected($address['postcode']); $zip = $postcode; if ($html) { // HTML Mode $HR = '<hr />'; $hr = '<hr />'; if ($boln == '' && $eoln == "\n") { // Values not specified, use rational defaults $CR = '<br />'; $cr = '<br />'; $eoln = $cr; } else { // Use values supplied $CR = $eoln . $boln; $cr = $CR; } } else { // Text Mode $CR = $eoln; $cr = $CR; $HR = '----------------------------------------'; $hr = '----------------------------------------'; } $statecomma = ''; $streets = $street; if ($suburb != '') { $streets = $street . $cr . $suburb; } if ($state != '') { $statecomma = $state . ', '; } $fmt = $address_format['format']; eval("\$address = \"{$fmt}\";"); if (ACCOUNT_COMPANY == 'true' && xos_not_null($company)) { $address = $company . $cr . $address; } return $address; }
$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');
function xos_draw_textarea_field($name, $width, $height, $text = '', $parameters = '', $reinsert_value = true) { $field = '<textarea name="' . xos_output_string($name) . '" cols="' . xos_output_string($width) . '" rows="' . xos_output_string($height) . '"'; if (xos_not_null($parameters)) { $field .= ' ' . $parameters; } $field .= '>'; if (xos_not_null($text)) { $field .= xos_output_string_protected($text); } elseif (isset($GLOBALS[$name]) && $reinsert_value == true) { $field .= xos_output_string_protected(stripslashes($GLOBALS[$name])); } $field .= '</textarea>'; return $field; }
while ($actions = xos_db_fetch_array($actions_query)) { $module_title = $actions['module']; if (is_object(${$actions['module']})) { $module_title = ${$actions['module']}->title; } if ((!isset($_GET['aID']) || isset($_GET['aID']) && $_GET['aID'] == $actions['id']) && !isset($aInfo)) { $actions_extra_query = xos_db_query("select identifier from " . TABLE_ACTION_RECORDER . " where id = '" . (int) $actions['id'] . "'"); $actions_extra = xos_db_fetch_array($actions_extra_query); $aInfo_array = array_merge($actions, $actions_extra, array('module' => $module_title)); $aInfo = new objectInfo($aInfo_array); } $selected = false; if (isset($aInfo) && is_object($aInfo) && $actions['id'] == $aInfo->id) { $selected = true; } $actions_array[] = array('selected' => $selected, 'link_filename_action_recorder' => xos_href_link(FILENAME_ACTION_RECORDER, xos_get_all_get_params(array('aID')) . 'aID=' . $actions['id']), 'module_title' => $module_title, 'success_flag' => $actions['success'] == '1' ? true : false, 'user_name' => xos_output_string_protected($actions['user_name']), 'user_id' => (int) $actions['user_id'], 'date_added' => xos_datetime_short($actions['date_added'])); } if (SESSID) { $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id())); } if (!empty($actions_array) && empty($_GET['search'])) { $smarty->assign('link_filename_action_recorder_delete', xos_href_link(FILENAME_ACTION_RECORDER, 'action=expire' . (isset($_GET['module']) && in_array($_GET['module'], $modules_array) ? '&module=' . $_GET['module'] : ''))); } $smarty->assign(array('form_begin_search' => xos_draw_form('search', FILENAME_ACTION_RECORDER, '', 'get'), 'input_search' => xos_draw_input_field('search', isset($_GET['search']) ? xos_output_string_protected($_GET['search']) : ''), 'hidden_module' => xos_draw_hidden_field('module', isset($_GET['module']) ? xos_output_string_protected($_GET['module']) : ''), 'hidden_search' => xos_draw_hidden_field('search', isset($_GET['search']) ? xos_output_string_protected($_GET['search']) : ''), 'form_begin_filter' => xos_draw_form('filter', FILENAME_ACTION_RECORDER, '', 'get'), 'pull_down_module' => xos_draw_pull_down_menu('module', $modules_list_array, isset($_GET['module']) ? xos_output_string_protected($_GET['module']) : '', 'onchange="this.form.submit();"'), 'form_end' => '</form>', 'actions' => $actions_array, 'nav_bar_number' => $actions_split->display_count($actions_query_numrows, MAX_DISPLAY_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ENTRIES), 'nav_bar_result' => $actions_split->display_links($actions_query_numrows, MAX_DISPLAY_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], (isset($_GET['module']) && in_array($_GET['module'], $modules_array) && is_object(${$_GET['module']}) ? 'module=' . $_GET['module'] : null) . '&' . (isset($_GET['search']) && !empty($_GET['search']) ? 'search=' . $_GET['search'] : null)))); require DIR_WS_BOXES . 'infobox_action_recorder.php'; $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'action_recorder'); $output_action_recorder = $smarty->fetch(ADMIN_TPL . '/action_recorder.tpl'); $smarty->assign('central_contents', $output_action_recorder); $smarty->display(ADMIN_TPL . '/frame.tpl'); require DIR_WS_INCLUDES . 'application_bottom.php'; }
$_SESSION['navigation']->set_snapshot(); xos_redirect(xos_href_link(FILENAME_LOGIN, '', 'SSL')); } require DIR_FS_SMARTY . 'catalog/languages/' . $_SESSION['language'] . '/' . FILENAME_ADDRESS_BOOK; $site_trail->add(NAVBAR_TITLE_1, xos_href_link(FILENAME_ACCOUNT, '', 'SSL')); $site_trail->add(NAVBAR_TITLE_2, xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); $add_header = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'function rowOverEffect(object) {' . "\n" . ' if (object.className == "module-row") object.className = "module-row-over";' . "\n" . '}' . "\n\n" . 'function rowOutEffect(object) {' . "\n" . ' if (object.className == "module-row-over") object.className = "module-row";' . "\n" . '}' . "\n" . '/* ]]> */' . "\n" . '</script> ' . "\n"; require DIR_WS_INCLUDES . 'html_header.php'; require DIR_WS_INCLUDES . 'boxes.php'; require DIR_WS_INCLUDES . 'header.php'; require DIR_WS_INCLUDES . 'footer.php'; $addresses_query = xos_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $_SESSION['customer_id'] . "' order by firstname, lastname"); $addresses_array = array(); while ($addresses = xos_db_fetch_array($addresses_query)) { $format_id = xos_get_address_format_id($addresses['country_id']); $addresses_array[] = array('name' => xos_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']), 'primary_address' => $addresses['address_book_id'] == $_SESSION['customer_default_address_id'] ? true : false, 'link_filename_address_book_process_edit' => xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $addresses['address_book_id'], 'SSL'), 'link_filename_address_book_process_delete' => xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $addresses['address_book_id'], 'SSL'), 'format_address' => xos_address_format($format_id, $addresses, true, ' ', '<br />'), 'order_total' => $orders['order_total']); } if (xos_count_customer_address_book_entries() < MAX_ADDRESS_BOOK_ENTRIES) { $smarty->assign('link_filename_address_book_process', xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL')); } if ($messageStack->size('addressbook') > 0) { $smarty->assign('message_stack', $messageStack->output('addressbook')); $smarty->assign('message_stack_error', $messageStack->output('addressbook', 'error')); $smarty->assign('message_stack_warning', $messageStack->output('addressbook', 'warning')); $smarty->assign('message_stack_success', $messageStack->output('addressbook', 'success')); } $smarty->assign(array('addresses' => $addresses_array, 'primary_address_label' => xos_address_label($_SESSION['customer_id'], $_SESSION['customer_default_address_id'], true, ' ', '<br />'), 'link_filename_account' => xos_href_link(FILENAME_ACCOUNT, '', 'SSL'), 'max_address_book_entries' => MAX_ADDRESS_BOOK_ENTRIES)); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'address_book'); $output_address_book = $smarty->fetch(SELECTED_TPL . '/address_book.tpl'); $smarty->assign('central_contents', $output_address_book); $smarty->display(SELECTED_TPL . '/frame.tpl');
if (xos_not_null($message)) { $smarty->assign('message', $message); } $smarty->assign(array('html_params' => HTML_PARAMS, 'xhtml_lang' => XHTML_LANG, 'charset' => CHARSET, 'store_name_address' => STORE_NAME_ADDRESS, 'store_name' => STORE_NAME, 'src_embedded_shop_logo' => 'cid:shop_logo', 'src_shop_logo' => HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . (is_file(DIR_FS_CATALOG . 'images/email_shop_logo/' . EMAIL_SHOP_LOGO) ? 'email_shop_logo/' : 'catalog/templates/' . SELECTED_TPL . '/') . EMAIL_SHOP_LOGO, 'to_name' => $to_name, 'from_name' => $from_name, 'products_name' => $product_info['products_name'], 'link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . (int) $_GET['p'], 'NONSSL', false, false))); // $smarty->assign('link_filename_product_info', xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . (int)$_GET['p'] . '&lnc=' . $customer_lng['code'], 'NONSSL', false, false)); $smarty->configLoad('languages/' . $_SESSION['language'] . '_email.conf', 'tell_a_friend_email_html'); $output_tell_a_friend_email_html = $smarty->fetch(SELECTED_TPL . '/includes/email/tell_a_friend_email_html.tpl'); $smarty->configLoad('languages/' . $_SESSION['language'] . '_email.conf', 'tell_a_friend_email_text'); $output_tell_a_friend_email_text = $smarty->fetch(SELECTED_TPL . '/includes/email/tell_a_friend_email_text.tpl'); $smarty->clearAssign(array('message', 'html_params', 'xhtml_lang', 'charset', 'store_name_address', 'store_name', 'src_embedded_shop_logo', 'src_shop_logo', 'to_name', 'from_name', 'products_name', 'link_filename_product_info')); $email_to_friend = new mailer($to_name, $to_email_address, $email_subject, $output_tell_a_friend_email_html, $output_tell_a_friend_email_text, $from_name, $from_email_address, EMAIL_SHOP_LOGO); if (!$email_to_friend->send()) { $messageStack->add('friend', sprintf(ERROR_PHPMAILER, $email_to_friend->ErrorInfo)); } else { $actionRecorder->record(); $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], xos_output_string_protected($to_name)), 'success'); $_SESSION['navigation']->remove_current_page(); xos_redirect(xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . (int) $_GET['p']), false); } } } elseif (isset($_SESSION['customer_id'])) { $account_query = xos_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $_SESSION['customer_id'] . "'"); $account = xos_db_fetch_array($account_query); $from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname']; $from_email_address = $account['customers_email_address']; } $site_trail->add(NAVBAR_TITLE, xos_href_link(FILENAME_TELL_A_FRIEND, 'p=' . (int) $_GET['p'])); require DIR_WS_INCLUDES . 'html_header.php'; require DIR_WS_INCLUDES . 'boxes.php'; require DIR_WS_INCLUDES . 'header.php'; require DIR_WS_INCLUDES . 'footer.php';
require DIR_WS_INCLUDES . 'header.php'; require DIR_WS_INCLUDES . 'footer.php'; if (xos_count_customer_orders() > 0) { $orders_query = xos_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, 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 limit 3"); $orders_array = array(); while ($orders = xos_db_fetch_array($orders_query)) { $oder_total_query = xos_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $orders['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($orders['delivery_name'])) { $order_name = $orders['delivery_name']; $order_country = $orders['delivery_country']; } else { $order_name = $orders['billing_name']; $order_country = $orders['billing_country']; } $orders_array[] = array('link_filename_account_history_info' => xos_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'), 'date_purchased' => xos_date_short($orders['date_purchased']), 'order_id' => $orders['orders_id'], 'order_name' => xos_output_string_protected($order_name), 'order_country' => $order_country, 'order_status_name' => $orders['orders_status_name'], 'order_total' => strip_tags($oder_total['text'])); } $smarty->assign('customer_orders', true); } if ($messageStack->size('account') > 0) { $smarty->assign('message_stack', $messageStack->output('account')); $smarty->assign('message_stack_error', $messageStack->output('account', 'error')); $smarty->assign('message_stack_warning', $messageStack->output('account', 'warning')); $smarty->assign('message_stack_success', $messageStack->output('account', 'success')); } $smarty->assign(array('orders' => $orders_array, 'link_filename_account_history' => xos_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'), 'link_filename_account_edit' => xos_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'link_filename_address_book' => xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'), 'link_filename_account_password' => xos_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL'), 'link_filename_account_newsletters' => NEWSLETTER_ENABLED == 'true' ? xos_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') : '', 'link_filename_account_notifications' => PRODUCT_NOTIFICATION_ENABLED == 'true' ? xos_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') : '')); $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'account'); $output_account = $smarty->fetch(SELECTED_TPL . '/account.tpl'); $smarty->assign('central_contents', $output_account); $smarty->display(SELECTED_TPL . '/frame.tpl'); require DIR_WS_INCLUDES . 'application_bottom.php';
// osCommerce, Open Source E-Commerce Solutions // http://www.oscommerce.com // Copyright (c) 2002 osCommerce // filename: search.php // // Released under the GNU General Public License //////////////////////////////////////////////////////////////////////////////// if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/login_my_account.php') == 'overwrite_all')) { if (CACHE_LEVEL > 1 && !isset($_SESSION['customer_id']) && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) { $smarty->caching = 1; $cache_id = 'L2|box_login_my_account|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency']; } if (!$smarty->isCached(SELECTED_TPL . '/includes/boxes/login_my_account.tpl', $cache_id)) { if (isset($_SESSION['customer_first_name']) && isset($_SESSION['customer_id'])) { if (ACCOUNT_GENDER == 'true' && isset($_SESSION['customer_gender']) && $_SESSION['customer_gender'] != '') { $box_welcome_string = sprintf(BOX_TEXT_GREETING_PERSONAL, ($_SESSION['customer_gender'] == 'm' ? MALE_ADDRESS : FEMALE_ADDRESS) . '<br />' . xos_output_string_protected($_SESSION['customer_first_name']) . ' ' . xos_output_string_protected($_SESSION['customer_lastname'])); } else { $box_welcome_string = sprintf(BOX_TEXT_GREETING_PERSONAL, xos_output_string_protected($_SESSION['customer_first_name']) . ' ' . xos_output_string_protected($_SESSION['customer_lastname'])); } } else { $box_welcome_string = BOX_TEXT_GREETING_GUEST; } if (SEND_EMAILS == 'true') { $smarty->assign('box_login_my_account_link_filename_password_forgotten', xos_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL')); } $smarty->assign(array('box_login_my_account_link_filename_create_account' => xos_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'box_login_my_account_link_filename_account' => xos_href_link(FILENAME_ACCOUNT, '', 'SSL'), 'box_login_my_account_link_filename_account_edit' => xos_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'box_login_my_account_link_filename_account_history' => xos_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'), 'box_login_my_account_link_filename_address_book' => xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'), 'box_login_my_account_link_filename_account_notifications' => PRODUCT_NOTIFICATION_ENABLED == 'true' ? xos_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') : '', 'box_login_my_account_link_filename_logoff' => xos_href_link(FILENAME_LOGOFF, '', 'SSL'), 'box_login_my_account_display_box_my_account' => isset($_SESSION['customer_id']) ? true : false, 'box_login_my_account_welcome_string' => $box_welcome_string, 'box_login_my_account_input_field_email_address' => xos_draw_input_field('email_address', '', 'class="form-control input-sm" id="box_login_email_address" size="10" maxlength="40" style="width: 130px"'), 'box_login_my_account_input_field_password' => xos_draw_password_field('password', '', 'class="form-control input-sm" id="box_login_password" size="10" style="width: 130px"'), 'box_login_my_account_form_begin' => xos_draw_form('box_login', xos_href_link(FILENAME_LOGIN, 'action=process', 'SSL'), 'post', '', true), 'box_login_my_account_form_end' => '</form>')); } $output_login_my_account = $smarty->fetch(SELECTED_TPL . '/includes/boxes/login_my_account.tpl', $cache_id); $smarty->caching = 0; $smarty->assign('box_login_my_account', $output_login_my_account); }
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');
function getOutput() { return '<a href="http://twitter.com/home?status=' . urlencode(xos_href_link(FILENAME_PRODUCT_INFO, xos_get_all_get_params(array('p')) . 'p=' . (int) $_GET['p'], 'NONSSL', false, true, false, false, false)) . '" target="_blank"><img src="' . DIR_WS_CATALOG . DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/icons_social_bookmarks/' . $this->icon . '" class="icon-social-bookmarks" title="' . xos_output_string_protected($this->public_title) . '" alt="' . xos_output_string_protected($this->public_title) . '" /></a>'; }
function getOutput() { return SEND_EMAILS == 'true' ? '<a href="' . xos_href_link(FILENAME_TELL_A_FRIEND, xos_get_all_get_params(array('p')) . 'p=' . (int) $_GET['p'], 'SSL') . '"><img src="' . DIR_WS_CATALOG . DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/icons_social_bookmarks/' . $this->icon . '" class="icon-social-bookmarks" title="' . xos_output_string_protected($this->public_title) . '" alt="' . xos_output_string_protected($this->public_title) . '" /></a>' : ''; }
} $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=' . $product_info['products_id'] . '&img_name=' . rawurlencode($product_image['name']), $request_type), 'link_product_img_noscript' => xos_href_link(FILENAME_IMAGES_WINDOW, 'pID=' . $product_info['products_id'], 'NONSSL', true, false, false, false, false), 'product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($product_image['name']), addslashes($product_info['products_name']), '', '', 'style="margin: 5px;"'))); } $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('form_begin' => xos_draw_form('product_reviews_write', xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'action')) . 'action=process', 'SSL'), 'post', 'onsubmit="return checkForm();"', true), 'form_end' => '</form>', 'radio_fields' => xos_draw_radio_field('rating', '1') . ' ' . xos_draw_radio_field('rating', '2') . ' ' . xos_draw_radio_field('rating', '3') . ' ' . xos_draw_radio_field('rating', '4') . ' ' . xos_draw_radio_field('rating', '5'), 'textarea_field' => xos_draw_textarea_field('review', '60', '15'), 'customers_name' => xos_output_string_protected($customer['customers_firstname'] . ' ' . $customer['customers_lastname']), 'products_name' => $product_info['products_name'], 'products_p_unit' => $product_info['products_p_unit'], 'products_model' => $product_info['products_model'], 'products_price' => $product_price, 'products_price_special' => $product_price_special, 'products_price_breaks' => $price_breaks_array, 'products_tax_description' => xos_get_products_tax_description($product_info['products_tax_class_id'], $products_tax_rate), 'td_width_img' => MEDIUM_PRODUCT_IMAGE_MAX_WIDTH + 10, 'link_back' => $back_link, '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_write'); $output_product_reviews_write = $smarty->fetch(SELECTED_TPL . '/product_reviews_write.tpl'); $smarty->assign('central_contents', $output_product_reviews_write); $smarty->display(SELECTED_TPL . '/frame.tpl'); require DIR_WS_INCLUDES . 'application_bottom.php'; }
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/reviews.php') == 'overwrite_all')) { $allowed = true; if (isset($_GET['p'])) { $allowed_product_query = xos_db_query("select p.products_id total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_OR_PAGES . " c where p.products_id = '" . (int) $_GET['p'] . "' and p.products_id = p2c.products_id and p2c.categories_or_pages_id = c.categories_or_pages_id and c.categories_or_pages_status = '1' and p.products_status = '1'"); if (!xos_db_num_rows($allowed_product_query)) { $allowed = false; } } if ($allowed == true) { $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, " . 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 rd.languages_id = '" . (int) $_SESSION['languages_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'"; if (isset($_GET['p'])) { $random_select .= " and p.products_id = '" . (int) $_GET['p'] . "'"; } $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS; $random_product = xos_random_select($random_select); if ($random_product) { // display random review box $rand_review_query = xos_db_query("select substring(reviews_text, 1, 70) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int) $random_product['reviews_id'] . "' and languages_id = '" . (int) $_SESSION['languages_id'] . "'"); $rand_review = xos_db_fetch_array($rand_review_query); $rand_review_text = xos_break_string(xos_output_string_protected($rand_review['reviews_text']), 20, '-<br />'); $random_review_product_image = xos_get_product_images($random_product['products_image']); $smarty->assign(array('box_reviews_link_filename_product_reviews_info' => xos_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'p=' . $random_product['products_id'] . '&r=' . $random_product['reviews_id']), 'box_reviews_product_image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($random_review_product_image['name']), $random_product['products_name']), 'box_reviews_review_text' => strip_tags($rand_review_text), 'box_reviews_stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $random_product['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])))); } elseif (isset($_GET['p'])) { // display 'write a review' box $smarty->assign(array('box_reviews_link_filename_product_reviews_write' => xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'p=' . $_GET['p'], 'SSL'), 'box_reviews_write_review_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW))); } $smarty->assign('box_reviews_link_filename_reviews', xos_href_link(FILENAME_REVIEWS)); $output_reviews = $smarty->fetch(SELECTED_TPL . '/includes/boxes/reviews.tpl'); $smarty->assign('box_reviews', $output_reviews); } }