element('table', array('class' => 'item contact detail', 'caption' => 'Contact Details', 'rows' => $rows, 'column_class' => array('field', 'value'))); /********************************************************************** * Contact Info Box */ ?>
element('table', array('class' => 'item phone list', 'caption' => 'Phone', '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)); /********************************************************************** * Addresses */ $headers = array('Address', 'Preference', 'Comment'); $rows = array(); foreach($contact['ContactAddress'] 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)); /********************************************************************** * Customers */ echo $this->element('customers', array('heading' => '', 'caption' => 'Related Customers', 'customers' => $contact['Customer'])); /* End "detail supporting" DIV */ ?>