"FIELD(service_importance, 'High', 'Medium', 'Low') $order, service_name ASC", 'service_name' => "service_name $order", 'service_category' => "service_category = '' $order, service_category $order, service_name ASC", 'client_name' => "client_name $order, service_name ASC", 'service_review_due' => "service_review_due IS NULL, service_review_due $order, service_name ASC", 'service_updated_at' => "COALESCE(service_updated_at, service_created_at) $order", ]; if (!isset($sortable_columns[$sort])) { $sort = 'service_importance'; } $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS services.*, client_name FROM services $joins WHERE $filters $show_query ORDER BY services.service_favorite DESC, {$sortable_columns[$sort]}, service_id DESC LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $services = []; while ($row = mysqli_fetch_assoc($sql)) { $services[intval($row['service_id'])] = $row; } $counts = serviceCounts(array_keys($services)); $issues = serviceIssues(array_keys($services)); // How many of each, for the pills $count_sql = []; foreach ($shows as $key => $s) { $count_sql[] = $s['where'] === '' ? 'COUNT(*)' : "COALESCE(SUM({$s['where']}), 0)"; } $row = mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', $count_sql) . " FROM services $joins WHERE $filters")); $view_counts = []; foreach (array_keys($shows) as $i => $key) { $view_counts[$key] = intval($row[$i]); } // Categories in use in this scope, for the filter $categories = []; $sql_categories = mysqli_query($mysqli, "SELECT DISTINCT service_category FROM services $joins WHERE service_category <> '' " . clientScopeSql('service_client_id') . ($client_url ? " AND service_client_id = $client_id" : '') . " ORDER BY service_category"); while ($row = mysqli_fetch_row($sql_categories)) { $categories[] = $row[0]; } $filter_url = function ($changes) { $params = array_merge($_GET, $changes); unset($params['page']); return '?' . http_build_query(array_filter($params, function ($v) { return $v !== '' && $v !== null; })); }; $sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) { return '' . $label . ($sort === $column ? " $order_icon" : '') . ''; }; $link_icons = ['asset' => ['fa-desktop', 'asset', 'assets'], 'credential' => ['fa-key', 'login', 'logins'], 'domain' => ['fa-globe', 'domain', 'domains'], 'certificate' => ['fa-lock', 'certificate', 'certificates'], 'contact' => ['fa-user', 'person', 'people'], 'vendor' => ['fa-building', 'vendor', 'vendors'], 'document' => ['fa-file-alt', 'document', 'documents']]; ?>

Services

text-nowrap table-light"> $row) { $row_client_id = intval($row['service_client_id']); $c = $counts[$service_id]; $row_issues = $issues[$service_id]; $review = serviceReview($row); $is_archived = !empty($row['service_archived_at']); $is_favorite = intval($row['service_favorite']) === 1; $has_danger = in_array('danger', array_column($row_issues, 'tone'), true); $edge = $is_archived ? '' : ($has_danger ? 'danger' : ($row_issues || $review['state'] === 'overdue' ? 'warning' : '')); $url = escapeHtml(serviceUrl($service_id, $row_client_id)); $quick_url = "modals/service/service.php?id=$service_id"; $name = escapeHtml($row['service_name']); $detail = implode(' ยท ', array_filter([$row['service_category'], $row['service_description']])); $chips = ''; foreach ($link_icons as $type => [$icon, $one, $many]) { if ($c[$type]) { $chips .= '' . $c[$type] . ''; } } ?> ">
Depends on Attention
Archived
to look at
Nothing linked
">
1) { ?>
and more
open ticket -
'services', 'icon' => 'fa-stream', 'filtered' => $q !== '' || $importance_filter || $category_filter !== '' || $client_filter, 'archived' => $show === 'archived', 'views' => ['show'], 'view' => emptyStatePill($shows, $show, '', ['unreviewed']), 'text' => 'Start with what the client cannot work without: email, backup, their line of business app.', 'actions' => $can_edit ? [['label' => 'New Service', 'modal' => "modals/service/service_add.php?$client_url", 'size' => 'lg']] : [], ]; require_once "../includes/filter_footer.php"; ?>