cmc-sales/views/principles/view.ctp
2011-05-24 19:43:26 +10:00

130 lines
4.1 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($principleContacts)):?>
<? echo $this->element('principle_contacts', $principleContacts); ?>
<?php endif; ?>
<button id="addPrincipleUser">Add Principle Contact</button>
</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>
<div id="enquiryTable">
<? echo $this->element('enquiry_table', $enquiries); ?>
</div>
<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>
<? echo $javascript->link('add_edit_user'); ?>
<div id="addUserDiv">
</div>
<span class="principle_id" id="<?=$principle['Principle']['id'];?>"></span>
<?php debug($principle); ?>