????
| Current Path : /home2/morganrand/www/store/ |
| Current File : /home2/morganrand/www/store/product_info.php.bk11215 |
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
if (!isset($HTTP_GET_VARS['products_id'])) {
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$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_nobox.php');
if ($product_check['total'] < 1) {
?>
<div class="contentContainer">
<div class="contentText">
<?php echo TEXT_PRODUCT_NOT_FOUND; ?>
</div>
<div style="float: right;">
<?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
</div>
</div>
<?php
} else {
//AG added products.products_group
$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, p.products_group 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);
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 . "'");
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']));
}
$v_new_price = (tep_not_null($new_price) ? $new_price : '0'); // ajax attribute pricechange
$v_products_price = (tep_not_null($product_info['products_price']) ? $product_info['products_price'] : '0'); // ajax attribute pricechange
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'];
}
?>
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'),'post','onsubmit="return checkQty();"'); ?>
<style type="text/css">
#custom_input{
width:90%;
border: 1px solid #CCC;
margin-top: 15px;
width: 90%;
max-width: 300px;
}
.ui-button-text{
border:1px solid #808080;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
font-size:12px;
font-family:arial, helvetica, sans-serif;
padding: 10px 10px 10px 10px;
text-decoration:none;
display:inline-block;
font-weight:bold;
color: #0D0D0D;
background-color: #D1CECE;
/* background-image: -webkit-gradient(linear, left top, left bottom, from(#808080), to(#808080));
background-image: -webkit-linear-gradient(top, #808080, #808080);
background-image: -moz-linear-gradient(top, #808080, #808080);
background-image: -ms-linear-gradient(top, #808080, #808080);
background-image: -o-linear-gradient(top, #808080, #808080);
background-image: linear-gradient(to bottom, #808080, #808080); */
}
.ui-button-text:hover{
border:1px solid #F0B6C9;
background-color: #FFC1D6;
background-image: -webkit-gradient(linear, left top, left bottom, from(#FFC1D6), to(#E8B0C2));
background-image: -webkit-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: -moz-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: -ms-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: -o-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: linear-gradient(to bottom, #FFC1D6, #E8B0C2);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#FFC1D6, endColorstr=#E8B0C2);
}
.ui-state-active .ui-button-text{
border:1px solid #F0B6C9;
background-color: #FFC1D6;
background-image: -webkit-gradient(linear, left top, left bottom, from(#FFC1D6), to(#E8B0C2));
background-image: -webkit-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: -moz-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: -ms-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: -o-linear-gradient(top, #FFC1D6, #E8B0C2);
background-image: linear-gradient(to bottom, #FFC1D6, #E8B0C2);}
.recent_item{font-family:gothic;font-size: 18px;color:#757273;font-weight:bold;
background-color: #E4E4E4;width:100%; padding:5px 0;
}
</style>
<script language="javascript"><!--
function textCounter(field,maxlimit) {
var charcnt = field.value.length;
if (charcnt > maxlimit) {
field.value = field.value.substring(0, maxlimit);
alert("Sorry, the imprint has a limit of "+maxlimit+" characters (including spaces and special characters)");
}
}
function checkQty() {
var imp = $('input[id="radio21"]:checked').length;
var qty = $('input[name="buyqty"]').val();
var txt = $('input[id="custom_input"]').val();
var txtalt = '';
if (imp == 1) {
if(txt=='')
txtalt = txtalt + "Imprints may contain up to 8 capital letters and up to\n6 special characters which are ! - & . , \’\nEach special character will be counted as one letter or space.\n";
else if (/[^a-zA-Z0-9&, '!.-]/.test(txt)) {
txtalt = txtalt + "text can only contain ! - & . , \’ special characters\n";
}
if(qty < 4)
txtalt = txtalt + "The minimum order for imprint is 4 centerpieces.";
if(txtalt){
alert(txtalt);
return false;
}
}
}
$(function() {
$( "#tabs" ).tabs();
$( "#radio1" ).buttonset();
$( "#radio2" ).buttonset();
$( "#radio3" ).buttonset();
});
//--></script>
<div style="width:100%;clear:both;">
<div style="float:right;width:40%;">
<?php
$sbm_array = explode(';', MODULE_SOCIAL_BOOKMARKS_INSTALLED);
$social_bookmarks = array();
foreach ( $sbm_array as $sbm ) {
$class = substr($sbm, 0, strrpos($sbm, '.'));
if ( !class_exists($class) ) {
include(DIR_WS_LANGUAGES . $language . '/modules/social_bookmarks/' . $sbm);
include(DIR_WS_MODULES . 'social_bookmarks/' . $class . '.php');
}
$sb = new $class();
if ( $sb->isEnabled() ) {
$social_bookmarks[] = $sb->getOutput();
}
}
if ( !empty($social_bookmarks) ) {
$data = '<div class="social_icon">'.'<a class="topopup"><img src="images/social_bookmarks/email.png" border="0" title="Share via E-Mail" alt="Share via E-Mail"></a>' . implode( $social_bookmarks) . '</div>';
echo $data;
}
?>
</div>
<div style="float:left;width:100%;"><font color="CC3366"><b><?php echo PRODUCT_INFO_CUSTOM_TEXT; ?></b></font> </div>
</div>
<div class="contentContainer">
<div class="contentText">
<?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");
if (tep_db_num_rows($pi_query) > 0) {
?>
<div id="piGal" style="float: left;">
<ul>
<?php
$pi_counter = 0;
while ($pi = tep_db_fetch_array($pi_query)) {
$pi_counter++;
$pi_entry = ' <li><a href="';
if (tep_not_null($pi['htmlcontent'])) {
$pi_entry .= '#piGalimg_' . $pi_counter;
} else {
$pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image'], '', 'NONSSL', false);
}
$pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $pi['image']) . '</a>';
if (tep_not_null($pi['htmlcontent'])) {
$pi_entry .= '<div style="display: none;"><div id="piGalimg_' . $pi_counter . '">' . $pi['htmlcontent'] . '</div></div>';
}
$pi_entry .= '</li>';
echo $pi_entry;
}
?>
</ul>
<div class="ordr_info">
<p style="line-height:1.2;font-family: Arial; font-size: 14px;color:#CB3366;">The Centerpiece shown is a Centerpiece of 9 favors.<br>If you are ordering a Centerpiece of 6, 8, or 10 favors see size comparison below.
</p>
</div>
</div>
<script type="text/javascript">
$('#piGal ul').bxGallery({
maxwidth: 510,
maxheight: 480,
thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>,
thumbcontainer: 300,
load_image: 'ext/jquery/bxGallery/spinner.gif'
});
</script>
<?php
} else {
?>
<div id="piGal" style="float: left;">
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image'], '', 'NONSSL', false) . '" 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 class="ordr_info">
<p style="line-height:1.2;font-family: Arial; font-size: 14px;color:#CB3366;">The Centerpiece shown is a Centerpiece of 9 favors.<br>If you are ordering a Centerpiece of 6, 8, or 10 favors see size comparison below.
</p>
</div>
</div>
<?php
}
?>
<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
cyclic: true
});
</script>
<?php
}
?>
<?php
$product_group = $product_info['products_group'];
$product_group_query = tep_db_query("select pg.products_group_id, pg.products_group_template_product_id from " . TABLE_PRODUCTS_GROUPS . " pg where pg.products_group_id = '" . (int)$product_group . "'");
$product_group_info = tep_db_fetch_array($product_group_query);
$product_group_template = $product_group_info['products_group_template_product_id'];
$pro_gr_id = $product_group_template;
if ($product_group > 0) {
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$product_group_template . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
} else {
$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 . "'");
$product_group_template = (int)$HTTP_GET_VARS['products_id'];
}
$products_attributes = tep_db_fetch_array($products_attributes_query);
if ($products_attributes['total'] > 0) {
?>
<div style="padding-left:520px;">
<h1 style="color: #CC3467;font-family:gothic;font-size: 23px;"><?php echo $products_name; ?></h1>
<p style="font-family: Arial; font-size: 14px;color:#757273;">
<?php echo stripslashes($product_info['products_description']); ?>
</p>
<h1 style="float:left;width:100%;color: #CC3467;font-family:gothic;font-size: 23px;" id="display_price_modi"><?php // echo $products_price;?></h1>
<h1 style="font-family:gothic;font-size: 18px;color:#757273;"><?php echo TEXT_PRODUCT_OPTIONS; ?></h1>
<?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)$product_group_template . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
$numberofopt = tep_db_num_rows($products_options_name_query);
$opt_count = 0;
$comma = "";
$all_option_js = "[";
$products_attributes = array();
while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
array_push($products_attributes,$products_options_name['products_options_id']);
$opt_count++;
$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)$product_group_template . "' 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 . "' order by pa.products_attributes_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 (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;
}
if($products_options_name['products_options_id']==4){}
else{
?>
<strong style="color:#757273;font-family:arial;font-size:13px;"><?php echo $products_options_name['products_options_name'] . ':'; ?></strong><?php
}
if($products_options_name['products_options_id']!=4)
{
$all_option_js .= $comma.'document.getElementById(\'cmbooption_'.$opt_count.'\').value';
$comma = ",";
}
?>
<?php
if($products_options_name['products_options_id']==4)
{
$val = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']];
$style = $val?'style="display:block;"':'style="display:none;"';
echo tep_draw_input_field('id[' . $products_options_name['products_options_id'] . ']',$cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']],$style.' id="custom_input" onKeyDown="textCounter(this,30)" onKeyUp="textCounter(this,30)"').'<div id="about_imprint" style="font-family: Arial; font-size:11px;color:#CB3366;line-height: 14px;display:none; margin-top:5px; border-bottom: 1px solid #E6E1E3; padding-bottom:10px;">Imprints may contain up to 8 capital letters and up to
6 special characters which are ! - & . , ’
Each special character will be counted as one letter or
space.<br />
The minimum order for imprint is 4 centerpieces.</div>';
}else{
echo tep_draw_radio_menu22($opt_count,'id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute,' onChange="changer(this,' . $opt_count . ')"').'<br />';
}
?>
<?php
}
$all_option_js .= "]";
?>
<div style="padding-left:5px; padding-top:2px; padding-bottom:2px; padding-right:2px; height:32px; border:0px solid black;">
<div class="pro_qunty" style=" margin-bottom:8px; font-weight:bold; color:#2F4F4F;">
Quantity of centerpieces: <?php echo tep_draw_input_field('buyqty', '1', 'size=3 maxlength=3'); ?>
</div>
<div>
<span class="buttonAction" >
<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('cta_addtocart.jpg','','width="130" height="32"'); ?>
<button id="wishList" class="btn_wishlist" type="submit" name="wishlist" value="wishlist" style="position: relative;bottom: 10px;">Add To Wishlist</button>
</span>
</div>
</div>
</div>
<?php
}
?>
<input type="hidden" name="optionsid" id="optionsid" value="<?php echo implode(",",$products_attributes); ?>" />
<div style="clear: both;"></div>
<?php
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
<p style="text-align: center;"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></p>
<?php
}
?>
</div>
<?php
?>
<div class="buttonSet"> </div>
<?php
/* if ((USE_CACHE == 'true') && empty($SID)) {
echo tep_cache_also_purchased(3600);
} else {
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
} */
?>
</div>
</form>
<script type="text/javascript">
<!--
// getPrice(<?php echo $v_new_price.','.$v_products_price.','.(int)$HTTP_GET_VARS['products_id'].','.$all_option_js;?>);
getPrice(<?php echo $v_new_price.','.$v_products_price.','.$pro_gr_id.','.$all_option_js;?>);
//-->
function changer(obje,num) {
vos = obje.value;
switch (num) {
case 1:
document.getElementById('cmbooption_1').value = vos;
break;
case 2:
document.getElementById('cmbooption_2').value = vos;
break;
case 3:
document.getElementById('cmbooption_3').value = vos;
break;
}
var optarr = new Array();
optarr.push(document.getElementById('cmbooption_1').value);
optarr.push(document.getElementById('cmbooption_2').value);
optarr.push(document.getElementById('cmbooption_3').value);
getPrice(0,37.20,1058,optarr);
}
</script>
<div id="tabs">
<ul>
<li id="li_btn" class="li_btn ui-tabs-selected ui-state-active"><a href="#tabs-1">Size Comparison</a></li>
<li id="li_btn" class="li_btn ui-tabs-selected ui-state-active"><a href="#tabs-2">Filled vs Empty</a></li>
<li id="li_btn" class="li_btn ui-tabs-selected ui-state-active"><a href="#tabs-3">Imprinting</a></li>
<li id="li_btn" class="li_btn ui-tabs-selected ui-state-active"><a href="#tabs-4">Assembly in a Snap</a></li>
<li id="li_btn" class="li_btn ui-tabs-selected ui-state-active"><a href="#tabs-5">Review</a></li>
</ul>
<div id="tabs-1">
<div id="miniquestion" style="height:520px; margin-top:0px;margin-bottom:10px;">
<h1 class="tabl_title">How many favors are in each centerpiece?</h1>
<p style="font-family: Arial; font-size: 14px;color:#757273;text-align:center;">That depends on what you order. We make centerpieces which have 6, 8, 9, or 10 favors. Here are some examples: <br><br>
<p style="font-family: Arial; font-size: 14px;color:#757273;text-align:center;">(click the <span color="#CC3467">centerpieces several times</span> to see how all the favors come together!)</p></p>
<div id="imagecontainer" style="padding-left:20px;"><iframe style="overflow:hidden;" src="sequenced6.html" frameborder="0" width="187" height="200"> </iframe>
<p style="color: #CC3467;font-family:gothic;">6 Favor Centerpiece</p>
<p class="tabl_pp">5 favors on the bottom <br> 1 favor on top</p>
<p style="margin-top:5px;" class="tabl_pp">10" tall x 11" wide</p>
</div>
<div id="imagecontainer" style="padding-left:20px;"><iframe style="overflow:hidden;" src="sequenced8.html" frameborder="0" width="187" height="200"> </iframe>
<p style="font-family:gothic; color:#cc3366">8 Favor Centerpiece</p>
<p class="tabl_pp">6 favors on the bottom <br> 2 favors on top</p>
<p class="tabl_pp" style="margin-top:5px;">12" tall x 12" wide</p>
</div>
<div id="imagecontainer" style="padding-left:20px;"><iframe style="overflow:hidden;" src="sequenced9.html" frameborder="0" width="187" height="200"> </iframe>
<p style="font-family:gothic; color:#cc3366">9 Favor Centerpiece</p>
<p class="tabl_pp">6 favors on the bottom <br> 3 favors on top</p>
<p style="margin-top:5px;" class="tabl_pp">12" tall x 12" wide</p>
</div>
<div id="imagecontainer" style="padding-left:20px;"><iframe style="overflow:hidden;" src="sequenced10.html" frameborder="0" width="187" height="200"> </iframe>
<p style="font-family:gothic; color:#cc3366">10 Favor Centerpiece</p>
<p class="tabl_pp">6 favors on the bottom <br> 4 favors on top</p>
<p class="tabl_pp" style="margin-top:5px;">12" tall x 12" wide</p>
</div>
</div>
</div>
<div id="tabs-2">
<h1 class="tabl_title">Filled vs Empty</h1>
<p class="tabl_pp">You can get your Wanderfuls Centerpieces and favors PRE-FILLED as pictured with the candy shown in the image above, except for Hershey Kisses, which must be ordered empty. We show the Kisses just so you can see what they look like.</p>
<p class="tabl_pp">Why do we offer an empty option? Because many of our customers love the way their Wanderfuls look with Hershey Kisses or M&Ms inside. But Since we don't ship chocolate, just buy your own favorite candy and fill on your own. It's simple and takes just seconds per favor. The favors fill easily from the bottom. There's a removable cap there that you can pop off and on. Allow for approximately 1lb of candy for every 10 favors.</p>
</div>
<div id="tabs-3">
<img src="images/imprinting.jpg" width="399" height="400">
<img src="images/imprinting2.jpg" width="400" height="400">
<p class="tabl_pp">For extra personalization, we offer imprinting on the ribbon that wraps around the plastic tube. We have 32 characters and spaces available for you to use on your imprint. We can imprint in silver or gold to match the color of your base. Commas, semicolumns, apostrophies, and dashes are fine but no special characters please.</p>
</div>
<div id="tabs-4">
<h1 class="tabl_title">Assembly in a Snap (click to see the step by step)</h1>
<p class="tabl_pp">Just snap the holder and base together and slide the favors into position, it's easy!</p>
<iframe src="sequencedassembly.html" frameborder="0" height="300px" width="400px" style="overflow:hidden"> </iframe>
<p class="tabl_pp">Wanderfuls centerpieces are shipping in parts to save on shipping costs and to keep the pompoms from being crushed. When they get to you, just snap them together and you're done! Need help? Watch the video to the left to see how it all comes together!</p>
</div>
<div id="tabs-5">
<div style="height:500px;overflow:scroll;">
<?php
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));
if ($messageStack->size('product_reviews') > 0) {
echo $messageStack->output('product_reviews');
}
?>
<div class="contentContainer">
<?php
$reviews_query_raw = "select r.reviews_id,r.products_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.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$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) {
if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
?>
<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>
<p><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></p>
</div>
<br/>
<?php
}
$reviews_query = tep_db_query($reviews_split->sql_query);
while ($reviews = tep_db_fetch_array($reviews_query)) {
$product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $reviews['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
?>
<div class="author_name" style="clear:both;">
<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']) . '">' . sprintf(TEXT_REVIEW_BY, tep_output_string_protected($reviews['customers_name'])) . '</a>'; ?></h2>
</div>
<div class="contentText" style="clear:both;">
<div style="width:70%;float:left;">
<?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="tab_cart_btn" style="width: 25%;float:left;">
<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>
<p><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now'),'tab_cart_btn'); ?></p>
</div>
</div>
<?php
}
}
else {
?>
<div class="contentText">
<?php echo TEXT_NO_REVIEWS; ?>
</div>
<?php
}
?>
<br />
<div class="buttonSet">
<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW, 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, tep_get_all_get_params()),'tab_cart_btn'); ?></span>
<?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params()),'tab_cart_btn'); ?>
</div>
</div>
</div>
</div><!--end of tab 5-->
</div>
<div id="newfooter">
<div style="width:100%;"><?php require(DIR_WS_INCLUDES . 'recently_viewed_products.php'); ?></div>
</div>
<!--pop up code-->
<div id="toPopup">
<div class="close"></div>
<div id="popup_content">
<?php
$valid_product = false;
if (isset($HTTP_GET_VARS['products_id'])) {
$product_info_query = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
if (tep_db_num_rows($product_info_query)) {
$valid_product = true;
$product_info = tep_db_fetch_array($product_info_query);
}
}
if ($valid_product == false) {
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id']));
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TELL_A_FRIEND);
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
$error = false;
$to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
$to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
$from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
$from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
$message = tep_db_prepare_input($HTTP_POST_VARS['message']);
if (empty($from_name)) {
$error = true;
$messageStack->add('friend', ERROR_FROM_NAME);
}
if (!tep_validate_email($from_email_address)) {
$error = true;
$messageStack->add('friend', ERROR_FROM_ADDRESS);
}
if (empty($to_name)) {
$error = true;
$messageStack->add('friend', ERROR_TO_NAME);
}
if (!tep_validate_email($to_email_address)) {
$error = true;
$messageStack->add('friend', ERROR_TO_ADDRESS);
}
$actionRecorder = new actionRecorder('ar_tell_a_friend', (tep_session_is_registered('customer_id') ? $customer_id : null), $from_name);
if (!$actionRecorder->canPerform()) {
$error = true;
$actionRecorder->record(false);
$messageStack->add('friend', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES : 15)));
}
if ($error == false) {
$email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
$email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], STORE_NAME) . "\n\n";
if (tep_not_null($message)) {
$email_body .= $message . "\n\n";
}
$email_body .= sprintf(TEXT_EMAIL_LINK, tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id'], 'NONSSL', false)) . "\n\n" .
sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address);
$actionRecorder->record();
$messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');
tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id']));
}
} elseif (tep_session_is_registered('customer_id')) {
$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);
$from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
$from_email_address = $account['customers_email_address'];
}
?>
<h1><?php echo sprintf($product_info['products_name']); ?></h1>
<?php
if ($messageStack->size('friend') > 0) {
echo $messageStack->output('friend');
}
?>
<?php echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND,'action=process&products_id=' . (int)$HTTP_GET_VARS['products_id']), 'post', '', true); ?>
<div class="contentContainer">
<div>
<span class="inputRequirement" style="float: right;"><?php echo FORM_REQUIRED_INFORMATION; ?></span>
<h2><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></h2>
</div>
<div class="contentText">
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr>
<td class="fieldKey"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('from_name'); ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('from_email_address'); ?></td>
</tr>
</table>
</div>
<h2><?php echo FORM_TITLE_FRIEND_DETAILS; ?></h2>
<div class="contentText">
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr>
<td class="fieldKey"><?php echo FORM_FIELD_FRIEND_NAME; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('to_name') . ' <span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>
</tr>
<tr>
<td class="fieldKey"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
<td class="fieldValue"><?php echo tep_draw_input_field('to_email_address') . ' <span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>'; ?></td>
</tr>
</table>
</div>
<h2><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></h2>
<div class="contentText">
<table border="0" cellspacing="2" cellpadding="2" width="100%">
<tr>
<td class="fieldValue"><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></td>
</tr>
</table>
</div>
<div class="buttonSet">
<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>
<?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id'])); ?>
</div>
</div>
</form>
</div>
</div>
<div class="loader"></div>
<div id="backgroundPopup"></div>
<!--end pop up code-->
<!--login pop up-->
<div id="loginBox" title="Log Into My Account" style="display:none;">
<div id="tabsLogin">
<ul>
<li><a href="#tab-signin">Sign In</a></li>
<li><a href="#tab-join">Join <small style="font-family:Arial, Helvetica, sans-serif;">(for first time users)</small></a></li>
</ul>
<div id="tab-signin">
<table cellpadding="2" cellspacing="3" border="0" style="padding-left:13%;">
<tr>
<td class="main"><?php echo ENTRY_EMAIL_ADDRESS;?></td>
<td class="main"><?php echo tep_draw_input_field('email_address');?></td>
</tr>
<tr>
<td class="main" style="padding-top:5px;"><?php echo ENTRY_PASSWORD;?></td>
<td class="main" style="padding-top:5px;"><?php echo tep_draw_password_field('password');?></td>
</tr>
<tr>
<td colspan="2" class="main" style="padding-top:10px; text-align:right;"><a href="<?php echo tep_href_link(FILENAME_PASSWORD_FORGOTTEN, 'form=forgot', 'SSL');?>"><?php echo 'Forget Password';?></a></td>
</tr>
<tr height="10"><td> </td></tr>
<tr height="10"><td colspan="2"><a href="<?php echo tep_href_link(FILENAME_LOGIN, 'form=account&wishlist', 'SSL') ?>">Register (for first time user)</a></td></tr>
<tr>
<td align="left"><a href="<?php echo tep_href_link(FILENAME_PRIVACY);?>">PRIVACY POLICY</a></td>
<td align="right"><?php echo '<span class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-focus" style="padding:5px;border: 1px solid #CC3467;background: #CC3467;" id="loginWindowSubmit">'. IMAGE_BUTTON_LOGIN. '</span>';?></td>
</tr>
</table>
</div>
<div id="tab-join">
<table cellpadding="2" cellspacing="3" border="0">
<tr>
<td class="main"><?php echo ENTRY_FIRST_NAME;?><br /><?php echo tep_draw_input_field('entry_firstname');?></td>
<td width="10"> </td>
<td class="main"><?php echo ENTRY_LAST_NAME;?><br /><?php echo tep_draw_input_field('entry_lastname');?></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_EMAIL_ADDRESS;?><br /><?php echo tep_draw_input_field('entry_email_address');?></td>
<td width="10"> </td>
<td class="main"></td>
</tr>
<tr>
<td class="main"><?php echo ENTRY_PASSWORD;?><br /><?php echo tep_draw_password_field('entry_password');?></td>
<td width="10"> </td>
<td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION;?><br /><?php echo tep_draw_password_field('entry_password_confirm');?></td>
</tr>
<tr>
<td class="main" colspan="3" style="padding-top:5px;">Subscribe to Newsletter: <?php echo tep_draw_checkbox_field('entry_newsletter', '1', true); ?></td>
</tr>
<tr>
<td align="left"><a href="<?php echo tep_href_link(FILENAME_PRIVACY);?>">PRIVACY POLICY</a></td>
<td width="10"> </td>
<td align="right"><?php echo '<span class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-focus" style="padding:5px;border: 1px solid #CC3467;background: #CC3467;" id="singUp">Sign Up</span>';?></td>
</tr>
</table>
</div>
</div>
</div>
<!--end login pop up-->
<?php
}
require(DIR_WS_INCLUDES . 'template_bottom_nobox.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>