cmc-sales/views/principles/view.ctp

123 lines
4.3 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 __('Short Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['short_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 __('URL'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($principle['Principle']['url'], $principle['Principle']['url']); ?>
&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 __('Title'); ?></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['title'];?></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>