2011-04-12 23:37:34 -07:00
|
|
|
<div class="shipments index">
|
|
|
|
|
<h2><?php __('Shipments');?></h2>
|
2011-04-28 00:47:34 -07:00
|
|
|
|
|
|
|
|
|
2011-04-12 23:37:34 -07:00
|
|
|
<?php echo $javascript->link('shipment_index');?>
|
|
|
|
|
<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>
|
2011-04-29 00:18:44 -07:00
|
|
|
<button class="newShipment">New Shipment</button>
|
2011-04-12 23:37:34 -07:00
|
|
|
<table cellpadding="0" cellspacing="0" class="shipments">
|
|
|
|
|
<tr>
|
2011-04-28 00:41:36 -07:00
|
|
|
<th><?php echo $paginator->sort('user_id');?></th>
|
2011-04-12 23:37:34 -07:00
|
|
|
<th><?php echo $paginator->sort('date_arrived');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('date_dispatched');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('type');?></th>
|
|
|
|
|
<th>Principle(s)</th>
|
|
|
|
|
<th>PO(s)</th>
|
|
|
|
|
<th>Jobs</th>
|
2011-04-28 21:33:36 -07:00
|
|
|
<th><?php echo $paginator->sort('# Boxes','box_count');?></th>
|
|
|
|
|
<th>Box Details<br>
|
2011-04-29 00:18:44 -07:00
|
|
|
LxWxH (cm)
|
2011-04-28 21:33:36 -07:00
|
|
|
</th>
|
2011-04-29 00:18:44 -07:00
|
|
|
<th>Weight (kg)</th>
|
2011-04-12 23:37:34 -07:00
|
|
|
<th><?php echo $paginator->sort('freight_forwarder_id');?></th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<th><?php echo $paginator->sort('airway_bill');?></th>
|
|
|
|
|
<th><?php echo $paginator->sort('comments');?></th>
|
|
|
|
|
<th class="actions"><?php __('Actions');?></th>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
$i = 0;
|
|
|
|
|
foreach ($shipments as $shipment):
|
|
|
|
|
?>
|
|
|
|
|
<tr>
|
2011-04-28 00:41:36 -07:00
|
|
|
<td>
|
|
|
|
|
<?
|
|
|
|
|
$initials = $shipment['User']['first_name'][0].$shipment['User']['last_name'][0];
|
|
|
|
|
|
|
|
|
|
echo $html->link($initials, array('controller'=> 'users', 'action'=>'view', $shipment['User']['id'])); ?>
|
|
|
|
|
</td>
|
2011-04-12 23:37:34 -07:00
|
|
|
|
|
|
|
|
<td>
|
2011-04-28 00:41:36 -07:00
|
|
|
<?php
|
|
|
|
|
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_arrived']));
|
|
|
|
|
?>
|
2011-04-12 23:37:34 -07:00
|
|
|
</td>
|
|
|
|
|
<td>
|
2011-04-28 00:41:36 -07:00
|
|
|
<?php
|
|
|
|
|
echo $this->element('isEmptyDate', array('date'=>$shipment['Shipment']['date_dispatched']));
|
|
|
|
|
?>
|
2011-04-12 23:37:34 -07:00
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
2011-04-28 00:41:36 -07:00
|
|
|
<?php echo $shipmentTypeShort[$shipment['Shipment']['type']]; ?>
|
2011-04-12 23:37:34 -07:00
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<?php foreach($shipment['Principle'] as $principle):?>
|
|
|
|
|
<? if(!empty($principle['short_name'])) {
|
|
|
|
|
echo $html->link($principle['short_name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo $html->link($principle['name'], array('controller'=>'principles','action'=>'view',$principle['id']));
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
<?php endforeach;?>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<?php foreach($shipment['PurchaseOrder'] as $po):?>
|
|
|
|
|
<?=$html->link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']));?>
|
|
|
|
|
<br>
|
|
|
|
|
<?endforeach;?>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<?php foreach($shipment['Job'] as $job):?>
|
|
|
|
|
<?=$html->link($job['title'], array('controller'=>'jobs', 'action'=>'view', $job['id']));?>
|
|
|
|
|
<br>
|
|
|
|
|
<?endforeach;?>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $shipment['Shipment']['box_count']; ?>
|
|
|
|
|
</td>
|
2011-04-28 21:33:36 -07:00
|
|
|
|
2011-04-29 00:18:44 -07:00
|
|
|
<td class="boxDimensions">
|
2011-04-28 21:33:36 -07:00
|
|
|
<?php
|
|
|
|
|
//This is nasty. Will fix this once its working.
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
$totalWeight = 0;
|
2011-04-29 00:18:44 -07:00
|
|
|
$weightString = '';
|
2011-04-28 21:33:36 -07:00
|
|
|
|
|
|
|
|
foreach($shipment['Box'] as $box):?>
|
2011-04-29 00:18:44 -07:00
|
|
|
<?=$box['length']?>x<?=$box['width']?>x<?=$box['height']?><br>
|
|
|
|
|
<?
|
|
|
|
|
$weightString .= $box['weight'].' kg <br>';
|
|
|
|
|
$totalWeight += $box['weight']; ?>
|
2011-04-28 21:33:36 -07:00
|
|
|
<?php endforeach;?>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
2011-04-29 00:18:44 -07:00
|
|
|
<td> <?
|
|
|
|
|
|
|
|
|
|
$boxCount = $shipment['Shipment']['box_count'];
|
|
|
|
|
if($boxCount > 1) {
|
|
|
|
|
echo $weightString;
|
|
|
|
|
echo '<hr>';
|
2011-04-28 21:33:36 -07:00
|
|
|
|
2011-04-29 00:18:44 -07:00
|
|
|
}?>
|
|
|
|
|
<? if($boxCount != 0): ?>
|
|
|
|
|
<span class="totalWeight"><?=$totalWeight;?> kg</span></td>
|
|
|
|
|
<? endif;?>
|
2011-04-12 23:37:34 -07:00
|
|
|
<td>
|
|
|
|
|
<?php echo $html->link($shipment['FreightForwarder']['name'], array('controller' => 'freight_forwarders', 'action' => 'view', $shipment['FreightForwarder']['id'])); ?>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $shipment['Shipment']['airway_bill']; ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td>
|
|
|
|
|
<?php echo $shipment['Shipment']['comments']; ?>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="actions">
|
2011-04-28 00:41:36 -07:00
|
|
|
|
2011-04-12 23:37:34 -07:00
|
|
|
</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>
|
2011-04-29 00:18:44 -07:00
|
|
|
<li><button class="newShipment">New Shipment</button></li>
|
2011-04-12 23:37:34 -07:00
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="dialog-form" title="New Shipment">
|
2011-04-28 00:41:36 -07:00
|
|
|
<?=$this->element('add_shipment');?>
|
2011-04-12 23:37:34 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php debug($shipments); ?>
|