From 75757bf0dfe482b693074624f74727bd988fe4ce Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Mon, 24 Jan 2022 20:44:45 +0000 Subject: [PATCH] Add vendors & contacts --- client_services.php | 11 +++++++++++ db.sql | 24 ++++++++++++++++++++++++ service_view_modal.php | 42 ++++++++++++++++++++++++++++++------------ 3 files changed, 65 insertions(+), 12 deletions(-) diff --git a/client_services.php b/client_services.php index 31ff1e03..30798e69 100644 --- a/client_services.php +++ b/client_services.php @@ -105,6 +105,17 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $sql_urls = mysqli_query($mysqli, "SELECT * FROM service_urls WHERE service_id = '$service_id'"); + // Associated Vendors + $sql_vendors = mysqli_query($mysqli, "SELECT * FROM service_vendors + LEFT JOIN vendors + ON service_vendors.vendor_id = vendors.vendor_id + WHERE service_id = '$service_id'"); + + // Associated Contacts + $sql_contacts = mysqli_query($mysqli, "SELECT * FROM service_contacts + LEFT JOIN contacts + ON service_contacts.contact_id = contacts.contact_id + WHERE service_id = '$service_id'"); include("service_view_modal.php"); //include("service_edit_modal.php"); diff --git a/db.sql b/db.sql index 6d2c6403..fee8ed58 100644 --- a/db.sql +++ b/db.sql @@ -957,6 +957,18 @@ CREATE TABLE IF NOT EXISTS `service_assets` ( `asset_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `service_contacts` +-- + +DROP TABLE IF EXISTS `service_contacts`; +CREATE TABLE IF NOT EXISTS `service_contacts` ( + `service_id` int(11) NOT NULL, + `contact_id` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + -- -- Table structure for table `service_domains` -- @@ -987,6 +999,18 @@ CREATE TABLE IF NOT EXISTS `service_urls` ( `service_uri` varchar(250) CHARACTER SET latin1 NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `service_vendors` +-- + +DROP TABLE IF EXISTS `service_vendors`; +CREATE TABLE IF NOT EXISTS `service_vendors` ( + `service_id` int(11) NOT NULL, + `vendor_id` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + -- -- Table structure for table `settings` -- diff --git a/service_view_modal.php b/service_view_modal.php index 3f8e886b..4f144917 100644 --- a/service_view_modal.php +++ b/service_view_modal.php @@ -140,16 +140,35 @@

Additional Related Items


-
Vendors
- + + +
Vendors
+ + -
Contacts
- + + +
Contacts
+ + Certificates
Backed up by
Documents