diff --git a/post/user/client.php b/post/user/client.php
index 6b00bb12..4ab99da6 100644
--- a/post/user/client.php
+++ b/post/user/client.php
@@ -589,67 +589,68 @@ if (isset($_GET['download_clients_csv_template'])) {
}
-if (isset($_POST['export_client_pdf'])) {
+if (isset($_POST["export_client_pdf"])) {
- // TODO: Enforce perms based on which individual boxes are ticked
- enforceUserPermission('module_client', 3);
- enforceUserPermission('module_support', 1);
- enforceUserPermission('module_sales', 1);
- enforceUserPermission('module_financial', 1);
+ // Enforce permissions
+ enforceUserPermission("module_client", 3);
+ enforceUserPermission("module_support", 1);
+ enforceUserPermission("module_sales", 1);
+ enforceUserPermission("module_financial", 1);
- $client_id = intval($_POST['client_id']);
- $export_contacts = intval($_POST['export_contacts']);
- $export_locations = intval($_POST['export_locations']);
- $export_assets = intval($_POST['export_assets']);
- $export_software = intval($_POST['export_software']);
+ $client_id = intval($_POST["client_id"]);
+ $export_contacts = intval($_POST["export_contacts"]);
+ $export_locations = intval($_POST["export_locations"]);
+ $export_assets = intval($_POST["export_assets"]);
+ $export_software = intval($_POST["export_software"]);
$export_credentials = 0;
if (lookupUserPermission("module_credential") >= 1) {
- $export_credentials = intval($_POST['export_credentials']);
+ $export_credentials = intval($_POST["export_credentials"]);
}
- $export_networks = intval($_POST['export_networks']);
- $export_certificates = intval($_POST['export_certificates']);
- $export_domains = intval($_POST['export_domains']);
- $export_tickets = intval($_POST['export_tickets']);
- $export_recurring_tickets = intval($_POST['export_recurring_tickets']);
- $export_vendors = intval($_POST['export_vendors']);
- $export_invoices = intval($_POST['export_invoices']);
- $export_recurring_invoices = intval($_POST['export_recurring_invoices']);
- $export_quotes = intval($_POST['export_quotes']);
- $export_payments = intval($_POST['export_payments']);
- $export_trips = intval($_POST['export_trips']);
- $export_logs = intval($_POST['export_logs']);
+ $export_networks = intval($_POST["export_networks"]);
+ $export_certificates = intval($_POST["export_certificates"]);
+ $export_domains = intval($_POST["export_domains"]);
+ $export_tickets = intval($_POST["export_tickets"]);
+ $export_recurring_tickets = intval($_POST["export_recurring_tickets"]);
+ $export_vendors = intval($_POST["export_vendors"]);
+ $export_invoices = intval($_POST["export_invoices"]);
+ $export_recurring_invoices = intval($_POST["export_recurring_invoices"]);
+ $export_quotes = intval($_POST["export_quotes"]);
+ $export_payments = intval($_POST["export_payments"]);
+ $export_trips = intval($_POST["export_trips"]);
+ $export_logs = intval($_POST["export_logs"]);
- //Logging
+ // Logging
logAction("Client", "Export", "$session_name exported client data to a PDF file", $client_id, $client_id);
- //get records from database
- $sql = mysqli_query($mysqli,"SELECT * FROM clients
+ // Get client record (joining primary contact and primary location)
+ $sql = mysqli_query($mysqli, "SELECT * FROM clients
LEFT JOIN contacts ON clients.client_id = contacts.contact_client_id AND contact_primary = 1
LEFT JOIN locations ON clients.client_id = locations.location_client_id AND location_primary = 1
WHERE client_id = $client_id
");
-
$row = mysqli_fetch_array($sql);
- $client_name = $row['client_name'];
- $location_address = $row['location_address'];
- $location_city = $row['location_city'];
- $location_state = $row['location_state'];
- $location_zip = $row['location_zip'];
- $contact_name = $row['contact_name'];
- $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
- $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
- $contact_extension = nullable_htmlentities($row['contact_extension']);
- $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
- $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code));
- $contact_email = $row['contact_email'];
- $client_website = $row['client_website'];
+ // Immediately sanitize retrieved values
+ $client_name = nullable_htmlentities($row["client_name"]);
+ $location_address = nullable_htmlentities($row["location_address"]);
+ $location_city = nullable_htmlentities($row["location_city"]);
+ $location_state = nullable_htmlentities($row["location_state"]);
+ $location_zip = nullable_htmlentities($row["location_zip"]);
+ $contact_name = nullable_htmlentities($row["contact_name"]);
+ $contact_phone_country_code = nullable_htmlentities($row["contact_phone_country_code"]);
+ $contact_phone = nullable_htmlentities(formatPhoneNumber($row["contact_phone"], $contact_phone_country_code));
+ $contact_extension = nullable_htmlentities($row["contact_extension"]);
+ $contact_mobile_country_code = nullable_htmlentities($row["contact_mobile_country_code"]);
+ $contact_mobile = nullable_htmlentities(formatPhoneNumber($row["contact_phone"], $contact_mobile_country_code));
+ $contact_email = nullable_htmlentities($row["contact_email"]);
+ $client_website = nullable_htmlentities($row["client_website"]);
- $sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL ORDER BY contact_name ASC");
- $sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL ORDER BY location_name ASC");
- $sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
- $sql_credentials = mysqli_query($mysqli,"SELECT * FROM credentials WHERE credential_client_id = $client_id ORDER BY credential_name ASC");
- $sql_assets = mysqli_query($mysqli,"SELECT * FROM assets
+ // Other queries remain unchanged
+ $sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_archived_at IS NULL ORDER BY contact_name ASC");
+ $sql_locations = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_client_id = $client_id AND location_archived_at IS NULL ORDER BY location_name ASC");
+ $sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL ORDER BY vendor_name ASC");
+ $sql_credentials = mysqli_query($mysqli, "SELECT * FROM credentials WHERE credential_client_id = $client_id ORDER BY credential_name ASC");
+ $sql_assets = mysqli_query($mysqli, "SELECT * FROM assets
LEFT JOIN contacts ON asset_contact_id = contact_id
LEFT JOIN locations ON asset_location_id = location_id
LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
@@ -657,17 +658,53 @@ if (isset($_POST['export_client_pdf'])) {
AND asset_archived_at IS NULL
ORDER BY asset_type ASC"
);
- $sql_asset_workstations = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id LEFT JOIN locations ON asset_location_id = location_id LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1 WHERE asset_client_id = $client_id AND (asset_type = 'desktop' OR asset_type = 'laptop') AND asset_archived_at IS NULL ORDER BY asset_name ASC");
- $sql_asset_servers = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN locations ON asset_location_id = location_id LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1 WHERE asset_client_id = $client_id AND asset_type = 'server' AND asset_archived_at IS NULL ORDER BY asset_name ASC");
- $sql_asset_vms = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1 WHERE asset_client_id = $client_id AND asset_type = 'virtual machine' AND asset_archived_at IS NULL ORDER BY asset_name ASC");
- $sql_asset_network = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN locations ON asset_location_id = location_id LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1 WHERE asset_client_id = $client_id AND (asset_type = 'Firewall/Router' OR asset_type = 'Switch' OR asset_type = 'Access Point') AND asset_archived_at IS NULL ORDER BY asset_type ASC");
- $sql_asset_other = mysqli_query($mysqli,"SELECT * FROM assets LEFT JOIN contacts ON asset_contact_id = contact_id LEFT JOIN locations ON asset_location_id = location_id LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1 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') AND asset_archived_at IS NULL ORDER BY asset_type ASC");
- $sql_networks = mysqli_query($mysqli,"SELECT * FROM networks WHERE network_client_id = $client_id AND network_archived_at IS NULL ORDER BY network_name ASC");
- $sql_domains = mysqli_query($mysqli,"SELECT * FROM domains WHERE domain_client_id = $client_id AND domain_archived_at IS NULL ORDER BY domain_name ASC");
- $sql_certficates = mysqli_query($mysqli,"SELECT * FROM certificates WHERE certificate_client_id = $client_id AND certificate_archived_at IS NULL ORDER BY certificate_name ASC");
- $sql_software = mysqli_query($mysqli,"SELECT * FROM software WHERE software_client_id = $client_id AND software_archived_at IS NULL ORDER BY software_name ASC");
+ $sql_asset_workstations = mysqli_query($mysqli, "SELECT * FROM assets
+ LEFT JOIN contacts ON asset_contact_id = contact_id
+ LEFT JOIN locations ON asset_location_id = location_id
+ LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
+ WHERE asset_client_id = $client_id
+ AND (asset_type = 'desktop' OR asset_type = 'laptop')
+ AND asset_archived_at IS NULL
+ ORDER BY asset_name ASC"
+ );
+ $sql_asset_servers = mysqli_query($mysqli, "SELECT * FROM assets
+ LEFT JOIN locations ON asset_location_id = location_id
+ LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
+ WHERE asset_client_id = $client_id
+ AND asset_type = 'server'
+ AND asset_archived_at IS NULL
+ ORDER BY asset_name ASC"
+ );
+ $sql_asset_vms = mysqli_query($mysqli, "SELECT * FROM assets
+ LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
+ WHERE asset_client_id = $client_id
+ AND asset_type = 'virtual machine'
+ AND asset_archived_at IS NULL
+ ORDER BY asset_name ASC"
+ );
+ $sql_asset_network = mysqli_query($mysqli, "SELECT * FROM assets
+ LEFT JOIN locations ON asset_location_id = location_id
+ LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
+ WHERE asset_client_id = $client_id
+ AND (asset_type = 'Firewall/Router' OR asset_type = 'Switch' OR asset_type = 'Access Point')
+ AND asset_archived_at IS NULL
+ ORDER BY asset_type ASC"
+ );
+ $sql_asset_other = mysqli_query($mysqli, "SELECT * FROM assets
+ LEFT JOIN contacts ON asset_contact_id = contact_id
+ LEFT JOIN locations ON asset_location_id = location_id
+ LEFT JOIN asset_interfaces ON interface_asset_id = asset_id AND interface_primary = 1
+ 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')
+ AND asset_archived_at IS NULL
+ ORDER BY asset_type ASC"
+ );
+ $sql_networks = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_client_id = $client_id AND network_archived_at IS NULL ORDER BY network_name ASC");
+ $sql_domains = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_client_id = $client_id AND domain_archived_at IS NULL ORDER BY domain_name ASC");
+ $sql_certficates = mysqli_query($mysqli, "SELECT * FROM certificates WHERE certificate_client_id = $client_id AND certificate_archived_at IS NULL ORDER BY certificate_name ASC");
+ $sql_software = mysqli_query($mysqli, "SELECT * FROM software WHERE software_client_id = $client_id AND software_archived_at IS NULL ORDER BY software_name ASC");
- $sql_user_licenses = mysqli_query($mysqli,"
+ $sql_user_licenses = mysqli_query($mysqli, "
SELECT
contact_name,
software_name
@@ -683,7 +720,7 @@ if (isset($_POST['export_client_pdf'])) {
contact_name, software_name;"
);
- $sql_asset_licenses = mysqli_query($mysqli,"
+ $sql_asset_licenses = mysqli_query($mysqli, "
SELECT
asset_name,
software_name
@@ -699,1349 +736,647 @@ if (isset($_POST['export_client_pdf'])) {
asset_name, software_name;"
);
- ?>
-
-
-
-
+ // Assets Section Header
+ if (mysqli_num_rows($sql_assets) > 0 && $export_assets == 1) {
+ $pdf->Bookmark("Assets", 0, 0, "", "B", array(0,0,0));
+ $html .= "
+
Assets
";
+ }
- 0 && $export_assets == 1) {
+ $pdf->Bookmark("Workstations", 1, 0, "", "", array(0,0,0));
+ $html .= "
+ Workstations
+
+
+
+ | Name |
+ Type |
+ Model |
+ Serial |
+ OS |
+ Purchase Date |
+ Warranty Expire |
+ Install Date |
+ Assigned To |
+ Location |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_asset_workstations)) {
+ $asset_name = nullable_htmlentities($row["asset_name"]);
+ $asset_type = nullable_htmlentities($row["asset_type"]);
+ $asset_make = nullable_htmlentities($row["asset_make"]);
+ $asset_model = nullable_htmlentities($row["asset_model"]);
+ $asset_serial = nullable_htmlentities($row["asset_serial"]);
+ $asset_os = nullable_htmlentities($row["asset_os"]);
+ $asset_purchase_date = nullable_htmlentities($row["asset_purchase_date"]);
+ $asset_warranty_expire = nullable_htmlentities($row["asset_warranty_expire"]);
+ $asset_install_date = nullable_htmlentities($row["asset_install_date"]);
+ $contact_name = nullable_htmlentities($row["contact_name"]);
+ $location_name = nullable_htmlentities($row["location_name"]);
+ $html .= "
+
+ | $asset_name |
+ $asset_type |
+ $asset_make $asset_model |
+ $asset_serial |
+ $asset_os |
+ $asset_purchase_date |
+ $asset_warranty_expire |
+ $asset_install_date |
+ $contact_name |
+ $location_name |
+
";
+ }
+ $html .= "
+
+
";
+ }
-}
+ // Servers
+ if (mysqli_num_rows($sql_asset_servers) > 0 && $export_assets == 1) {
+ $pdf->Bookmark("Servers", 1, 0, "", "", array(0,0,0));
+ $html .= "
+ Servers
+
+
+
+ | Name |
+ Model |
+ Serial |
+ OS |
+ IP |
+ Purchase Date |
+ Warranty Expire |
+ Install Date |
+ Location |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_asset_servers)) {
+ $asset_name = nullable_htmlentities($row["asset_name"]);
+ $asset_make = nullable_htmlentities($row["asset_make"]);
+ $asset_model = nullable_htmlentities($row["asset_model"]);
+ $asset_serial = nullable_htmlentities($row["asset_serial"]);
+ $asset_os = nullable_htmlentities($row["asset_os"]);
+ $asset_ip = nullable_htmlentities($row["interface_ip"]);
+ $asset_purchase_date = nullable_htmlentities($row["asset_purchase_date"]);
+ $asset_warranty_expire = nullable_htmlentities($row["asset_warranty_expire"]);
+ $asset_install_date = nullable_htmlentities($row["asset_install_date"]);
+ $location_name = nullable_htmlentities($row["location_name"]);
+ $html .= "
+
+ | $asset_name |
+ $asset_make $asset_model |
+ $asset_serial |
+ $asset_os |
+ $asset_ip |
+ $asset_purchase_date |
+ $asset_warranty_expire |
+ $asset_install_date |
+ $location_name |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Virtual Machines
+ if (mysqli_num_rows($sql_asset_vms) > 0 && $export_assets == 1) {
+ $pdf->Bookmark("Virtual Machines", 1, 0, "", "", array(0,0,0));
+ $html .= "
+ Virtual Machines
+
+
+
+ | Name |
+ OS |
+ IP |
+ Install Date |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_asset_vms)) {
+ $asset_name = nullable_htmlentities($row["asset_name"]);
+ $asset_os = nullable_htmlentities($row["asset_os"]);
+ $asset_ip = nullable_htmlentities($row["interface_ip"]);
+ $asset_install_date = nullable_htmlentities($row["asset_install_date"]);
+ $html .= "
+
+ | $asset_name |
+ $asset_os |
+ $asset_ip |
+ $asset_install_date |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Network Devices
+ if (mysqli_num_rows($sql_asset_network) > 0 && $export_assets == 1) {
+ $pdf->Bookmark("Network Devices", 1, 0, "", "", array(0,0,0));
+ $html .= "
+ Network Devices
+
+
+
+ | Name |
+ Type |
+ Model |
+ Serial |
+ IP |
+ Purchase Date |
+ Warranty Expire |
+ Install Date |
+ Location |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_asset_network)) {
+ $asset_name = nullable_htmlentities($row["asset_name"]);
+ $asset_type = nullable_htmlentities($row["asset_type"]);
+ $asset_make = nullable_htmlentities($row["asset_make"]);
+ $asset_model = nullable_htmlentities($row["asset_model"]);
+ $asset_serial = nullable_htmlentities($row["asset_serial"]);
+ $asset_ip = nullable_htmlentities($row["interface_ip"]);
+ $asset_purchase_date = nullable_htmlentities($row["asset_purchase_date"]);
+ $asset_warranty_expire = nullable_htmlentities($row["asset_warranty_expire"]);
+ $asset_install_date = nullable_htmlentities($row["asset_install_date"]);
+ $location_name = nullable_htmlentities($row["location_name"]);
+ $html .= "
+
+ | $asset_name |
+ $asset_type |
+ $asset_make $asset_model |
+ $asset_serial |
+ $asset_ip |
+ $asset_purchase_date |
+ $asset_warranty_expire |
+ $asset_install_date |
+ $location_name |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Other Devices
+ if (mysqli_num_rows($sql_asset_other) > 0 && $export_assets == 1) {
+ $pdf->Bookmark("Other Devices", 1, 0, "", "", array(0,0,0));
+ $html .= "
+ Other Devices
+
+
+
+ | Name |
+ Type |
+ Model |
+ Serial |
+ IP |
+ Purchase Date |
+ Warranty Expire |
+ Install Date |
+ Location |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_asset_other)) {
+ $asset_name = nullable_htmlentities($row["asset_name"]);
+ $asset_type = nullable_htmlentities($row["asset_type"]);
+ $asset_make = nullable_htmlentities($row["asset_make"]);
+ $asset_model = nullable_htmlentities($row["asset_model"]);
+ $asset_serial = nullable_htmlentities($row["asset_serial"]);
+ $asset_ip = nullable_htmlentities($row["interface_ip"]);
+ $asset_purchase_date = nullable_htmlentities($row["asset_purchase_date"]);
+ $asset_warranty_expire = nullable_htmlentities($row["asset_warranty_expire"]);
+ $asset_install_date = nullable_htmlentities($row["asset_install_date"]);
+ $location_name = nullable_htmlentities($row["location_name"]);
+ $html .= "
+
+ | $asset_name |
+ $asset_type |
+ $asset_make $asset_model |
+ $asset_serial |
+ $asset_ip |
+ $asset_purchase_date |
+ $asset_warranty_expire |
+ $asset_install_date |
+ $location_name |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Software Section
+ if (mysqli_num_rows($sql_software) > 0 && $export_software == 1) {
+ $pdf->Bookmark("Software", 0, 0, "", "B", array(0,0,0));
+ $html .= "
+ Software
+
+
+
+ | Name |
+ Type |
+ License |
+ License Key |
+ Notes |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_software)) {
+ $software_name = nullable_htmlentities($row["software_name"]);
+ $software_type = nullable_htmlentities($row["software_type"]);
+ $software_license_type = nullable_htmlentities($row["software_license_type"]);
+ $software_key = nullable_htmlentities($row["software_key"]);
+ $software_notes = nullable_htmlentities($row["software_notes"]);
+ $html .= "
+
+ | $software_name |
+ $software_type |
+ $software_license_type |
+ $software_key |
+ $software_notes |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // User Assigned Software Licenses
+ if (mysqli_num_rows($sql_user_licenses) > 0 && $export_software == 1) {
+ $pdf->Bookmark("User Assigned Licenses", 0, 0, "", "B", array(0,0,0));
+ $html .= "
+ User Assigned Licenses
+
+
+
+ | User |
+ Software |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_user_licenses)) {
+ $contact_name = nullable_htmlentities($row["contact_name"]);
+ $software_name = nullable_htmlentities($row["software_name"]);
+ $html .= "
+
+ | $contact_name |
+ $software_name |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Asset Assigned Software Licenses
+ if (mysqli_num_rows($sql_asset_licenses) > 0 && $export_software == 1) {
+ $pdf->Bookmark("Asset Assigned Licenses", 0, 0, "", "B", array(0,0,0));
+ $html .= "
+ Asset Assigned Licenses
+
+
+
+ | Asset |
+ Software |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_asset_licenses)) {
+ $asset_name = nullable_htmlentities($row["asset_name"]);
+ $software_name = nullable_htmlentities($row["software_name"]);
+ $html .= "
+
+ | $asset_name |
+ $software_name |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Networks Section
+ if (mysqli_num_rows($sql_networks) > 0 && $export_networks == 1) {
+ $pdf->Bookmark("Networks", 0, 0, "", "B", array(0,0,0));
+ $html .= "
+ Networks
+
+
+
+ | Name |
+ vLAN |
+ Network Subnet |
+ Gateway |
+ DHCP Range |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_networks)) {
+ $network_name = nullable_htmlentities($row["network_name"]);
+ $network_vlan = nullable_htmlentities($row["network_vlan"]);
+ $network = nullable_htmlentities($row["network"]);
+ $network_gateway = nullable_htmlentities($row["network_gateway"]);
+ $network_dhcp_range = nullable_htmlentities($row["network_dhcp_range"]);
+ $html .= "
+
+ | $network_name |
+ $network_vlan |
+ $network |
+ $network_gateway |
+ $network_dhcp_range |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Domains Section
+ if (mysqli_num_rows($sql_domains) > 0 && $export_domains == 1) {
+ $pdf->Bookmark("Domains", 0, 0, "", "B", array(0,0,0));
+ $html .= "
+ Domains
+
+
+
+ | Domain Name |
+ Expire |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_domains)) {
+ $domain_name = nullable_htmlentities($row["domain_name"]);
+ $domain_expire = nullable_htmlentities($row["domain_expire"]);
+ $html .= "
+
+ | $domain_name |
+ $domain_expire |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Certificates Section
+ if (mysqli_num_rows($sql_certficates) > 0 && $export_certificates == 1) {
+ $pdf->Bookmark("Certificates", 0, 0, "", "B", array(0,0,0));
+ $html .= "
+ Certificates
+
+
+
+ | Certificate Name |
+ Domain Name |
+ Issuer |
+ Expiration Date |
+
+
+ ";
+ while ($row = mysqli_fetch_array($sql_certficates)) {
+ $certificate_name = nullable_htmlentities($row["certificate_name"]);
+ $certificate_domain = nullable_htmlentities($row["certificate_domain"]);
+ $certificate_issued_by = nullable_htmlentities($row["certificate_issued_by"]);
+ $certificate_expire = nullable_htmlentities($row["certificate_expire"]);
+ $html .= "
+
+ | $certificate_name |
+ $certificate_domain |
+ $certificate_issued_by |
+ $certificate_expire |
+
";
+ }
+ $html .= "
+
+
";
+ }
+
+ // Write the HTML content to the PDF document
+ $pdf->writeHTML($html, true, false, true, false, "");
+
+ // Output the PDF document for download
+ $pdf->Output(strtoAZaz09($client_name) . "-IT_Documentation-" . date("Y-m-d") . ".pdf", "D");
+ exit;
+}
\ No newline at end of file