From 7b3543102186d5af9ee567639bde4b4999445856 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 29 Apr 2022 16:39:15 -0400 Subject: [PATCH] Remove Departments table and remove it from the client side nav, takes up too much space, added it as a text input on contact add/edit instead --- client.php | 3 - client_contact_add_modal.php | 16 +----- client_contact_edit_modal.php | 16 +----- client_contacts.php | 14 ++--- client_routes.php | 3 - client_side_nav.php | 13 ----- database_updates.php | 11 +++- database_version.php | 2 +- post.php | 102 ++-------------------------------- 9 files changed, 23 insertions(+), 157 deletions(-) diff --git a/client.php b/client.php index 18783ef7..cc98914b 100644 --- a/client.php +++ b/client.php @@ -93,9 +93,6 @@ if(isset($_GET['client_id'])){ $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('location_id') AS num FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id")); $num_locations = $row['num']; - - $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('department_id') AS num FROM departments WHERE department_archived_at IS NULL AND department_client_id = $client_id")); - $num_departments = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('asset_id') AS num FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id")); $num_assets = $row['num']; diff --git a/client_contact_add_modal.php b/client_contact_add_modal.php index 77699f51..e9ca2e3c 100644 --- a/client_contact_add_modal.php +++ b/client_contact_add_modal.php @@ -63,21 +63,7 @@
- + diff --git a/client_contact_edit_modal.php b/client_contact_edit_modal.php index ef866edf..ac007c2c 100644 --- a/client_contact_edit_modal.php +++ b/client_contact_edit_modal.php @@ -65,21 +65,7 @@
- + diff --git a/client_contacts.php b/client_contacts.php index 679ceb36..a8f4ec48 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -24,7 +24,6 @@ $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM contacts LEFT JOIN locations ON location_id = contact_location_id - LEFT JOIN departments ON contact_department_id = department_id WHERE contact_archived_at IS NULL AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR department_name LIKE '%$q%' OR contact_phone LIKE '%$n%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$n%') AND contact_client_id = $client_id ORDER BY $sb $o LIMIT $record_from, $record_to"); @@ -70,7 +69,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); "> Name - Department + Department Email Phone Mobile @@ -90,11 +89,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); }else{ $contact_title_display = "$contact_title"; } - $department_name = $row['department_name']; - if(empty($department_name)){ - $department_name_display = "-"; + $contact_department = $row['contact_department']; + if(empty($contact_department)){ + $contact_department_display = "-"; }else{ - $department_name_display = $department_name; + $contact_department_display = $contact_department; } $contact_phone = formatPhoneNumber($row['contact_phone']); if(empty($contact_phone)){ @@ -131,7 +130,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); }else{ $location_name_display = $location_name; } - $department_id = $row['department_id']; $auth_method = $row['contact_auth_method']; // Related Assets Query @@ -181,7 +179,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); - + diff --git a/client_routes.php b/client_routes.php index fdb2a232..0475f836 100644 --- a/client_routes.php +++ b/client_routes.php @@ -13,9 +13,6 @@ if(isset($_GET['tab'])){ elseif($_GET['tab'] == "locations"){ include("client_locations.php"); } - if($_GET['tab'] == "departments"){ - include("client_departments.php"); - } elseif($_GET['tab'] == "assets"){ if($session_user_role > 1) { include("client_assets.php"); diff --git a/client_side_nav.php b/client_side_nav.php index 10699e48..0eeb7a0a 100644 --- a/client_side_nav.php +++ b/client_side_nav.php @@ -53,19 +53,6 @@ - -