' . ' ' . ' ' . _("Name") . ' ' . _("E-mail") . ' ' . _("Info"); if ($includesource) { echo ' ' . _("Source"); } echo "\n"; while (list($undef, $row) = each($res)) { echo '' . 'To | " . 'Cc | " . 'Bcc" . ' ' . $row['name'] . ' ' . ' " . $row['email'] . ' ' . ' ' . $row['label'] . ' '; if ($includesource) { echo ' ' . $row['source']; } echo "\n"; $line++; } echo ''; } /* ================= End of functions ================= */ require_once('../functions/array.php'); require_once('../functions/strings.php'); require_once('../functions/addressbook.php'); displayHtmlHeader(); /* Initialize vars */ if (!isset($query)) { $query = ''; } if (!isset($show)) { $show = ''; } /* Choose correct colors for top and bottom frame */ if ($show == 'form') { echo ''; } else { echo '\n"; } /* Empty search */ if (empty($query) && empty($show) && empty($listall)) { echo '


' . _("No persons matching your search was found") . "

\n\n", exit; } /* Initialize addressbook */ $abook = addressbook_init(); /* Create search form */ if ($show == 'form') { echo '
' . "\n" . '' . '
' . "\n" . ' ' . _("Search for") . "\n" . ' \n"; /* List all backends to allow the user to choose where to search */ if ($abook->numbackends > 1) { echo '' . _("in") . ' \n"; } else { echo '' . "\n"; } echo '' . ' | ' . "\n" . '' . "\n" . '' . "\n" . '
' . "\n"; } else { /* Show personal addressbook */ if ($show == 'blank' || !empty($listall)) { if($backend != -1 || $show == 'blank') { if ($show == 'blank') { $backend = $abook->localbackend; } $res = $abook->list_addr($backend); if(is_array($res)) { usort($res,'alistcmp'); display_result($res, false); } else { echo '

' . sprintf(_("Unable to list addresses from %s"), $abook->backends[$backend]->sname) . '

' . "\n"; } } else { $res = $abook->list_addr(); usort($res,'alistcmp'); display_result($res, true); } } else { /* Do the search */ if (!empty($query) && empty($listall)) { if($backend == -1) { $res = $abook->s_search($query); } else { $res = $abook->s_search($query, $backend); } if (!is_array($res)) { echo '


' . _("Your search failed with the following error(s)") . ':
' . $abook->error . "

\n\n"; exit; } if (sizeof($res) == 0) { echo '


' . _("No persons matching your search was found") . ".

\n\n"; exit; } display_result($res); } } } echo "\n"; ?>