From d202c7684a3250add552fa72628ef327875dc725 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 10 May 2024 21:56:13 -0400 Subject: [PATCH] Feature: Allow copying a quote from one client to another --- post/quote.php | 4 ++-- quote_copy_modal.php | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/post/quote.php b/post/quote.php index c0a4fa92..94c055d2 100644 --- a/post/quote.php +++ b/post/quote.php @@ -36,6 +36,7 @@ if (isset($_POST['add_quote'])) { if (isset($_POST['add_quote_copy'])) { $quote_id = intval($_POST['quote_id']); + $client_id = intval($_POST['client']); $date = sanitizeInput($_POST['date']); $expire = sanitizeInput($_POST['expire']); @@ -51,7 +52,6 @@ if (isset($_POST['add_quote_copy'])) { $quote_currency_code = sanitizeInput($row['quote_currency_code']); $quote_scope = sanitizeInput($row['quote_scope']); $quote_note = sanitizeInput($row['quote_note']); - $client_id = intval($row['quote_client_id']); $category_id = intval($row['quote_category_id']); //Generate a unique URL key for clients to access @@ -80,7 +80,7 @@ if (isset($_POST['add_quote_copy'])) { } //Logging - mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Quote', log_action = 'Create', log_description = 'Copied Quote', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id"); + mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Quote', log_action = 'Create', log_description = 'Copied Quote', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id"); $_SESSION['alert_message'] = "Quote copied"; diff --git a/quote_copy_modal.php b/quote_copy_modal.php index 4f06976c..d2cb6f3a 100644 --- a/quote_copy_modal.php +++ b/quote_copy_modal.php @@ -11,6 +11,28 @@