<?php
/*
  $Id: product_reviews.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  if(isset($_GET['products_id']) && $_GET['products_id'] > 0){
	  $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
	  if (!tep_db_num_rows($product_info_query)) {
		//tep_redirect(tep_href_link(FILENAME_REVIEWS));
	  } else {
		$product_info = tep_db_fetch_array($product_info_query);
	  }

	  $pf->loadProduct($product_info['products_id'],$languages_id);
	  $products_price = $pf->getPriceStringShort();

	  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'];
	  }

	  $stock_status = '<div class="text-right text-success ProductInStock"><b><i class="fa fa-check-circle"></i> Stock : In-Stock</b></div>';
	  if (STOCK_CHECK == 'true') {
			$stock_check = tep_get_products_stock($product_info['products_id']);
			if ($stock_check == 0 ){
				$stock_status = '<div class="text-right text-danger ProductOutStock"><b>Stock : Out of Stock</b></div>';
			}
			if (($stock_check == 0 ) && (STOCK_ALLOW_CHECKOUT == 'false')) {
				$valid_to_checkout = false;
				$disable_add_cart = ' disabled="disabled"';
			}
	  }
  }

  $reviews_content = '';

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_REVIEWS);

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));

  $content = CONTENT_PRODUCT_REVIEWS;
  $javascript = 'popup_window.js';

  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

?>
