= 2; $co_domains = []; if ($co_support) { $co_sql = mysqli_query($mysqli, "SELECT domain_id, domain_name, domain_expire, domain_description FROM domains WHERE domain_client_id = $client_id AND domain_archived_at IS NULL ORDER BY domain_name ASC"); while ($co_domain = mysqli_fetch_assoc($co_sql)) { $co_domains[] = $co_domain; } } // Vendor templates - which the client has, and which it should $co_vendor_templates = []; $co_sql = mysqli_query($mysqli, "SELECT vendor_template_id, vendor_template_name, vendor_template_description, (SELECT COUNT(*) FROM vendors WHERE vendor_client_id = $client_id AND vendor_archived_at IS NULL AND (vendors.vendor_template_id = vendor_templates.vendor_template_id OR LOWER(vendor_name) = LOWER(vendor_template_name))) AS has_it FROM vendor_templates WHERE vendor_template_archived_at IS NULL ORDER BY vendor_template_name ASC"); while ($co_template = mysqli_fetch_assoc($co_sql)) { $co_vendor_templates[intval($co_template['vendor_template_id'])] = $co_template; } $co_vendor_should = vendorTemplatesMissingFor($client_id); $co_license_templates = []; $co_license_should = []; if ($co_support) { $co_sql = mysqli_query($mysqli, "SELECT software_template_id, software_template_name, software_template_type, software_template_license_type, vendor_template_name, (SELECT COUNT(*) FROM software WHERE software_client_id = $client_id AND software_archived_at IS NULL AND software.software_template_id = software_templates.software_template_id) AS has_it FROM software_templates LEFT JOIN vendor_templates ON vendor_templates.vendor_template_id = software_template_vendor_template_id AND vendor_template_archived_at IS NULL WHERE software_template_archived_at IS NULL ORDER BY software_template_name ASC"); while ($co_template = mysqli_fetch_assoc($co_sql)) { $co_license_templates[intval($co_template['software_template_id'])] = $co_template; } $co_license_should = softwareTemplatesMissingFor($client_id); } $co_ticked = function ($name, $id, $should) use ($settings_kept) { if (!empty($settings_kept)) { return in_array((string) $id, array_map('strval', (array) ($_SESSION['co_kept_it'][$name] ?? [])), true); } return $should; }; ?>

Domains

'coDomains', 'label' => $co_domains ? 'Add more' : 'Their domains', 'rows' => 3, 'placeholder' => "example.com\nexample-mail.com", 'help' => 'One to a line. Each is looked up as it is added - its registrar, renewal date and DNS - and its website certificate added, to watch for renewals.']) ?>

Vendors

0 || isset($co_vendor_should[intval($t['vendor_template_id'])]); }); $co_others = array_diff_key($co_vendor_templates, $co_listed); ?>
$co_template) { $co_has = intval($co_template['has_it']) > 0; ?>

No vendor templates yet - the ISPs, software makers and suppliers your clients use, set up once in Admin > Vendor Templates. Add the client's own on its Vendors.

Licenses

0 || isset($co_license_should[intval($t['software_template_id'])]); }); $co_others = array_diff_key($co_license_templates, $co_listed); ?>
$co_template) { $co_has = intval($co_template['has_it']) > 0; ?>

Each with the template's seats, renewal and vendor - the vendor added for them too, when they haven't got it. Put devices and users on them from the license afterwards.

No license templates yet - Microsoft 365, antivirus and the rest, set up once in Admin > License Templates. Add the client's own on its Licenses.