function invoice_get_customer_info in Invoice 6
Same name and namespace in other branches
- 7 invoice_ajax.inc \invoice_get_customer_info()
Get customer info
1 string reference to 'invoice_get_customer_info'
- invoice_menu in ./
invoice.module - Implementation of hook_menu()
File
- ./
invoice_ajax.inc, line 63 - Invoice module
Code
function invoice_get_customer_info() {
// Create alias
$fv =& $_GET;
$a_data = db_fetch_array(db_query("SELECT company_name,firstname,lastname,street,building_number,zipcode,city,country,coc_number,vat_number,ic.description\n FROM {invoice_customers} ic\n LEFT JOIN {invoice_invoices} ii ON ic.invoice_id=ii.iid \n WHERE ic.cid=%d\n ORDER BY company_name DESC, lastname DESC, firstname DESC, ic.invoice_id DESC\n LIMIT 1", $fv['value']));
if (count($a_data) == 0) {
$a_data['set_empty'] = TRUE;
}
else {
$a_data['search_customer'] = !empty($a_data['company_name']) ? $a_data['company_name'] : $a_data['lastname'] . (!empty($a_data['firstname']) ? ', ' . $a_data['firstname'] : '');
}
drupal_json($a_data);
exit;
}