From 8fe64909155c93e8aa497593c37749b3358c0f16 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Thu, 2 Feb 2023 16:35:50 +0000 Subject: [PATCH] General tidy --- quote.php | 1503 ++++++++++++++++++++++++++--------------------------- 1 file changed, 751 insertions(+), 752 deletions(-) diff --git a/quote.php b/quote.php index f20a8f38..696d730f 100644 --- a/quote.php +++ b/quote.php @@ -1,403 +1,402 @@ - - - 0) { - while ($row = mysqli_fetch_array($products_sql)) { - $products[] = $row; + $row = mysqli_fetch_array($sql); + $quote_id = $row['quote_id']; + $quote_prefix = htmlentities($row['quote_prefix']); + $quote_number = htmlentities($row['quote_number']); + $quote_scope = htmlentities($row['quote_scope']); + $quote_status = htmlentities($row['quote_status']); + $quote_date = $row['quote_date']; + $quote_amount = floatval($row['quote_amount']); + $quote_currency_code = htmlentities($row['quote_currency_code']); + $quote_note = htmlentities($row['quote_note']); + $quote_url_key = htmlentities($row['quote_url_key']); + $quote_created_at = $row['quote_created_at']; + $category_id = $row['quote_category_id']; + $client_id = $row['client_id']; + $client_name = htmlentities($row['client_name']); + $location_address = htmlentities($row['location_address']); + $location_city = htmlentities($row['location_city']); + $location_state = htmlentities($row['location_state']); + $location_zip = htmlentities($row['location_zip']); + $contact_email = htmlentities($row['contact_email']); + $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_extension = htmlentities($row['contact_extension']); + $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $client_website = htmlentities($row['client_website']); + $client_currency_code = htmlentities($row['client_currency_code']); + $client_net_terms = htmlentities($row['client_net_terms']); + if ($client_net_terms == 0) { + $client_net_terms = $config_default_net_terms; + } + $company_id = $row['company_id']; + $company_name = htmlentities($row['company_name']); + $company_country = htmlentities($row['company_country']); + $company_address = htmlentities($row['company_address']); + $company_city = htmlentities($row['company_city']); + $company_state = htmlentities($row['company_state']); + $company_zip = htmlentities($row['company_zip']); + $company_phone = formatPhoneNumber($row['company_phone']); + $company_email = htmlentities($row['company_email']); + $company_website = htmlentities($row['company_website']); + $company_logo = htmlentities($row['company_logo']); + if (!empty($company_logo)) { + $company_logo_base64 = base64_encode(file_get_contents("uploads/settings/$company_id/$company_logo")); } - $json_products = json_encode($products); - } -?> + $sql_history = mysqli_query($mysqli,"SELECT * FROM history WHERE history_quote_id = $quote_id ORDER BY history_id DESC"); - + //Set Badge color based off of quote status + if ($quote_status == "Sent") { + $quote_badge_color = "warning text-white"; + }elseif ($quote_status == "Viewed") { + $quote_badge_color = "primary"; + }elseif ($quote_status == "Accepted") { + $quote_badge_color = "success"; + }elseif ($quote_status == "Declined") { + $quote_badge_color = "danger"; + }elseif ($quote_status == "Invoiced") { + $quote_badge_color = "info"; + }else{ + $quote_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); + } -
- - - -
- -
-
- "> -
-
-

Quote

-
-
-
-
-
    -
  • -
  • -
  • -
  • -
  • -
-
-
-
    -
  • -
  • -
  • -
  • -
  • -
  • -
-
-
-
-
-
-
- - - - - -
Date
-
-
- - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
ItemDescriptionQtyPriceTaxTotal
- - -
- + + + + + + + + + + + + + + - - - - - - -
DateStatusDescription
- -
- - - - -
-
-
-
- Notes -
- - - +
+
-
-
-
-
-
- -
- - - - - - - 0) { ?> - - - - - - - - - - -
Subtotal
Tax
Total
-
-
+ -
-
+} -
-
-
-
- History -
- - -
-
-
- - - - - - - - - - - - - - - - - - -
DateStatusDescription
-
-
-
-
- - @@ -406,406 +405,406 @@ include("footer.php");