<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_Mobile
 * @copyright  Copyright (c) 2010-2011 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */
?>
<?php if($this->getProductData()->getId()): ?>
    <div class="page-head">
        <h3><?php echo $this->__('Review Details') ?></h3>
    </div>

    <div class="my-review-detail">
            <div class="product-image">
                <p><a href="<?php echo $this->getProductData()->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProductData(), 'small_image')->resize(125, 125); ?>" alt="<?php echo $this->htmlEscape($this->getProductData()->getName()) ?>" height="125" width="125" /></a></p>
                <?php if( $this->getRating() && $this->getRating()->getSize()): ?>
                    <small><?php echo $this->__('Average Customer Rating:') ?></small>
                    <?php echo $this->helper('review/product')->getSummaryHtml($this->getProductData()) ?>
                <?php endif; ?>
            </div>
            <div class="details">
                <h3><?php echo $this->htmlEscape($this->getProductData()->getName()) ?></h3>
                <?php if( $this->getRating() && $this->getRating()->getSize()): ?>
                <strong><?php echo ($this->isReviewOwner()) ? $this->__('Your Rating:') : $this->__('Rating:'); ?></strong>
                    <table cellspacing="0" class="ratings-list">
                    <?php foreach ($this->getRating() as $_rating): ?>
                    <?php if($_rating->getPercent()): ?>
                        <tr>
                            <td class="label"><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></td>
                            <td><div class="rating-box">
                                <div class="rating" style="width:<?php echo ceil($_rating->getPercent()) ?>%;"></div>
                            </div></td>
                        </tr>
                    <?php endif; ?>
                    <?php endforeach; ?>
                    </table>
                <?php endif; ?>
                <?php if ($this->isReviewOwner()): ?>
                    <?php echo $this->__('Your Review (submitted on %s):', $this->dateFormat($this->getReviewData()->getCreatedAt())) ?>
                <?php else :?>
                    <?php echo $this->__('Review (submitted on %s):', $this->dateFormat($this->getReviewData()->getCreatedAt())) ?>
                <?php endif;?>
                <div class="description">
                    <p><?php echo nl2br($this->htmlEscape($this->getReviewData()->getDetail())) ?></p>
                </div>
        </div>
        <div class="button-set"><a href="<?php echo $this->getBackUrl() ?>" class="left">&laquo; <?php echo $this->__('Back to My Reviews') ?></a></div>
    </div>
<?php endif; ?>
