2){ $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); } $client_website = $row['client_website']; $client_net_terms = $row['client_net_terms']; //Query each table and store them in their array $sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE client_id = $client_id ORDER BY contact_name ASC"); $sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE client_id = $client_id ORDER BY location_name ASC"); $sql_assets = mysqli_query($mysqli,"SELECT * FROM assets WHERE client_id = $client_id ORDER BY asset_type ASC"); $sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = $client_id ORDER BY vendor_name ASC"); $sql_logins = mysqli_query($mysqli,"SELECT *, AES_DECRYPT(login_password, '$config_aes_key') AS login_password FROM logins WHERE client_id = $client_id ORDER BY login_name ASC"); $sql_networks = mysqli_query($mysqli,"SELECT * FROM networks WHERE client_id = $client_id ORDER BY network_name ASC"); $sql_domains = mysqli_query($mysqli,"SELECT * FROM domains WHERE client_id = $client_id ORDER BY domain_name ASC"); $sql_software = mysqli_query($mysqli,"SELECT * FROM software WHERE client_id = $client_id ORDER BY software_name ASC"); $sql_invoices = mysqli_query($mysqli,"SELECT * FROM invoices WHERE client_id = $client_id ORDER BY invoice_number DESC"); $sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, invoices, accounts WHERE invoices.client_id = $client_id AND payments.invoice_id = invoices.invoice_id AND payments.account_id = accounts.account_id ORDER BY payments.payment_id DESC"); $sql_quotes = mysqli_query($mysqli,"SELECT * FROM quotes WHERE client_id = $client_id ORDER BY quote_number DESC"); $sql_recurring = mysqli_query($mysqli,"SELECT * FROM recurring WHERE client_id = $client_id ORDER BY recurring_id DESC"); $sql_documents = mysqli_query($mysqli,"SELECT * FROM documents WHERE client_id = $client_id ORDER BY document_created_at DESC"); //Get Counts $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('contact_id') AS num FROM contacts WHERE client_id = $client_id")); $num_contacts = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('location_id') AS num FROM locations WHERE client_id = $client_id")); $num_locations = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('asset_id') AS num FROM assets WHERE client_id = $client_id")); $num_assets = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('vendor_id') AS num FROM vendors WHERE client_id = $client_id")); $num_vendors = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('login_id') AS num FROM logins WHERE client_id = $client_id")); $num_logins = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('network_id') AS num FROM networks WHERE client_id = $client_id")); $num_networks = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('domain_id') AS num FROM domains WHERE client_id = $client_id")); $num_domains = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('software_id') AS num FROM software WHERE client_id = $client_id")); $num_software = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE client_id = $client_id")); $num_invoices = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('payment_id') AS num FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.client_id = $client_id")); $num_payments = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('quote_id') AS num FROM quotes WHERE client_id = $client_id")); $num_quotes = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('recurring_id') AS num FROM recurring WHERE client_id = $client_id")); $num_recurring = $row['num']; $row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('document_id') AS num FROM documents WHERE client_id = $client_id")); $num_documents = $row['num']; ?>
Document IT Documentation Date
Prepared By Confidential

Address
Phone
Email
Website
Net Terms Day
Table of Contents
0){ ?>

Contacts ()

2){ $contact_phone = substr($row['contact_phone'],0,3)."-".substr($row['contact_phone'],3,3)."-".substr($row['contact_phone'],6,4); } $contact_extension = $row['contact_extension']; if(!empty($contact_extension)){ $contact_extension = "x$contact_extension"; } $contact_mobile = $row['contact_mobile']; if(strlen($contact_mobile)>2){ $contact_mobile = substr($row['contact_mobile'],0,3)."-".substr($row['contact_mobile'],3,3)."-".substr($row['contact_mobile'],6,4); } $contact_email = $row['contact_email']; ?>
Name Title Email Phone Mobile
0){ ?>

Locations ()

2){ $location_phone = substr($row['location_phone'],0,3)."-".substr($row['location_phone'],3,3)."-".substr($row['location_phone'],6,4); } ?>
Location Address Phone
$location_city $location_state $location_zip"; ?>
0){ ?>

Assets ()

Type Name Make Model Serial OS IP MAC Purchase Date Warranty Expire
0){ ?>

Vendors ()

2){ $vendor_phone = substr($row['vendor_phone'],0,3)."-".substr($row['vendor_phone'],3,3)."-".substr($row['vendor_phone'],6,4); } $vendor_email = $row['vendor_email']; $vendor_website = $row['vendor_website']; ?>
Vendor Description Contact Name Phone Email Website Account Number
0){ ?>

Logins ()

Name URL/Host Username Password
0){ ?>

Networks ()

Name vLAN Network Gateway DHCP Range
0){ ?>

Web Domains ()

Domain Registrar Webhost Expire
0){ ?>

Software ()

Software Type License
0){ ?>

Invoices ()

Number Amount Date Due Status
$
0){ ?>

Payments ()

Date Received Date Due Invoice Invoice Amount Amount Payed Invoice Balance Payment Method Check #
$ $ $
0){ ?>

Quotes ()

Number Amount Date Status
$
0){ ?>

Recurring Invoices ()

Frequency Created Last Sent Next Date Status
ly
0){ ?>

Documents ()