2009-01-12 21:13:18 -08:00
|
|
|
<?php if (!empty($addresses)):?>
|
|
|
|
|
<table cellpadding = "0" cellspacing = "0">
|
|
|
|
|
<tr>
|
|
|
|
|
<th><?php __('Address'); ?></th>
|
|
|
|
|
<th><?php __('City'); ?></th>
|
|
|
|
|
<th><?php __('State'); ?></th>
|
2009-07-12 23:55:17 -07:00
|
|
|
<th><?php __('Post Code'); ?></th>
|
2009-01-12 21:13:18 -08:00
|
|
|
<th><?php __('Country'); ?></th>
|
|
|
|
|
<th><?php __('Type'); ?></th>
|
|
|
|
|
<th class="actions"><?php __('Actions');?></th>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
$i = 0;
|
|
|
|
|
foreach ($addresses as $address):
|
|
|
|
|
$class = null;
|
|
|
|
|
if ($i++ % 2 == 0) {
|
|
|
|
|
$class = ' class="altrow"';
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<tr<?php echo $class;?>>
|
|
|
|
|
<td><?php echo $address['Address']['address'];?></td>
|
|
|
|
|
<td><?php echo $address['Address']['city'];?></td>
|
|
|
|
|
<td><?php echo $html->link(__($address['State']['name'], true), array('controller'=>'states', 'action' => 'view', $address['State']['id']));?></td>
|
2009-07-12 23:55:17 -07:00
|
|
|
<td><?php echo $address['Address']['postcode']; ?></td>
|
2009-01-12 21:13:18 -08:00
|
|
|
<td><?php echo $html->link(__($address['Country']['name'], true), array('controller'=>'countries', 'action' => 'view', $address['Country']['id']));?></td>
|
|
|
|
|
<td><?php
|
|
|
|
|
|
2009-09-10 19:50:16 -07:00
|
|
|
/* Could probably use an Enum in the table instead.
|
|
|
|
|
* This will stay for now though */
|
2009-01-12 21:13:18 -08:00
|
|
|
switch($address['Address']['type']) {
|
|
|
|
|
case 0:
|
|
|
|
|
echo "Billing";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
echo "Shipping";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
echo "Both Shipping and Billing";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
?></td>
|
|
|
|
|
<td class="actions">
|
|
|
|
|
<?php echo $html->link(__('View', true), array('controller'=> 'addresses', 'action'=>'view', $address['Address']['id'])); ?>
|
|
|
|
|
<?php echo $html->link(__('Edit', true), array('controller'=> 'addresses', 'action'=>'edit', $address['Address']['id'])); ?>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</table>
|
|
|
|
|
<?php endif; ?>
|