<?php
/**
 * Page Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_reviews_default.php 2905 2006-01-28 01:25:36Z birdbrain $
 */
?>
<div class="centerColumn" id="reviewsDefault">

<!--<h1 id="reviewsDefaultHeading"><?php echo $breadcrumb->last();  ?></h1>-->

<?php
  if ($reviews_split->number_of_rows > 0) {
    if ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3')) {
?>
<div id="reviewsDefaultListingTopNumber" class="navSplitPagesResult"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></div>

<div id="reviewsDefaultListingTopLinks" class="navSplitPagesLinks"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'main_page'))); ?></div>

<?php
    }

    $reviews = $db->Execute($reviews_split->sql_query);
    while (!$reviews->EOF) {
?>
<div class="product-info-wrap">
  <div class="row">
    <div class="product-images col-md-3" itemtype="http://schema.org/ImageGallery"><?php echo '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews->fields['products_id'] . '&reviews_id=' . $reviews->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $reviews->fields['products_image'], $reviews->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></div>
    <div class="reviews-wrap col-md-9">
      <h3 class="section-title"><a href="<?php echo zen_href_link(zen_get_info_page($reviews->fields['products_id']), 'products_id=' . $reviews->fields['products_id']); ?>"><?php echo $reviews->fields['products_name']; ?></a></h3>

      <ul class="reviews">
        <li class="review-item clearfix">
          <div class="review-avatar">
            <?php echo genesis_get_gravatar( $reviews->fields['customers_email_address'] ); ?>
          </div>
          <h3 class="review-by">
            <?php echo $reviews->fields['customers_name']; ?>
            <span class="review-date"><em> - <?php echo date( 'd M Y', strtotime( $reviews->fields['date_added'] ) ); ?></em></span>
          </h3>
          <p class="review-text"><?php echo zen_clean_html(stripslashes($reviews->fields['reviews_text'])); ?></p>
          <span class="the-rating" title="<?php echo $reviews->fields['reviews_rating']; ?>"><?php echo genesis_get_rating_html( $reviews->fields['reviews_rating'] ); ?></span>                 
        </li>
      </ul>

      <div class="view-all-review">
        <?php echo '<a class="button" href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $reviews->fields['products_id'] . '&reviews_id=' . $reviews->fields['reviews_id']) . '">' . BUTTON_READ_REVIEWS_ALT . '</a>'; ?>
      </div>

    </div>
  </div>
</div>
<?php
      $reviews->MoveNext();
    }
?>
<?php
  } else {
?>
<div id="reviewsDefaultNoReviews" class="content"><?php echo TEXT_NO_REVIEWS; ?></div>
<?php
  }
?>
<?php
  if (($reviews_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<div id="reviewsDefaultListingBottomNumber" class="navSplitPagesResult"><?php echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?></div>

<div id="reviewsDefaultListingBottomLinks" class="navSplitPagesLinks"><?php echo TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'main_page'))); ?></div>
<br class="clearBoth" />
<?php
  }
?>

</div>
