94 lines
2.8 KiB
PHP
Executable file
94 lines
2.8 KiB
PHP
Executable file
<div class="purchaseOrders index">
|
|
<h2><?php __('PurchaseOrders');?></h2>
|
|
|
|
<div class="actions">
|
|
<a href="/documents/newDocument/purchaseOrder">New Purchase Order</a>
|
|
</div>
|
|
<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('issue_date');?></th>
|
|
<th><?php echo $paginator->sort('dispatch_date');?></th>
|
|
<th><?php echo $paginator->sort('Date Arrived @ CMC');?></th>
|
|
<th><?php echo $paginator->sort('PO Number');?></th>
|
|
<th>Jobs</th>
|
|
<th><?php echo $paginator->sort('principle_id');?></th>
|
|
<th><?php echo $paginator->sort('principle_reference');?></th>
|
|
<? /*<th><?php echo $paginator->sort('document_id');?></th> */?>
|
|
<th>Document</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']));
|
|
}
|
|
|
|
?>
|
|
<tr<?php echo $class;?>>
|
|
|
|
<td>
|
|
<?php echo isEmptyDate($purchaseOrder['PurchaseOrder']['issue_date']); ?>
|
|
</td>
|
|
<td>
|
|
<?php echo isEmptyDate($purchaseOrder['PurchaseOrder']['dispatch_date']); ?>
|
|
</td>
|
|
<td>
|
|
<?php echo isEmptyDate($purchaseOrder['PurchaseOrder']['date_arrived']); ?>
|
|
</td>
|
|
<td>
|
|
<?php echo $html->link($purchaseOrder['PurchaseOrder']['title'], array('controller'=>'purchase_orders', 'action'=>'view', $purchaseOrder['PurchaseOrder']['id'])); ?>
|
|
</td>
|
|
<td class="tinytext">
|
|
<?php echo $jobLink; ?>
|
|
</td>
|
|
<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>
|
|
<? /*<td>
|
|
<?php echo $html->link($purchaseOrder['Document']['id'], array('controller' => 'documents', 'action' => 'view', $purchaseOrder['Document']['id'])); ?>
|
|
</td>*/ ?>
|
|
<td>
|
|
<?php if($purchaseOrder['PurchaseOrder']['document_id'] > 0) { ?>
|
|
<a href="/documents/view/<?=$purchaseOrder['PurchaseOrder']['document_id']; ?>">View</a>
|
|
<a href="/documents/revise/<?=$purchaseOrder['PurchaseOrder']['document_id']; ?>">Revise</a>
|
|
<?php } ?>
|
|
</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>
|
|
|
|
<?php
|
|
|
|
function isEmptyDate($date) {
|
|
if($date == "0000-00-00") {
|
|
return "-";
|
|
}
|
|
else {
|
|
return $date;
|
|
}
|
|
}
|
|
?>
|
|
|