cmc-sales/views/enquiries/view.ctp
2009-11-19 10:23:21 +11:00

141 lines
5.1 KiB
PHP
Executable file

<div class="enquiries-view">
<h2><?php __("Enquiry: " . $enquiry['Enquiry']['title']);?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry Number'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $enquiry['Enquiry']['title']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Assigned to User'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['User']['username'], array('controller'=> 'users', 'action'=>'view', $enquiry['User']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiry['Customer']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Contact'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Contact']['first_name'].' '.$enquiry['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiry['Contact']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['State']['name'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
&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($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('GST Applicable'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php
if($enquiry['Enquiry']['gst'] == 0) {
echo "No - GST Not Applicable";
}
else {
echo "Yes - GST Applicable";
}
?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Principle'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<span class="enquiry-view-comments">
<?php echo $enquiry['Enquiry']['comments']; ?>
</span>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Billing Address'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php
if($enquiry['BillingAddress']['customer_id'] != NULL) {
echo $enquiry['BillingAddress']['address'].'<br>';
echo $enquiry['BillingAddress']['city'].' '.$billingaddress['State']['name'].' '.$enquiry['BillingAddress']['postcode'].'<br>';
echo '<b>'.$billingaddress['Country']['name'].'</b>';
}
else {
echo 'No Billing Address Assigned for this Enquiry';
}
?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Address'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php
if($enquiry['ShippingAddress']['customer_id'] != NULL) {
echo $enquiry['ShippingAddress']['address'].'<br>';
echo $enquiry['ShippingAddress']['city'].' '.$shippingaddress['State']['name'].' '.$enquiry['ShippingAddress']['postcode'].'<br>';
echo '<b>'.$shippingaddress['Country']['name'].'</b>';
}
else { echo 'No Shipping Address Assigned for this Enquiry';
}
?>
&nbsp;
</dd>
</dl>
<div class="enquiry-actions">
<ul>
<li><?php echo $html->link(__('Edit Enquiry', true), array('action'=>'edit', $enquiry['Enquiry']['id'])); ?> </li>
</ul>
</div>
</div>
<div class="principle-emails">
<?php
$boxdata = array();
$boxdata['enquirynumber'] = $enquiry['Enquiry']['title'];
//$boxdata['principle_emails'] = $principle_emails;
?>
<?php echo $this->element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'],
'principle_emails' => $principle_emails )); ?>
</div>
<div id="showemail">
</div>
<? /*
<div class="related">
<h3>
<?php __($number_of_emails.' Emails for this Enquiry');?><?php echo $html->image('internet-mail.png'); ?></h3>
<?php //echo $this->element('email_table_ajax', $enquiry); ?>
<?php echo $this->element('email_table_ajax', $enquiry, array('cache'=>'+1 day')); ?>
</div>
<div class="related">
<h3><?php __($number_of_files.' Files in this Enquiry');?><?php echo $html->image('document.png'); ?></h3>
<?php echo $this->element('enquiry_file_table', $files); ?>
</div>
*
*/
?>
<div class="related">
<h3><?php __($number_of_quotes.' Quotes in this Enquiry');?></h3>
<?php echo $this->element('quote_table', $quotes); ?>
</div>
<?php debug($quotes); ?>