' . "\n"; /********************************************************************** ********************************************************************** ********************************************************************** ********************************************************************** * Contact Detail Main Section */ $phones = $contact['ContactPhone']; $addresses = $contact['ContactAddress']; $emails = $contact['ContactEmail']; if (isset($contact['Contact'])) $contact = $contact['Contact']; $rows = array(); $rows[] = array('First Name', $contact['first_name']); $rows[] = array('Middle Name', $contact['middle_name']); $rows[] = array('Last Name', $contact['last_name']); $rows[] = array('Company', $contact['company_name']); $rows[] = array('SSN', $contact['id_federal']); $rows[] = array('ID', ($contact['id_local'] . ($contact['id_local'] ? " - ".$contact['id_local_state'] : ""))); $rows[] = array('Comment', $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 '
' . "\n"; $rows = array(); echo $this->element('table', array('class' => 'summary', 'rows' => $rows, 'column_class' => array('field', 'value'), 'suppress_alternate_rows' => true, )); echo '
' . "\n"; /********************************************************************** ********************************************************************** ********************************************************************** ********************************************************************** * Supporting Elements Section */ echo '
' . "\n"; /********************************************************************** * Phones */ $headers = array('Phone', 'Preference', 'Comment'); $rows = array(); foreach($phones 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($addresses AS $address) { $rows[] = array(preg_replace("/\n/", "
\n", $address['address']) . "
\n" . $address['city'] . ", " . $address['state'] . " " . $address['postcode'], //. ? "
\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($emails 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 (// Grid configuration 'config' => array ('caption' => 'Related Customers', 'filter' => array('Contact.id' => $contact['id']), ))); /* End "detail supporting" div */ echo '
' . "\n"; /* End page div */ echo '' . "\n";