<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php $_items = $this->getItems(); ?>
<h1><?php echo Mage::helper('downloadable')->__('My Downloadable Products') ?></h1>
<?php if(count($_items)): ?>

<table class="data-table1" id="my-downloadable-products-table">
			<tr>
				<th><?php echo Mage::helper('downloadable')->__('Order #') ?></th>
				<th><?php echo Mage::helper('downloadable')->__('Date') ?></th>
				<th><?php echo Mage::helper('downloadable')->__('Title') ?></th>
				<th><?php echo Mage::helper('downloadable')->__('Status') ?></th>
				<th><?php echo Mage::helper('downloadable')->__('Remaining Downloads') ?></th>
			</tr>

		<tbody>
			<?php $_odd = ''; ?>
			<?php foreach ($_items as $_item): ?>
				<tr>
					<td><a href="<?php echo $this->getOrderViewUrl($_item->getPurchased()->getOrderId()) ?>" title="<?php echo Mage::helper('downloadable')->__('View Order') ?>"><?php echo $_item->getPurchased()->getOrderIncrementId() ?></a></td>
					<td><span class="nobr"><?php echo $this->formatDate($_item->getPurchased()->getCreatedAt()) ?></span></td>
					<td><?php echo $this->htmlEscape($_item->getPurchased()->getProductName()) ?> - <a href="<?php echo $this->getDownloadUrl($_item) ?>" title="<?php echo Mage::helper('downloadable')->__('Start Download') ?>" <?php echo $this->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':''; ?>><?php echo $_item->getLinkTitle() ?></a></td>
					<td><?php echo Mage::helper('downloadable')->__(ucfirst($_item->getStatus())) ?></td>
					<td><?php echo $this->getRemainingDownloads($_item) ?></td>
				</tr>
			<?php endforeach; ?>
		</tbody>
	</table>
	<script type="text/javascript">decorateTable('my-downloadable-products-table')</script>
<?php else: ?>
	<p><?php echo Mage::helper('downloadable')->__('You have not purchased any downloadable products yet.'); ?></p>
<?php endif; ?>
<?php echo $this->getChildHtml('pager'); ?>
