From 4c02a4e8c2bf47923107648f836da906e5cf2eae Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 19 Feb 2025 18:05:16 -0500 Subject: [PATCH] Moved Edit Network over to the new AJAX modal function --- ajax.php | 28 -- ajax/ajax_network_edit.php | 202 ++++++++++++++ client_networks.php | 376 +++++++++++++------------- js/network_edit_modal.js | 52 ---- modals/client_document_edit_modal.php | 58 ---- modals/client_edit_modal.php | 222 --------------- modals/client_network_edit_modal.php | 167 ------------ 7 files changed, 391 insertions(+), 714 deletions(-) create mode 100644 ajax/ajax_network_edit.php delete mode 100644 js/network_edit_modal.js delete mode 100644 modals/client_document_edit_modal.php delete mode 100644 modals/client_edit_modal.php delete mode 100644 modals/client_network_edit_modal.php diff --git a/ajax.php b/ajax.php index afb622bd..e1152a61 100644 --- a/ajax.php +++ b/ajax.php @@ -65,34 +65,6 @@ if (isset($_GET['merge_ticket_get_json_details'])) { } } -/* - * Looks up info for a given network ID from the database, used to dynamically populate modal fields - */ -if (isset($_GET['network_get_json_details'])) { - enforceUserPermission('module_support'); - - $network_id = intval($_GET['network_id']); - $client_id = intval($_GET['client_id']); - - // Individual network lookup - $network_sql = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_id = $network_id AND network_client_id = $client_id"); - while ($row = mysqli_fetch_array($network_sql)) { - $response['network'][] = $row; - } - - // Lookup all client locations, as networks can be associated with any client location - $locations_sql = mysqli_query( - $mysqli, - "SELECT location_id, location_name FROM locations - WHERE location_client_id = '$client_id'" - ); - while ($row = mysqli_fetch_array($locations_sql)) { - $response['locations'][] = $row; - } - - echo json_encode($response); -} - if (isset($_POST['client_set_notes'])) { enforceUserPermission('module_client', 2); diff --git a/ajax/ajax_network_edit.php b/ajax/ajax_network_edit.php new file mode 100644 index 00000000..fb53f4b0 --- /dev/null +++ b/ajax/ajax_network_edit.php @@ -0,0 +1,202 @@ + + + +
+ + + + +
+ + -
-
-

Networks

-
-
- - 0) { ?> - -