Add vendors & contacts

This commit is contained in:
Marcus Hill 2022-01-24 20:44:45 +00:00
parent a911599fab
commit 75757bf0df
3 changed files with 65 additions and 12 deletions

View File

@ -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");

24
db.sql
View File

@ -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`
--

View File

@ -140,16 +140,35 @@
<h4>Additional Related Items</h4>
<br>
<h5><i class="nav-icon fas fa-users"></i> Vendors</h5>
<ul>
<li>Contoso Developer</li>
</ul>
<!-- Vendors -->
<?php
if($sql_vendors){ ?>
<h5><i class="nav-icon fas fa-users"></i> Vendors</h5>
<ul>
<?php
while($row = mysqli_fetch_array($sql_vendors)){
echo "<li><a href=\"client.php?client_id=$client_id&tab=vendors&q=$row[vendor_name]\">$row[vendor_name]</a></li>";
}
?>
</ul>
<?php
}
?>
<h5><i class="nav-icon fas fa-building"></i> Contacts</h5>
<ul>
<li>Client Contact</li>
<li>Developer Contact</li>
</ul>
<!-- Contacts -->
<?php
if($sql_contacts){ ?>
<h5><i class="nav-icon fas fa-building"></i> Contacts</h5>
<ul>
<?php
while($row = mysqli_fetch_array($sql_contacts)){
echo "<li><a href=\"client.php?client_id=$client_id&tab=contacts&q=$row[contact_name]\">$row[contact_name]</a></li>";
}
?>
</ul>
<?php
}
?>
<!-- Logins -->
<?php
@ -195,7 +214,6 @@
}
}
// Showing explicitly linked URLs
while($row = mysqli_fetch_array($sql_urls)){
if(!empty($row['service_uri'])){
@ -210,12 +228,12 @@
<h5><i class="nav-icon fas fa-lock"></i> Certificates</h5>
<ul>
<li>SSLs related to a domain</li>
<li>SSLs related to a domain - Coming soon!</li>
</ul>
<h5><i class="nav-icon fas fa-hdd"></i> Backed up by</h5>
<ul>
<li>Asset</li>
<li>Asset - Coming soon!</li>
</ul>
<h5><i class="nav-icon fas fa-file-alt"></i> Documents</h5>