cmc-sales/views/documents/index.ctp
2010-07-08 16:18:04 +10:00

97 lines
4.8 KiB
PHP

<div class="documents index">
<h2><?php __('Documents');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $paginator->sort('id');?></th>
<th><?php echo $paginator->sort('created');?></th>
<th><?php echo $paginator->sort('customer_id');?></th>
<th><?php echo $paginator->sort('enquiry_id');?></th>
<th><?php echo $paginator->sort('job_id');?></th>
<th><?php echo $paginator->sort('user_id');?></th>
<th><?php echo $paginator->sort('contact_id');?></th>
<th><?php echo $paginator->sort('type');?></th>
<th><?php echo $paginator->sort('quote_id');?></th>
<th><?php echo $paginator->sort('invoice_id');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($documents as $document):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?php echo $document['Document']['id']; ?>
</td>
<td>
<?php echo $document['Document']['created']; ?>
</td>
<td>
<?php echo $html->link($document['Customer']['name'], array('controller' => 'customers', 'action' => 'view', $document['Customer']['id'])); ?>
</td>
<td>
<?php echo $html->link($document['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $document['Enquiry']['id'])); ?>
</td>
<td>
<?php echo $html->link($document['Job']['title'], array('controller' => 'jobs', 'action' => 'view', $document['Job']['id'])); ?>
</td>
<td>
<?php echo $html->link($document['User']['username'], array('controller' => 'users', 'action' => 'view', $document['User']['id'])); ?>
</td>
<td>
<?php echo $html->link($document['Contact']['name'], array('controller' => 'contacts', 'action' => 'view', $document['Contact']['id'])); ?>
</td>
<td>
<?php echo $document['Document']['type']; ?>
</td>
<td>
<?php echo $document['Document']['quote_id']; ?>
</td>
<td>
<?php echo $document['Document']['invoice_id']; ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('action' => 'view', $document['Document']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $document['Document']['id'])); ?>
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $document['Document']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $document['Document']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Document', true), array('action' => 'add')); ?></li>
<li><?php echo $html->link(__('List Customers', true), array('controller' => 'customers', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Customer', true), array('controller' => 'customers', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Enquiries', true), array('controller' => 'enquiries', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Enquiry', true), array('controller' => 'enquiries', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Contacts', true), array('controller' => 'contacts', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Contact', true), array('controller' => 'contacts', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Invoices', true), array('controller' => 'invoices', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Invoice', true), array('controller' => 'invoices', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Pages', true), array('controller' => 'pages', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Page', true), array('controller' => 'pages', 'action' => 'add')); ?> </li>
</ul>
</div>