<?php
/*
$Id$[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] Copyright (c) 2010 osCommerce[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] Released under the GNU General Public License
*/[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] require('includes/application_top.php');[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
require(DIR_WS_INCLUDES . 'template_top.php');[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if ($product_check['total'] < 1) {
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div class="contentContainer">
<div class="contentText">
<?php echo TEXT_PRODUCT_NOT_FOUND; ?>
</div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <div style="float: right;">
<?php echo tep_draw_button(IMAGE_BUTTON_HOME, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
</div>
</div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
} else {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");$product_info = tep_db_fetch_array($product_info_query);[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
$products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if (tep_not_null($product_info['products_model'])) {
$products_name = $product_info['products_name'] . '<br /><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
$products_name = $product_info['products_name'];
}
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div>
<h1 style="float: right;"><?php echo $products_price; ?></h1>
<h1><?php echo $products_name; ?></h1>
</div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div class="contentContainer">
<div class="contentText">[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
if (tep_not_null($product_info['products_image'])) {
$pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order");[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if (tep_db_num_rows($pi_query) > 0) {
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <div id="piGal" style="float: right;">
<ul>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
$pi_counter = 0;
while ($pi = tep_db_fetch_array($pi_query)) {
$pi_counter++;[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] $pi_entry = ' <li><a href="';[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if (tep_not_null($pi['htmlcontent'])) {
$pi_entry .= '#piGalimg_' . $pi_counter;
} else {
$pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image']);
}[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $pi['image']) . '</a>';[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if (tep_not_null($pi['htmlcontent'])) {
$pi_entry .= '<div style="display: none;"><div id="piGalimg_' . $pi_counter . '">' . $pi['htmlcontent'] . '</div></div>';
}[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] $pi_entry .= '</li>';[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] echo $pi_entry;
}
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] </ul>
</div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<script type="text/javascript">
$('#piGal ul').bxGallery({
maxwidth: 300,
maxheight: 200,
thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>,
thumbcontainer: 300,
load_image: 'ext/jquery/bxGallery/spinner.gif'
});
</script>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
} else {
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <div id="piGal" style="float: right;">
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?>
</div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
}
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
cyclic: true
});
</script>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
}
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
if ($products_attributes['total'] > 0) {
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php //echo stripslashes($product_info['products_description']); ?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <p><?php echo TEXT_PRODUCT_OPTIONS; ?></p>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <p>
<?php
$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
$products_options_array = array();
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
while ($products_options = tep_db_fetch_array($products_options_query)) {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
if ($products_options['options_values_price'] != '0') {
$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
}
}[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
} else {
$selected_attribute = false;
}
?>
<strong><?php echo $products_options_name['products_options_name'] . ':'; ?></strong><br /><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?><br />
<?php
}
?>
</p>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
}
?>
<?php[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]$reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 250) 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)$languages_id . "' and r.reviews_status = 1 order by r.reviews_id desc";
$reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <div style="clear: both;"></div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <p style="text-align: center;"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></p>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
}
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] </div>
<!--tabs-->
<script>
$(document).ready(function() {
$("#tabs").tabs();
});
</script>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div id="tabs">
<ul>
<li><a href="#fragment-1"><span>Description</span></a></li>
<li><a href="#fragment-2"><span>Reviews</span></a></li>
</ul>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div id="fragment-1">
<?php echo nl2br(stripslashes($product_info['products_description'])); ?>
</div>
<div id="fragment-2">[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div class="contentText">
</div>
<?php
}[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] $reviews_query = tep_db_query($reviews_split->sql_query);
while ($reviews = tep_db_fetch_array($reviews_query)) {
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div>
<span style="float: right;"><?php echo sprintf(TEXT_REVIEW_DATE_ADDED, tep_date_long($reviews['date_added'])); ?></span>
<h2><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $product_info['products_id'] . '&reviews_id=' . $reviews['reviews_id']) . '">' . '</a>' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])); ?></h2>
</div>
<div class="contentText">
<?php echo tep_break_string(tep_output_string_protected($reviews['reviews_text']), 60, '-<br />') . ((strlen($reviews['reviews_text']) >= 100) ? '..' : '') . '<br /><br /><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])) . '</i>';?>
</div>
<div class="contentText">
<?php echo TEXT_NO_REVIEWS; ?>
</div>
<?php
}[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<div class="contentText">
<p style="float: right;"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info'))); ?></p>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)] <p><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></p>
</div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]</div>
</div>
<!--/tabs-->[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_also_purchased(3600);
} else {
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
?>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]</div>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]</form>[/background][/size][/font]
[font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2][background=rgb(252, 253, 253)]<?php
}
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>