+/* List search results */
+function display_result($res, $includesource = true) {
+ global $color;
+
+ if(sizeof($res) <= 0) return;
+
+ insert_javascript();
+
+ $line = 0;
+ echo html_tag( 'table', '', 'center', '', 'border="0" width="98%"' ) .
+ html_tag( 'tr', '', '', $color[9] ) .
+ html_tag( 'th', ' ', 'left' ) .
+ html_tag( 'th', ' ' . _("Name"), 'left' ) .
+ html_tag( 'th', ' ' . _("E-mail"), 'left' ) .
+ html_tag( 'th', ' ' . _("Info"), 'left' );
+
+ if ($includesource) {
+ echo html_tag( 'th', ' ' . _("Source"), 'left', 'width="10%"' );
+ }
+ echo "</tr>\n";
+
+ while (list($undef, $row) = each($res)) {
+ $tr_bgcolor = '';
+ $email = htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES);
+ if ($line % 2) { $tr_bgcolor = $color[0]; }
+ echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
+ html_tag( 'td',
+ '<small><a href="javascript:to_address(' .
+ "'" . $email . "');\">To</A> | " .
+ '<a href="javascript:cc_address(' .
+ "'" . $email . "');\">Cc</A> | " .
+ '<a href="javascript:bcc_address(' .
+ "'" . $email . "');\">Bcc</A></small>",
+ 'center', '', 'valign="top" width="5%" nowrap' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['name']), 'left', '', 'valign="top" nowrap' ) .
+ html_tag( 'td', ' ' .
+ '<a href="javascript:to_and_close(' .
+ "'" . $email . "');\">" . htmlspecialchars($row['email']) . '</A>'
+ , 'left', '', 'valign="top"' ) .
+ html_tag( 'td', htmlspecialchars($row['label']), 'left', '', 'valign="top" nowrap' );
+ if ($includesource) {
+ echo html_tag( 'td', ' ' . $row['source'], 'left', '', 'valign="top" nowrap' );
+ }
+
+ echo "</tr>\n";
+ $line++;