getRow($sql); return $result; } public function get_suppliers_name($id) { global $database; $get_name = " SELECT name FROM suppliers WHERE id = '$id' LIMIT 1 "; $company_name = $database->getOne($get_name); return $company_name; } public function get_suppliers() { global $database; $get_name = " SELECT id,name FROM suppliers "; $results = $database->getAssoc($get_name); bug::bug_array("",$results); return $results; } public function get_suppliers_list() { global $database; $get_name = " SELECT id,name FROM suppliers "; $results = $database->query($get_name); return $results; } public function get_num($context) { global $database; $status = $context['status']; $status_sql = (!empty($status)) ? "AND status IN $status" : ""; $get_invoice = " SELECT count(id) FROM suppliers WHERE id != '0' $status_sql "; $num_results = $database->getOne($get_invoice); return $num_results; } public function get_supplier_id_by_name($supplier_name){ global $database; $get_name = " SELECT id FROM suppliers WHERE name = '".$supplier_name."' LIMIT 1 "; $results = $database->getOne($get_name); return $results; } } ?>