'Tick the licenses to renew first.']); exit; } $single = count($licenses) === 1; // The term their templates renew on, when they all share one $terms = []; foreach ($licenses as $row) { $term = intval($row['software_template_id'] ?? 0) ? (string) getFieldById('software_templates', $row['software_template_id'], 'software_template_term') : ''; $terms[$term] = true; } $default_term = count($terms) === 1 && isset(SOFTWARE_RENEWAL_TERMS[(string) array_key_first($terms)]) ? (string) array_key_first($terms) : '1y'; ob_start(); ?>