From a724807782e5dfc39421ee7af00608109c5ad880 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 22 Feb 2022 13:14:17 -0500 Subject: [PATCH] DB Structure Update - Added Extension to contact on export PDF, finished contact departments --- client.php | 3 ++ client_contact_add_modal.php | 24 +++++++++ client_contact_edit_modal.php | 24 +++++++++ client_contacts.php | 3 +- client_department_add_modal.php | 32 ++++++++++++ client_department_edit_modal.php | 33 +++++++++++++ client_routes.php | 3 ++ client_side_nav.php | 13 +++++ db.sql | 3 +- post.php | 84 +++++++++++++++++++++++++++++--- 10 files changed, 213 insertions(+), 9 deletions(-) create mode 100644 client_department_add_modal.php create mode 100644 client_department_edit_modal.php diff --git a/client.php b/client.php index befb52ce..effd4e66 100644 --- a/client.php +++ b/client.php @@ -93,6 +93,9 @@ 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 190c207d..8b9c2ec2 100644 --- a/client_contact_add_modal.php +++ b/client_contact_add_modal.php @@ -53,6 +53,30 @@ + +
+ +
+
+ +
+ +
+
diff --git a/client_contact_edit_modal.php b/client_contact_edit_modal.php index 7ca465c3..f4e99283 100644 --- a/client_contact_edit_modal.php +++ b/client_contact_edit_modal.php @@ -56,6 +56,30 @@
+
+ +
+
+ +
+ +
+
+
diff --git a/client_contacts.php b/client_contacts.php index 0963ec38..4683459c 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -147,7 +147,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $location_name_display = "-"; }else{ $location_name_display = $location_name; - } + } + $department_id = $row['department_id']; ?> diff --git a/client_department_add_modal.php b/client_department_add_modal.php new file mode 100644 index 00000000..f7f0ac11 --- /dev/null +++ b/client_department_add_modal.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/client_department_edit_modal.php b/client_department_edit_modal.php new file mode 100644 index 00000000..021bb681 --- /dev/null +++ b/client_department_edit_modal.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/client_routes.php b/client_routes.php index 4d32e387..8a328af9 100644 --- a/client_routes.php +++ b/client_routes.php @@ -7,6 +7,9 @@ if(isset($_GET['tab'])){ elseif($_GET['tab'] == "locations"){ include("client_locations.php"); } + if($_GET['tab'] == "departments"){ + include("client_departments.php"); + } elseif($_GET['tab'] == "assets"){ include("client_assets.php"); } diff --git a/client_side_nav.php b/client_side_nav.php index eaa9446f..2734b5d2 100644 --- a/client_side_nav.php +++ b/client_side_nav.php @@ -46,6 +46,19 @@ + +