示例#1
0
function get_all_products()
{
    $s = q("select * from product order by name;");
    return rtoa($s);
}
示例#2
0
function get_all_family_members($clientid)
{
    $s = q("select * from client where client.familyid = '" . clean_query($clientid) . "' order by client.first_name asc;");
    return rtoa($s);
}
示例#3
0
function get_all_users()
{
    $s = q("select * from user order by userid asc;");
    return rtoa($s);
}
示例#4
0
function get_family_usda_aids($clientid)
{
    $s = q("select * from aid LEFT OUTER JOIN (SELECT * FROM family_to_aid WHERE clientid='" . clean_query($clientid) . "') as family_to_aid ON family_to_aid.aidid = aid.aidid WHERE aid.usda_qualifier = '1' ORDER BY aid.name ASC");
    return rtoa($s);
}
示例#5
0
function get_all_financial_aids_client($clientid)
{
    $s = q("select * from aid left outer join (select * from family_to_aid where family_to_aid.clientid = '" . clean_query($clientid) . "') rel on aid.aidid = rel.aidid;");
    return rtoa($s);
}
示例#6
0
function get_bag_transactions($bagid, $start_date, $end_date)
{
    $s = q("SELECT * FROM transaction as t LEFT JOIN family as f ON t.clientid = f.clientid WHERE t.clientid IS NOT NULL AND f.bagid = '" . clean_query($bagid) . "' AND t.date >= '" . clean_query($start_date) . "' AND t.date <= '" . clean_query($end_date) . "';");
    return rtoa($s);
}