cmc-sales/views/principles/view.ctp
2009-03-20 09:11:22 +11:00

130 lines
5 KiB
PHP
Executable file

<div class="principles view">
<h2><?php __('Principle');?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Code'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['code']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($principle['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $principle['Country']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Currency'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($principle['Currency']['name'], array('controller'=> 'currencies', 'action'=>'view', $principle['Currency']['id'])); ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit Principle', true), array('action'=>'edit', $principle['Principle']['id'])); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php __('Principle Contacts');?> <?php echo $html->image('system-users.png'); ?></h3>
<?php if (!empty($principle['PrincipleContact'])):?>
<? echo $this->element('principle_contacts', $principleContacts); ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Contact for this Principle', true), array('controller'=> 'principle_contacts', 'action'=>'add/principleid:'.$principle['Principle']['id']));?><?php echo $html->link($html->image('contact-new.png'), array('controller'=> 'principle_contacts', 'action'=>'add/customerid:'.$principle['Principle']['id']), null, null, false); ?> </li>
</ul>
</div>
</div>
<div class="related">
<h3><?php __('Addresses');?> <?php echo $html->image('x-office-address-book.png'); ?></h3>
<?php if (!empty($principle['PrincipleAddress'])):?>
<? echo $this->element('principle_address_table', $addresses); ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Address for this Principle', true), array('controller'=> 'principle_addresses', 'action'=>'add/principleid:'.$principle['Principle']['id']));?> </li>
</ul>
</div>
</div>
<div class="related">
<h3><?php __('Related Enquiries');?></h3>
<?php if (!empty($principle['Enquiry'])):?>
<? echo $this->element('enquiry_table', $enquiries); ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add'));?> </li>
</ul>
</div>
</div>
<div class="related">
<h3><?php __('Related Products');?></h3>
<?php if (!empty($principle['Product'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Principle Id'); ?></th>
<th><?php __('Title'); ?></th>
<th><?php __('Description'); ?></th>
<th><?php __('Principle Part Number'); ?></th>
<th><?php __('Cmc Part Number'); ?></th>
<th><?php __('Costprice Each'); ?></th>
<th><?php __('Our Discount'); ?></th>
<th><?php __('Packing Each'); ?></th>
<th><?php __('Shipping Weight Each'); ?></th>
<th><?php __('Shipping Cost Each'); ?></th>
<th><?php __('Duty'); ?></th>
<th><?php __('Target Gp'); ?></th>
<th><?php __('Sellprice Each'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($principle['Product'] as $product):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $product['id'];?></td>
<td><?php echo $product['principle_id'];?></td>
<td><?php echo $product['title'];?></td>
<td><?php echo $product['description'];?></td>
<td><?php echo $product['principle_part_number'];?></td>
<td><?php echo $product['cmc_part_number'];?></td>
<td><?php echo $product['costprice_each'];?></td>
<td><?php echo $product['our_discount'];?></td>
<td><?php echo $product['packing_each'];?></td>
<td><?php echo $product['shipping_weight_each'];?></td>
<td><?php echo $product['shipping_cost_each'];?></td>
<td><?php echo $product['duty'];?></td>
<td><?php echo $product['target_gp'];?></td>
<td><?php echo $product['sellprice_each'];?></td>
<td class="actions">
<?php echo $html->link(__('View', true), array('controller'=> 'products', 'action'=>'view', $product['id'])); ?>
<?php echo $html->link(__('Edit', true), array('controller'=> 'products', 'action'=>'edit', $product['id'])); ?>
<?php echo $html->link(__('Delete', true), array('controller'=> 'products', 'action'=>'delete', $product['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $product['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Product', true), array('controller'=> 'products', 'action'=>'add'));?> </li>
</ul>
</div>
</div>