" and (r.rights like '%approve_all_timesheets%' or (r.rank > $rank and r.rights like '%approve_timesheets%'))";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
" and (r.rights like '%approve_all_timesheets%' or (r.rank > $rank and r.rights like '%approve_timesheets%'))";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {