From 80084bef151ddeea2570375b359e23e2f9398ae9 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sun, 16 Jan 2022 15:43:23 -0500 Subject: [PATCH] replicated the new product autocomplete function to invoice as well as recurring invoice --- invoice.php | 38 ++++++++++++++++++++++++++++++++++---- recurring_invoice.php | 40 +++++++++++++++++++++++++++++++++++----- 2 files changed, 69 insertions(+), 9 deletions(-) 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); + } + ?>