'vendor templates', 'title' => 'That vendor template is gone', 'text' => 'It may have been deleted.', 'icon' => 'fa-building', 'filtered' => false, 'actions' => [['label' => 'Vendor Templates', 'href' => 'vendor_templates.php']]]); require_once "../includes/footer.php"; exit(); } $vendor_template_id = intval($template['vendor_template_id']); $name = escapeHtml($template['vendor_template_name']); // Tab title - used raw, the footer encodes it $page_title = $template['vendor_template_name']; $archived = !empty($template['vendor_template_archived_at']); $usage = vendorTemplateUsage([$vendor_template_id])[$vendor_template_id] ?? ['clients' => 0, 'vendors' => 0, 'ours' => 0, 'last' => null]; $csrf = $_SESSION['csrf_token']; // Its vendors - the current ones for current clients listed, the rest counted $all_vendors = vendorTemplateVendors($vendor_template_id); $vendors = array_filter($all_vendors, function ($vendor) { return !$vendor['archived'] && !$vendor['client_archived']; }); $set_up = count(array_filter($vendors, function ($vendor) { return $vendor['client_id'] && $vendor['account_number'] !== ''; })); $client_vendors = count(array_filter($vendors, function ($vendor) { return $vendor['client_id'] > 0; })); $others = count($all_vendors) - count($vendors); $license_templates = vendorTemplateLicenseTemplates($vendor_template_id); $edit_url = "modals/vendor_template/vendor_template_edit.php?id=$vendor_template_id"; $clients_url = "/agent/modals/vendor/vendor_template_clients.php?template_id=$vendor_template_id"; // What a vendor from it starts with - the ones it has $t = $template; $website = vendorWebsiteLabel($t['vendor_template_website']); $facts = array_filter([ 'What they are' => escapeHtml((string) $t['vendor_template_description']), 'Support line' => vendorTemplatePhoneHtml($t['vendor_template_phone'], $t['vendor_template_phone_country_code'], $t['vendor_template_extension']), 'Support hours' => escapeHtml((string) $t['vendor_template_hours']), 'SLA' => escapeHtml((string) $t['vendor_template_sla']), 'Support email' => trim((string) $t['vendor_template_email']) !== '' ? '' . escapeHtml($t['vendor_template_email']) . '' : '', 'Support site' => $website !== '' ? '' . escapeHtml($website) . '' : '', 'Account number' => escapeHtml(trim((string) $t['vendor_template_account_number'])), 'PIN' => vendorSecretHtml($t['vendor_template_code']), 'Account manager' => escapeHtml(trim((string) $t['vendor_template_contact_name'])), ], function ($value) { return trim($value) !== ''; }); $icons = []; foreach (vendorTemplateFieldLabels() as $field) { $icons[$field['label']] = $field['icon']; } ?>
| Client | Their vendor | Account | Added | |
|---|---|---|---|---|
| = escapeHtml($vendor['client_name']) ?> Ours | = escapeHtml($vendor['vendor_name']) ?> | = escapeHtml($vendor['account_number']) ?> No account number - | = date('M j, Y', strtotime($vendor['created_at'])) ?> |