' .
'
' .
' | ' . _("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 = ''; }
if (!isset($backend)) { $backend = ''; }
/* Choose correct colors for top and bottom frame */
if ($show == 'form' && !isset($listall)) {
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' && empty($listall)) {
echo '' . "\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 {
if( !empty( $listall ) ){
$query = '*';
}
/* Do the search */
if (!empty($query)) {
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