From 626a8f820593f33729138b1a972b9195b4d62cee Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 15 Feb 2022 14:12:47 -0500 Subject: [PATCH] Seperate Assets in client documentation, also fixed width issue on client vendors when pagination is was active --- client_vendors.php | 4 +- post.php | 433 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 428 insertions(+), 9 deletions(-) diff --git a/client_vendors.php b/client_vendors.php index 04245e8b..80fa4661 100644 --- a/client_vendors.php +++ b/client_vendors.php @@ -186,10 +186,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); - - - + diff --git a/post.php b/post.php index ed791e52..feb5328d 100644 --- a/post.php +++ b/post.php @@ -6467,7 +6467,12 @@ if(isset($_GET['export_client_pdf'])){ if(isset($_GET['passwords'])){ $sql_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_client_id = $client_id ORDER BY login_name ASC"); } - $sql_assets = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_client_id = $client_id ORDER BY asset_type ASC"); + $sql_assets = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id WHERE asset_client_id = $client_id ORDER BY asset_type ASC"); + $sql_asset_workstations = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id WHERE asset_client_id = $client_id AND (asset_type = 'desktop' OR asset_type = 'laptop') ORDER BY asset_name ASC"); + $sql_asset_servers = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_client_id = $client_id AND asset_type = 'server' ORDER BY asset_name ASC"); + $sql_asset_vms = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_client_id = $client_id AND asset_type = 'virtual machine' ORDER BY asset_name ASC"); + $sql_asset_network = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_client_id = $client_id AND (asset_type = 'Firewall/Router' OR asset_type = 'Switch' OR asset_type = 'Access Point') ORDER BY asset_type ASC"); + $sql_asset_other = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id WHERE asset_client_id = $client_id AND (asset_type NOT LIKE 'laptop' AND asset_type NOT LIKE 'desktop' AND asset_type NOT LIKE 'server' AND asset_type NOT LIKE 'virtual machine' AND asset_type NOT LIKE 'firewall/router' AND asset_type NOT LIKE 'switch' AND asset_type NOT LIKE 'access point') ORDER BY asset_type ASC"); $sql_networks = mysqli_query($mysqli,"SELECT * FROM networks WHERE network_client_id = $client_id ORDER BY network_name ASC"); $sql_domains = mysqli_query($mysqli,"SELECT * FROM domains WHERE domain_client_id = $client_id ORDER BY domain_name ASC"); $sql_certficates = mysqli_query($mysqli,"SELECT * FROM certificates WHERE certificate_client_id = $client_id ORDER BY certificate_name ASC"); @@ -6484,7 +6489,7 @@ if(isset($_GET['export_client_pdf'])){ title: '- IT Documentation', author: }, - + pageMargins: [ 15, 15, 15, 15 ], content: [ @@ -6494,7 +6499,6 @@ if(isset($_GET['export_client_pdf'])){ }, { - //layout: 'lightHorizontalLines', // optional layout: 'lightHorizontalLines', table: { body: [ @@ -6851,7 +6855,16 @@ if(isset($_GET['export_client_pdf'])){ 0){ ?> { text: 'Assets', - style: 'title' + style: 'assetTitle' + }, + + //Assets END + + //Asset Workstations Start + 0){ ?> + { + text: 'Workstations', + style: 'assetSubTitle' }, { @@ -6889,11 +6902,15 @@ if(isset($_GET['export_client_pdf'])){ { text: 'Install Date', style: 'itemHeader' + }, + { + text: 'Assigned To', + style: 'itemHeader' } ], [ @@ -6940,6 +6958,10 @@ if(isset($_GET['export_client_pdf'])){ { text: , style: 'item' + }, + { + text: , + style: 'item' } ], @@ -6950,7 +6972,395 @@ if(isset($_GET['export_client_pdf'])){ } }, - //Assets END + //Asset Workstation END + + //Assets Servers Start + 0){ ?> + { + text: 'Servers', + style: 'assetSubTitle' + }, + + { + table: { + body: [ + [ + { + text: 'Name', + style: 'itemHeader' + }, + { + text: 'Model', + style: 'itemHeader' + }, + { + text: 'Serial', + style: 'itemHeader' + }, + { + text: 'OS', + style: 'itemHeader' + }, + { + text: 'IP', + style: 'itemHeader' + }, + { + text: 'Purchase Date', + style: 'itemHeader' + }, + { + text: 'Warranty Expire', + style: 'itemHeader' + }, + { + text: 'Install Date', + style: 'itemHeader' + } + ], + + + + [ + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + } + ], + + + ] + } + }, + + //Asset Servers END + + //Asset VMs Start + 0){ ?> + { + text: 'Virtual Machines', + style: 'assetSubTitle' + }, + + { + table: { + body: [ + [ + { + text: 'Name', + style: 'itemHeader' + }, + { + text: 'OS', + style: 'itemHeader' + }, + { + text: 'IP', + style: 'itemHeader' + }, + { + text: 'Install Date', + style: 'itemHeader' + } + ], + + + + [ + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + } + ], + + + ] + } + }, + + //Asset VMs END + + //Assets Network Devices Start + 0){ ?> + { + text: 'Network Devices', + style: 'assetSubTitle' + }, + + { + table: { + body: [ + [ + { + text: 'Name', + style: 'itemHeader' + }, + { + text: 'Type', + style: 'itemHeader' + }, + { + text: 'Model', + style: 'itemHeader' + }, + { + text: 'Serial', + style: 'itemHeader' + }, + { + text: 'IP', + style: 'itemHeader' + }, + { + text: 'Purchase Date', + style: 'itemHeader' + }, + { + text: 'Warranty Expire', + style: 'itemHeader' + }, + { + text: 'Install Date', + style: 'itemHeader' + } + ], + + + + [ + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + } + ], + + + ] + } + }, + + //Asset Network Devices END + + //Asset Other Start + 0){ ?> + { + text: 'Other Devices', + style: 'assetSubTitle' + }, + + { + table: { + body: [ + [ + { + text: 'Name', + style: 'itemHeader' + }, + { + text: 'Type', + style: 'itemHeader' + }, + { + text: 'Model', + style: 'itemHeader' + }, + { + text: 'Serial', + style: 'itemHeader' + }, + { + text: 'IP', + style: 'itemHeader' + }, + { + text: 'Purchase Date', + style: 'itemHeader' + }, + { + text: 'Warranty Expire', + style: 'itemHeader' + }, + { + text: 'Install Date', + style: 'itemHeader' + } + ], + + + + [ + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + }, + { + text: , + style: 'item' + } + ], + + + ] + } + }, + + //Asset Other END //Software Start 0){ ?> @@ -7213,6 +7623,17 @@ if(isset($_GET['export_client_pdf'])){ margin: [0,20,0,5], bold: true }, + assetTitle: { + fontSize: 15, + margin: [0,20,0,0], + bold: true + }, + //Asset Subtitle + assetSubTitle: { + fontSize: 10, + margin: [0,10,0,5], + bold: true + }, //Item Header itemHeader: { fontSize: 9,