cmc-sales/app/views/purchase_orders/index.ctp

99 lines
3.6 KiB
Plaintext
Raw Normal View History

2010-07-16 00:52:57 -07:00
<div class="purchaseOrders index">
<h2><?php __('PurchaseOrders');?></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>
2010-07-16 00:52:57 -07:00
<th><?php echo $paginator->sort('issue_date');?></th>
<th><?php echo $paginator->sort('dispatch_date');?></th>
2010-09-06 21:35:25 -07:00
<th><?php echo $paginator->sort('Date Arrived @ CMC');?></th>
2010-09-06 21:27:01 -07:00
<th><?php echo $paginator->sort('PO Number');?></th>
<th>Jobs</th>
2010-07-16 00:52:57 -07:00
<th><?php echo $paginator->sort('principle_id');?></th>
<th><?php echo $paginator->sort('principle_reference');?></th>
2010-09-06 21:28:12 -07:00
<? /*<th><?php echo $paginator->sort('document_id');?></th> */?>
2010-07-16 00:52:57 -07:00
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($purchaseOrders as $purchaseOrder):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
$jobLink = "";
foreach($purchaseOrder['Job'] as $job) {
$jobLink .= $html->link($job['title']." ", array('controller'=>'jobs', 'action'=>'view', $job['id']));
}
2010-07-16 00:52:57 -07:00
?>
<tr<?php echo $class;?>>
2010-07-16 00:52:57 -07:00
<td>
2010-09-06 21:13:15 -07:00
<?php echo isEmptyDate($purchaseOrder['PurchaseOrder']['issue_date']); ?>
2010-07-16 00:52:57 -07:00
</td>
<td>
2010-09-06 21:13:15 -07:00
<?php echo isEmptyDate($purchaseOrder['PurchaseOrder']['dispatch_date']); ?>
2010-07-16 00:52:57 -07:00
</td>
<td>
2010-09-06 21:13:15 -07:00
<?php echo isEmptyDate($purchaseOrder['PurchaseOrder']['date_arrived']); ?>
2010-07-16 00:52:57 -07:00
</td>
<td>
2010-09-06 21:27:01 -07:00
<?php echo $html->link($purchaseOrder['PurchaseOrder']['title'], array('controller'=>'purchase_orders', 'action'=>'view', $purchaseOrder['PurchaseOrder']['id'])); ?>
2010-07-16 00:52:57 -07:00
</td>
<td class="tinytext">
<?php echo $jobLink; ?>
</td>
2010-07-16 00:52:57 -07:00
<td>
<?php echo $html->link($purchaseOrder['Principle']['name'], array('controller' => 'principles', 'action' => 'view', $purchaseOrder['Principle']['id'])); ?>
</td>
<td>
<?php echo $purchaseOrder['PurchaseOrder']['principle_reference']; ?>
</td>
2010-09-06 21:28:12 -07:00
<? /*<td>
2010-07-16 00:52:57 -07:00
<?php echo $html->link($purchaseOrder['Document']['id'], array('controller' => 'documents', 'action' => 'view', $purchaseOrder['Document']['id'])); ?>
2010-09-06 21:28:12 -07:00
</td>*/ ?>
2010-07-16 00:52:57 -07:00
<td class="actions">
<?php echo $html->link(__('View', true), array('action' => 'view', $purchaseOrder['PurchaseOrder']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $purchaseOrder['PurchaseOrder']['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 PurchaseOrder', true), array('action' => 'add')); ?></li>
<li><?php echo $html->link(__('List Principles', true), array('controller' => 'principles', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Principle', true), array('controller' => 'principles', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Documents', true), array('controller' => 'documents', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Document', true), array('controller' => 'documents', '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>
</ul>
</div>
2010-09-06 21:13:15 -07:00
<?php
function isEmptyDate($date) {
if($date == "0000-00-00") {
return "-";
}
else {
return $date;
}
}
?>
<?php debug($purchaseOrders);?>