diff --git a/invoice.php b/invoice.php index 5f02e4a2..2d312c4b 100644 --- a/invoice.php +++ b/invoice.php @@ -97,6 +97,16 @@ if(isset($_GET['invoice_id'])){ $invoice_badge_color = "secondary"; } + //Product autocomplete + $products_sql = mysqli_query($mysqli,"SELECT product_name AS label, product_description AS description, product_price AS price FROM products WHERE company_id = $session_company_id"); + + if(mysqli_num_rows($products_sql) > 0){ + while($row = mysqli_fetch_array($products_sql)){ + $products[] = $row; + } + $json_products = json_encode($products); + } + ?>