<?php
	$coll = $this->getCollection();
	$coll->load();
?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div class="page-head">
    <h3><?php echo $this->__('My Support Tickets') ?></h3>
</div>
<?php if( $this->getCollection() && $this->count()): ?>
    <?php echo $this->getToolbarHtml() ?>
        <table class="data-table box-table" id="my-reviews-table" cellspacing="0">
			<col width="65" />
			<col width="170" />
			<col width="220"/>
			<col width="40" />
			<col width="60" />
			<!--col width="30" /-->
			<thead>
				<tr>
					<th><?php echo $this->__('ID') ?></th>
					<th><?php echo $this->__('Department') ?></th>
					<th><?php echo $this->__('Title') ?></th>
					<th><?php echo $this->__('Replies') ?></th>
					<th><?php echo $this->__('Status') ?></th>
					<!--th class="last a-center"></th-->
				</tr>
			</thead>
			<tbody>
				<?php foreach ($coll as $_hd): ?>
				<tr onclick="window.location.href='<?php echo $this->getTicketLink($_hd->getId())?>'" class="ticket-row">
					<td  onclick="window.location.href='<?php echo $this->getTicketLink($_hd->getId())?>'" style="white-space:nowrap;"><?php echo $_hd->getUid() ?></td>
					<td onclick="window.location.href='<?php echo $this->getTicketLink($_hd->getId())?>'" ><?php echo $this->__($_hd->getDepartment()->getName()) ?></td> 
					<td onclick="window.location.href='<?php echo $this->getTicketLink($_hd->getId())?>'" ><?php echo htmlentities($_hd->getTitle(), null, "UTF-8") ?></td>
					<td onclick="window.location.href='<?php echo $this->getTicketLink($_hd->getId())?>'" ><?php echo $_hd->getTotalReplies() ?></td>
					<td onclick="window.location.href='<?php echo $this->getTicketLink($_hd->getId())?>'" ><?php echo $_hd->getStatusText() ?></td>
					<!--td class="last a-center"><a href="<?php echo $this->getTicketLink($_hd->getId()) ?>"><?php echo $this->__('View') ?></a></td-->
				</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
<script type="text/javascript">decorateTable('my-reviews-table')</script>
    <?php echo $this->getToolbarHtml() ?>
<?php else: ?>
    <p><?php echo $this->__('You have submitted no tickets') ?></p>
<?php endif; ?>
