* * -------------------------------------------- * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ /* $Id$ */ $phpgw_info["flags"]["currentapp"] = "addressbook"; include("../header.inc.php"); echo "
" . lang("Address book"); if (! $start) $start = 0; $limit =$phpgw->nextmatchs->sql_limit($start); if ($order) $ordermethod = "order by $order $sort"; else $ordermethod = "order by lastname,firstname,email asc"; if (! $filter) { $filter = "none"; } if ($filter != "private") { if ($filter != "none") { $filtermethod = " access like '%,$filter,%' "; } else { $filtermethod = " (owner='" . $phpgw_info["user"]["userid"] ."' OR access='public' " . $phpgw->accounts->sql_search("access") . " ) "; } } else { $filtermethod = " owner='" . $phpgw_info["user"]["userid"] . "' "; } if ($query) { $phpgw->db->query("select count(*) from addressbook where $filtermethod AND (lastname " . "like '%$query%' OR firstname like '%$query%' OR email like '%$query%" . "' OR street like '%$query%' OR city like '%$query%' OR state like '" . "%$query%' OR zip like '%$query%' OR notes like '%$query%' OR company" . " like '%$query%')"); $phpgw->db->next_record(); if ($phpgw->db->f(0) == 1) echo "
" . lang("your search returned 1 match"); else echo "
" . lang("your search returned x matchs",$phpgw->db->f(0)); } else { $phpgw->db->query("select count(*) from addressbook where $filtermethod"); } $phpgw->db->next_record(); if ($phpgw->db->f(0) > $phpgw_info["user"]["preferences"]["maxmatchs"]) echo "
" . lang("showing x - x of x",($start + 1), ($start + $phpgw_info["user"]["preferences"]["maxmatchs"]),$phpgw->db->f(0)); else echo "
" . lang("showing x",$phpgw->db->f(0)); ?> nextmatchs->show("index.php",$start,$phpgw->db->f(0), "&order=$order&filter=$filter&sort=" . "$sort&query=$query", "75%", $phpgw_info["theme"][th_bg]); ?> "> '; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"company",$order,"index.php", lang("Company Name")); echo ''; } if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == "True" ) { echo ''; } if ( $phpgw_info["user"]["preferences"]["addressbook_view_firstname"] == "True" ) { echo ''; } if ( $phpgw_info["user"]["preferences"]["addressbook_view_email"] == "True" ) { echo ''; } if ( $phpgw_info["user"]["preferences"]["addressbook_view_wphone"] == "True" ) { echo ''; } ?> db->query("SELECT * FROM addressbook WHERE $filtermethod AND (lastname like '" . "%$query%' OR firstname like '%$query%' OR email like '%$query%' OR " . "street like '%$query%' OR city like '%$query%' OR state " . "like '%$query%' OR zip like '%$query%' OR notes like " . "'%$query%' OR company like %$query%') $ordermethod limit $limit"); } else { $phpgw->db->query("SELECT * FROM addressbook WHERE $filtermethod $ordermethod limit " . $limit); } while ($phpgw->db->next_record()) { $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); $firstname = $phpgw->db->f("firstname"); $lastname = $phpgw->db->f("lastname"); $email = $phpgw->db->f("email"); $company = $phpgw->db->f("company"); $wphone = $phpgw->db->f("wphone"); $con = $phpgw->db->f("con"); if($firstname == "") $firstname = " "; if($lastname == "") $lastname = " "; if($email == "") $email = " "; if($company == "") $company = " "; if($wphone == "") $wphone = " "; ?> '; if ( $phpgw_info["user"]["preferences"]["addressbook_view_company"] == 'True' ) { echo ''; }; if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == 'True' ) { echo ''; }; if ( $phpgw_info["user"]["preferences"]["addressbook_view_firstname"] == 'True' ) { echo ''; }; if ( $phpgw_info["user"]["preferences"]["addressbook_view_email"] == 'True' ) { echo ''; }; if ( $phpgw_info["user"]["preferences"]["addressbook_view_wphone"] == 'True' ) { echo ''; }; ?>
'; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"index.php", lang("Last Name")); echo ''; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"firstname",$order,"index.php", lang("First Name")); echo ''; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"email",$order,"index.php", lang("Email")); echo ''; echo ''; echo $phpgw->nextmatchs->show_sort_order($sort,"wphone",$order,"index.php", lang("Work Phone")); echo '
'; echo ''; echo $company; echo ''; echo ''; echo $lastname; echo ''; echo ''; echo $firstname; echo ''; echo ''; echo $email; echo ''; echo ''; echo $wphone; echo ' "> common->check_owner($phpgw->db->f("owner"),"edit.php",lang("edit"),"con=" . $phpgw->db->f("con")); ?>
">
">