<?php
// @codingStandardsIgnoreFile

?>
<?php $_orders = $block->getOrders(); ?>

    <?php echo $block->getChildHtml()?>
    <?php if (sizeof($_orders->getItems()) > 0): ?>
    	<div class="table-responsive recent-orders">
	        <table class="table table-striped">
	            <caption>
	                <span><?php /* @escapeNotVerified */ echo __('Recent Orders') ?></span>
			        <?php if (sizeof($_orders->getItems()) > 0): ?>
			            <a class="btn btn-link view" href="<?php /* @escapeNotVerified */ echo $block->getUrl('sales/order/history') ?>">
			                <span><?php /* @escapeNotVerified */ echo __('View All') ?></span>
			            </a>
			        <?php endif; ?>
	            </caption>
	            <thead>
	                <tr>
	                    <th scope="col" class="id"><?php /* @escapeNotVerified */ echo __('Order #') ?></th>
	                    <th scope="col" class="date"><?php /* @escapeNotVerified */ echo __('Date') ?></th>
	                    <th scope="col" class="shipping"><?php /* @escapeNotVerified */ echo __('Ship To') ?></th>
	                    <th scope="col" class="total"><?php /* @escapeNotVerified */ echo __('Order Total') ?></th>
	                    <th scope="col" class="status"><?php /* @escapeNotVerified */ echo __('Status') ?></th>
	                    <th scope="col" class="actions"><?php /* @escapeNotVerified */ echo __('Action') ?></th>
	                </tr>
	            </thead>
	            <tbody>
	                <?php foreach ($_orders as $_order): ?>
	                    <tr>
	                        <td class="id"><?php /* @escapeNotVerified */ echo $_order->getRealOrderId() ?></td>
	                        <td class="date"><?php /* @escapeNotVerified */ echo $block->formatDate($_order->getCreatedAt()) ?></td>
	                        <td class="shipping"><?php echo $_order->getShippingAddress() ? $block->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
	                        <td class="total"><?php /* @escapeNotVerified */ echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
	                        <td class="status"><?php /* @escapeNotVerified */ echo $_order->getStatusLabel() ?></td>
	                        <td class="actions">
	                            <a href="<?php /* @escapeNotVerified */ echo $block->getViewUrl($_order) ?>" class="btn btn-link view">
	                                <?php /* @escapeNotVerified */ echo __('View Order') ?>
	                            </a>
	                            <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
	                                <a href="<?php /* @escapeNotVerified */ echo $block->getReorderUrl($_order) ?>" class="btn btn-link order">
	                                    <?php /* @escapeNotVerified */ echo __('Reorder') ?>
	                                </a>
	                            <?php endif ?>
	                        </td>
	                    </tr>
	                <?php endforeach; ?>
	            </tbody>
	        </table>
        </div>
    <?php else: ?>
        <div class="message info empty"><span><?php /* @escapeNotVerified */ echo __('You have placed no orders.'); ?></span></div>
    <?php endif; ?>

