
<div class="box-account box-recent">
<?php $_orders = $this->getOrders(); ?>
        <h3 class="font14"><?php echo $this->__('Recent Orders') ?>  </h3>
    <table bordercolor="#e3e3e3" border="1" width="100%" class="data-table1" id="my-orders-table">
        <tbody>
            <tr>
                <th><?php echo $this->__('Order #') ?></th>
                <th><?php echo $this->__('Date') ?></th>
                <th><?php echo $this->__('Ship to') ?></th>
                <th><span class="nobr"><?php echo $this->__('Order Total') ?></span></th>
                <th><?php echo $this->__('Order Status') ?></th>
                <th><?php echo $this->__('Payment Method') ?></th>
                <th><?php echo $this->__('Action') ?></th>
            </tr>
       <?php if( sizeof($_orders->getItems()) > 0 ): ?>
            <?php foreach ($_orders as $_order): ?>
                <tr>
                    <td><?php echo $_order->getRealOrderId() ?></td>
                    <td><span class="nobr"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></span></td>
                    <td><?php echo $_order->getShippingAddress() ? $this->htmlEscape($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
                    <td><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
                    <td><?php echo $_order->getStatusLabel() ?></td>
                    <td><?php echo $_order->getPayment()->getMethodInstance()->getTitle();?></td>
                    <td class="a-left">
						<span >
						<a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?></a>
						</span>
						<?php if($_order->getStatus()=='pending' && $this->canOnlinePayment($_order)): ?>
						<span class="separator">|</span>
						<span>
						<a href="<?php echo $_order->getPayment()->getMethodInstance()->getPaymentRedirectUrl().'order_id/'.$_order->getRealOrderId()?>" target="_blank"><?php echo $this->__('Go to pay') ?></a>
						</span>
						<?php endif; ?>
						<?php if($_order->getStatus()=='pending' || $_order->getStatus()=='pending_processing' || $_order->getStatus()=='Processing'): ?>
						<span class="separator">|</span>
						<span>
						<a href="<?php echo $this->getCancelUrl($_order) ?>"><?php echo $this->__('Cancel Order') ?></a>
						</span>
						<?php endif; ?>
					</td>
                </tr>
            <?php endforeach; ?>
            <tr>
            	<td colspan="7"><span class="bfR"><a href="<?php echo $this->getUrl('sales/order/history') ?>"><?php echo $this->__('View All') ?></a>&gt;&gt;</span></td>
            </tr>
			<?php else: ?>
            <tr>
            	<td colspan="7"><?php echo $this->__('You have placed no orders.'); ?></td>
            </tr>
			<?php endif; ?>
        </tbody>
    </table>
</div>
