'license templates', 'title' => 'That license template is gone', 'text' => 'It may have been deleted.', 'icon' => 'fa-cube', 'filtered' => false, 'actions' => [['label' => 'License Templates', 'href' => 'software_templates.php']]]); require_once "../includes/footer.php"; exit(); } $software_template_id = intval($template['software_template_id']); $name = escapeHtml($template['software_template_name']); // Tab title - used raw, the footer encodes it $page_title = $template['software_template_name']; $archived = !empty($template['software_template_archived_at']); $usage = softwareTemplateUsage([$software_template_id])[$software_template_id] ?? ['count' => 0, 'clients' => 0, 'seats' => 0, 'used' => 0, 'renewing' => 0, 'expired' => 0, 'last' => null]; $type_style = softwareTypeStyle($template['software_template_type']); $csrf = $_SESSION['csrf_token']; // The licenses made from it, the latest first $licenses = []; $sql = mysqli_query($mysqli, "SELECT software_id, software_name, software_seats, software_expire, software_created_at, software_client_id, client_name, client_abbreviation, " . softwareSeatsUsedSql('software.software_id') . " AS seats_used FROM software JOIN clients ON client_id = software_client_id AND client_archived_at IS NULL WHERE software_template_id = $software_template_id AND software_archived_at IS NULL ORDER BY software_created_at DESC, software_id DESC LIMIT 25"); while ($row = mysqli_fetch_assoc($sql)) { $licenses[] = $row; } $edit_url = "modals/software_template/software_template_edit.php?id=$software_template_id"; $use_url = "modals/software_template/software_template_use.php?id=$software_template_id"; $several_url = "modals/software_template/software_template_use_several.php?id=$software_template_id"; $term = (string) $template['software_template_term']; $vendor_name = (string) $template['vendor_template_name']; $product_name = (string) $template['product_name']; $facts = array_filter([ 'Type' => $template['software_template_type'] !== '' ? '' . escapeHtml($template['software_template_type']) : '', 'License type' => (string) $template['software_template_license_type'] !== '' ? '' . escapeHtml($template['software_template_license_type']) : '', 'Version' => escapeHtml((string) $template['software_template_version']), 'Seats' => $template['software_template_seats'] !== null ? '' . intval($template['software_template_seats']) : '', 'Renews every' => isset(SOFTWARE_RENEWAL_TERMS[$term]) ? '' . escapeHtml(SOFTWARE_RENEWAL_TERMS[$term]) . ' - from when it was bought' : '', 'Vendor' => $vendor_name !== '' ? '' . vendorTile($vendor_name, 'xs') . escapeHtml($vendor_name) . '' . ($template['vendor_template_archived_at'] ? ' - its vendor template is archived, so licenses from it get no vendor' : '') : '', 'Sold as' => $product_name !== '' ? '' . escapeHtml($product_name) . ' ' . escapeHtml(softwareTemplatePriceText($template)) . '' . ($template['product_archived_at'] ? ' - archived' : '') : '', ]); ?>
| Client | Seats | Renews | Made |
|---|---|---|---|
|
= escapeHtml($row['client_name']) ?>
= escapeHtml($row['software_name']) ?>
|
= softwareSeatBar(softwareSeats($row['seats_used'], $row['software_seats']), false) ?> | = $renewal ? softwareRenewalPill($renewal) : '-' ?> | = timeAgo($row['software_created_at']) ?> |