121 lines
4 KiB
PHP
Executable file
121 lines
4 KiB
PHP
Executable file
<?php //echo $javascript->link('jobindex'); ?>
|
|
|
|
|
|
<h2><?php __('Jobs');?></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" class="mer">
|
|
<tr>
|
|
|
|
<th><?php echo $paginator->sort('created');?></th>
|
|
<th><?php echo $paginator->sort('Job Number');?></th>
|
|
<th><?php echo $paginator->sort('enquiry_id');?></th>
|
|
<th>POs</th>
|
|
<th><?php echo $paginator->sort('Customer');?></th>
|
|
<th><?php echo $paginator->sort('customer_order_number');?></th>
|
|
|
|
<th><?php echo $paginator->sort('date_order_received');?></th>
|
|
|
|
<th><?php echo $paginator->sort('date_order_sent_to_customer');?></th>
|
|
|
|
|
|
<th><?php echo $paginator->sort('domestic_freight_paid_by');?></th>
|
|
<th><?php echo $paginator->sort('sale_category');?></th>
|
|
<th><?php echo $paginator->sort('shipment_category');?></th>
|
|
<th><?php echo $paginator->sort('comments');?></th>
|
|
<th class="actions"><?php __('Actions');?></th>
|
|
</tr>
|
|
<?php
|
|
$i = 0;
|
|
foreach ($jobs as $job):
|
|
$class = null;
|
|
if ($i++ % 2 == 0) {
|
|
$class = ' class="altrow"';
|
|
}
|
|
|
|
$poLink = "";
|
|
foreach($job['PurchaseOrder'] as $po) {
|
|
$poLink .= $html->link($po['title']." ", array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));
|
|
}
|
|
|
|
?>
|
|
<tr<?php echo $class;?>>
|
|
|
|
|
|
|
|
<td class="enqdate">
|
|
<?php
|
|
/* Change the date from MySQL DATETIME to a D M Y format */
|
|
echo date('j M Y',$time->toUnix($job['Job']['created'])); ?>
|
|
</td>
|
|
|
|
<td>
|
|
<?php echo $html->link(__($job['Job']['title'], true), array('action' => 'view', $job['Job']['id'])); ?>
|
|
</td>
|
|
<td class="tinytext">
|
|
<?php echo $html->link($job['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $job['Enquiry']['id'])); ?>
|
|
</td>
|
|
<td><?=$poLink?></td>
|
|
<td>
|
|
<?php echo $html->link($job['Customer']['name'], array('controller'=>'customers',
|
|
'action'=>'view', $job['Job']['customer_id'])); ?>
|
|
</td>
|
|
<td>
|
|
<?php echo $job['Job']['customer_order_number']; ?>
|
|
</td>
|
|
|
|
|
|
<td>
|
|
|
|
<?php echo $job['Job']['date_order_received']; ?>
|
|
</td>
|
|
|
|
|
|
<td>
|
|
<?php echo isEmptyDate($job['Job']['date_order_sent_to_customer']); ?>
|
|
</td>
|
|
|
|
<td>
|
|
<?php echo $job['Job']['domestic_freight_paid_by']; ?>
|
|
</td>
|
|
<td>
|
|
<?php echo $job['Job']['sale_category']; ?>
|
|
</td>
|
|
<td>
|
|
<?php echo $job['Job']['shipment_category']; ?>
|
|
</td>
|
|
<td class="tinytext">
|
|
<?php echo $job['Job']['comments']; ?>
|
|
</td>
|
|
<td class="actions">
|
|
<?php //echo $html->link(__('View', true), array('action' => 'view', $job['Job']['id'])); ?>
|
|
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $job['Job']['id']), array('class'=>'editWindow')); ?>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
<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;
|
|
}
|
|
}
|
|
?>
|
|
|
|
<?php debug($jobs); ?>
|