git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@262 97e9348a-65ac-dc4b-aefc-98561f571b83
137 lines
4.2 KiB
PHP
137 lines
4.2 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
echo '<div class="contact view">' . "\n";
|
|
|
|
/**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
* Contact Detail Main Section
|
|
*/
|
|
|
|
$rows = array(array('First Name', $contact['Contact']['first_name']),
|
|
array('Middle Name', $contact['Contact']['middle_name']),
|
|
array('Last Name', $contact['Contact']['last_name']),
|
|
array('Company', $contact['Contact']['company_name']),
|
|
array('SSN', $contact['Contact']['id_federal']),
|
|
array('ID', ($contact['Contact']['id_local']
|
|
. ($contact['Contact']['id_local']
|
|
? " - ".$contact['Contact']['id_local_state']
|
|
: ""))),
|
|
array('Comment', $contact['Contact']['comment']));
|
|
|
|
echo $this->element('table',
|
|
array('class' => 'item contact detail',
|
|
'caption' => 'Contact Details',
|
|
'rows' => $rows,
|
|
'column_class' => array('field', 'value')));
|
|
|
|
|
|
/**********************************************************************
|
|
* Contact Info Box
|
|
*/
|
|
|
|
echo '<div class="infobox">' . "\n";
|
|
$rows = array();
|
|
echo $this->element('table',
|
|
array('class' => 'summary',
|
|
'rows' => $rows,
|
|
'column_class' => array('field', 'value'),
|
|
'suppress_alternate_rows' => true,
|
|
));
|
|
echo '</div>' . "\n";
|
|
|
|
|
|
/**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
* Supporting Elements Section
|
|
*/
|
|
|
|
echo '<div CLASS="detail supporting">' . "\n";
|
|
|
|
|
|
/**********************************************************************
|
|
* Phones
|
|
*/
|
|
$headers = array('Phone', 'Preference', 'Comment');
|
|
$rows = array();
|
|
foreach($contact['ContactPhone'] AS $phone) {
|
|
$rows[] = array(FormatHelper::phone($phone['phone']) .
|
|
($phone['ext'] ? " x".$phone['ext'] : ""),
|
|
$phone['ContactsMethod']['preference'] . " / " .
|
|
$phone['ContactsMethod']['type'] . " / " .
|
|
$phone['type'],
|
|
$phone['comment']);
|
|
}
|
|
|
|
echo $this->element('table',
|
|
array('class' => 'item phone list',
|
|
'caption' => 'Phone',
|
|
'headers' => $headers,
|
|
'rows' => $rows,
|
|
'column_class' => $headers));
|
|
|
|
|
|
/**********************************************************************
|
|
* Addresses
|
|
*/
|
|
$headers = array('Address', 'Preference', 'Comment');
|
|
$rows = array();
|
|
foreach($contact['ContactAddress'] AS $address) {
|
|
$rows[] = array(preg_replace("/\n/", "<BR>\n", $address['address']) . "<BR>\n" .
|
|
$address['city'] . ", " .
|
|
$address['state'] . " " .
|
|
$address['postcode'],
|
|
//. ? "<BR>\n" . $address['country'],
|
|
$address['ContactsMethod']['preference'] . " / " .
|
|
$address['ContactsMethod']['type'],
|
|
$address['comment']);
|
|
}
|
|
|
|
echo $this->element('table',
|
|
array('class' => 'item address list',
|
|
'caption' => 'Address',
|
|
'headers' => $headers,
|
|
'rows' => $rows,
|
|
'column_class' => $headers));
|
|
|
|
|
|
/**********************************************************************
|
|
* Emails
|
|
*/
|
|
$headers = array('Email', 'Preference', 'Comment');
|
|
$rows = array();
|
|
foreach($contact['ContactEmail'] AS $email) {
|
|
$rows[] = array($email['email'],
|
|
$email['ContactsMethod']['preference'] . " / " .
|
|
$email['ContactsMethod']['type'],
|
|
$email['comment']);
|
|
}
|
|
|
|
echo $this->element('table',
|
|
array('class' => 'item email list',
|
|
'caption' => 'Email',
|
|
'headers' => $headers,
|
|
'rows' => $rows,
|
|
'column_class' => $headers));
|
|
|
|
|
|
/**********************************************************************
|
|
* Customers
|
|
*/
|
|
|
|
echo $this->element('customers', array
|
|
('config' => array
|
|
('caption' => 'Related Customers',
|
|
'rows' => $contact['Customer'],
|
|
)));
|
|
|
|
|
|
/* End "detail supporting" div */
|
|
echo '</div>' . "\n";
|
|
|
|
/* End page div */
|
|
echo '</div>' . "\n";
|