Made sql for addressbook use new table and field names

This commit is contained in:
Miles Lott 2001-02-06 00:56:53 +00:00
parent 33833f62f6
commit a95950b05c

View File

@ -145,23 +145,23 @@
if ($phpgw_info["user"]["apps"]["addressbook"] if ($phpgw_info["user"]["apps"]["addressbook"]
&& $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) { && $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) {
echo "<!-- Birthday info -->\n"; echo "<!-- Birthday info -->\n";
$phpgw->db->query("select ab_firstname,ab_lastname from addressbook where " $phpgw->db->query("select a.owner,a.n_given,a.n_family,b.contact_name,b.contact_value from phpgw_addressbook as a, phpgw_addressbook_extra as b where "
. "ab_bday like '" . $phpgw->common->show_date(time(),"n/d") . "b.contact_name='bday' and b.contact_value like '" . $phpgw->common->show_date(time(),"n/d")
. "/%' and (ab_owner='" . $phpgw_info["user"]["account_id"] . "' or ab_access='" . "/%' and (a.owner='" . $phpgw_info["user"]["account_id"] . "' or b.contact_name='access' and b.contact_value ='"
. "public')",__LINE__,__FILE__); . "public')",__LINE__,__FILE__);
while ($phpgw->db->next_record()) { while ($phpgw->db->next_record()) {
echo "<tr><td>" . lang("Today is x's birthday!", $phpgw->db->f("ab_firstname") . " " echo "<tr><td>" . lang("Today is x's birthday!", $phpgw->db->f("ab_firstname") . " "
. $phpgw->db->f("ab_lastname")) . "</td></tr>\n"; . $phpgw->db->f("ab_lastname")) . "</td></tr>\n";
} }
$tommorow = $phpgw->common->show_date(mktime(0,0,0, $tomorrow = $phpgw->common->show_date(mktime(0,0,0,
$phpgw->common->show_date(time(),"m"), $phpgw->common->show_date(time(),"m"),
$phpgw->common->show_date(time(),"d")+1, $phpgw->common->show_date(time(),"d")+1,
$phpgw->common->show_date(time(),"Y")),"n/d" ); $phpgw->common->show_date(time(),"Y")),"n/d" );
$phpgw->db->query("select ab_firstname,ab_lastname from addressbook where " $phpgw->db->query("select a.owner,a.n_given,a.n_family,b.contact_name,b.contact_value from phpgw_addressbook as a, phpgw_addressbook_extra as b where "
. "ab_bday like '$tommorow/%' and (ab_owner='" . "b.contact_name='bday' and b.contact_value like '$tomorrow/%' and (a.owner='"
. $phpgw_info["user"]["account_id"] . "' or ab_access='public')",__LINE__,__FILE__); . $phpgw_info["user"]["account_id"] . "' or b.contact_name='access' and b.contact_value='public')",__LINE__,__FILE__);
while ($phpgw->db->next_record()) { while ($phpgw->db->next_record()) {
echo "<tr><td>" . lang("Tommorow is x's birthday.", $phpgw->db->f("ab_firstname") . " " echo "<tr><td>" . lang("Tomorrow is x's birthday.", $phpgw->db->f("ab_firstname") . " "
. $phpgw->db->f("ab_lastname")) . "</td></tr>\n"; . $phpgw->db->f("ab_lastname")) . "</td></tr>\n";
} }
echo "<!-- Birthday info -->\n"; echo "<!-- Birthday info -->\n";