<?php 
$groups = $this->giftcards_groups;
?>
<?php if (!$groups->count()) { ?>
	No results found
<?php } else { ?>
	<table class="table table-normal">
		<thead>
			<td>Name</td>
			<td>Marketing event</td>
			<td>Range</td>
			<td>Gift cards</td>
			<td>Gift cards Redeemed</td>
			<td></td>
		</thead>
		<?php foreach ( $groups as $group ) { ?>
			<tr>
				<td><?php echo $group->name;?> </td>
				<td><?php echo $group->date_mkt();?> </td>
				<td><?php echo $group->range; ?></td>
				<td><?php echo $group->giftcards_total(); ?></td>
				<td><?php echo $group->giftcards_redeemed_total(); ?></td>
				<td style="width:150px;">
					<a href="/giftcards/groups/<?php echo $group->id_promo_group; ?>" class="btn btn-green admin-giftcard-group-new"><i class="icon-edit"></i> Edit</a>
					&nbsp;
					<button data-id="<?php echo $group->id_promo_group; ?>" class="btn admin-giftcard-group-remove btn-red admin-giftcard-group-new"><i class="icon-trash"></i> Remove</button>
				</td>
			</tr>
		<?php } ?>
	</table>
<?php } ?>