<?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->canShow() && $this->getEvents() && count($this->getEvents())): ?>
<div class="account-block">
    <h4 class="legend"><?php echo Mage::helper('enterprise_customerbalance')->__('Balance History'); ?></h4>
    <table id="customerbalance-history" class="data-table">
        <col />
        <col width="100" />
        <col width="100" />
        <col width="150" />
        <thead>
            <tr>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Action'); ?></th>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Balance Change'); ?></th>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Balance'); ?></th>
                <th><?php echo Mage::helper('enterprise_customerbalance')->__('Date'); ?></th>
            </tr>
        </thead>
        <?php foreach ($this->getEvents() as $event): ?>
        <tbody>
            <tr>
                <td><?php echo $this->getActionLabel($event->getAction()); ?></td>
                <td><?php echo Mage::helper('core')->currency($event->getBalanceDelta()); ?></td>
                <td><?php echo Mage::helper('core')->currency($event->getBalanceAmount()); ?></td>
                <td><?php echo Mage::helper('core')->formatDate($event->getUpdatedAt(), 'short', true); ?></td>
            </tr>
        </tbody>
        <?php endforeach; ?>
    </table>
    <script type="text/javascript">decorateTable('customerbalance-history')</script>
</div>
<?php endif; ?>
