From 777637277b08fb1a5470296b6c690ec92b695bb6 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 27 Jan 2024 14:15:18 -0500 Subject: [PATCH] Fix Issue where if you edited first record that shared the same form input name like location then it would blank out the first record if edited this is fixed by adding bulk_ in front of the form Input names under the bulk modals not sure why this happens but this is the fix --- client_asset_bulk_assign_contact_modal.php | 2 +- client_asset_bulk_assign_location_modal.php | 2 +- client_asset_bulk_edit_status_modal.php | 2 +- client_contact_bulk_assign_location_modal.php | 2 +- client_contact_bulk_edit_phone_modal.php | 2 +- post/asset.php | 6 +++--- post/contact.php | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client_asset_bulk_assign_contact_modal.php b/client_asset_bulk_assign_contact_modal.php index fd5dd915..c95978cd 100644 --- a/client_asset_bulk_assign_contact_modal.php +++ b/client_asset_bulk_assign_contact_modal.php @@ -16,7 +16,7 @@
- - - diff --git a/client_contact_bulk_assign_location_modal.php b/client_contact_bulk_assign_location_modal.php index 7b522026..404a545a 100644 --- a/client_contact_bulk_assign_location_modal.php +++ b/client_contact_bulk_assign_location_modal.php @@ -16,7 +16,7 @@
- - + diff --git a/post/asset.php b/post/asset.php index 7a5d4b38..68ac83e2 100644 --- a/post/asset.php +++ b/post/asset.php @@ -225,7 +225,7 @@ if (isset($_POST['bulk_assign_asset_location'])) { validateTechRole(); - $location_id = intval($_POST['location_id']); + $location_id = intval($_POST['bulk_location_id']); // Get Location name and client id for logging and Notification $sql = mysqli_query($mysqli,"SELECT location_name, location_client_id FROM locations WHERE location_id = $location_id"); @@ -264,7 +264,7 @@ if (isset($_POST['bulk_assign_asset_contact'])) { validateTechRole(); - $contact_id = intval($_POST['contact_id']); + $contact_id = intval($_POST['bulk_contact_id']); // Get Contact name and client id for logging and Notification $sql = mysqli_query($mysqli,"SELECT contact_name, contact_client_id FROM contacts WHERE contact_id = $contact_id"); @@ -303,7 +303,7 @@ if (isset($_POST['bulk_edit_asset_status'])) { validateTechRole(); - $status = sanitizeInput($_POST['status']); + $status = sanitizeInput($_POST['bulk_status']); // Get Selected Contacts Count $asset_count = count($_POST['asset_ids']); diff --git a/post/contact.php b/post/contact.php index 3c1d8640..7880e7a9 100644 --- a/post/contact.php +++ b/post/contact.php @@ -176,7 +176,7 @@ if (isset($_POST['bulk_assign_contact_location'])) { validateTechRole(); - $location_id = intval($_POST['location']); + $location_id = intval($_POST['bulk_location_id']); // Get Location name for logging and Notification $sql = mysqli_query($mysqli,"SELECT location_name, location_client_id FROM locations WHERE location_id = $location_id"); @@ -215,7 +215,7 @@ if (isset($_POST['bulk_edit_contact_phone'])) { validateTechRole(); - $phone = preg_replace("/[^0-9]/", '', $_POST['phone']); + $phone = preg_replace("/[^0-9]/", '', $_POST['bulk_phone']); // Get Selected Contacts Count $contact_count = count($_POST['contact_ids']);