<?php if (!empty($emails)):?>
<table cellpadding = "0" cellspacing = "0" class="emailtable">
	<tr>
		<th><?php __('Email Date'); ?></th>
		<th><?php __('Subject'); ?></th>
		<th><?php __('To'); ?></th>
		<th><?php __('CC'); ?></th>	
		<th><?php __('From'); ?></th>
		
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($emails as $email):
			$class = null;
			
			if ($i % 2 == 0) {
				$class = ' class="altrow"';
			}
			$i++;			
		?>
		
		<tr<?php echo $class;?>>
			
			<td><?php echo $email['Email']['date'];?></td>
			<td><?php echo $html->link($email['Email']['subject'], array('controller'=> 'emails', 'action'=>'view/', $email['Email']['id'])); ?></td>
			<td><?php echo $email['Email']['to']; ?></td>
			<td><?php echo $email['Email']['cc']; ?></td>
			<td><?php echo $email['Email']['from']; ?></td>
				
			<td class="actions">
				<?php echo $html->link(__('View', true), array('controller'=> 'emails', 'action'=>'view/', $email['Email']['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>
