$group) { $count_sql[] = "COALESCE(SUM({$group['where']}), 0) AS `$key`"; } $counts = array_map('intval', mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT " . implode(', ', $count_sql) . " $from"))); $tab = isset($groups[$_GET['tab'] ?? '']) ? $_GET['tab'] : 'all'; $total = $counts[$tab]; $pages = max(1, (int) ceil($total / $per_page)); $page = min(max(1, intval($_GET['page'] ?? 1)), $pages); $offset = ($page - 1) * $per_page; $assets = mysqli_query($mysqli, "SELECT asset_id, asset_name, asset_type, asset_make, asset_model, asset_status, asset_warranty_expire, asset_contact_id, contact_name, location_name $from AND {$groups[$tab]['where']} ORDER BY asset_name ASC LIMIT $per_page OFFSET $offset"); /** This page's address with some of its settings changed. */ function assetsUrl(array $changes) { global $tab, $q, $mine; $params = array_merge(['tab' => $tab !== 'all' ? $tab : null, 'scope' => $mine ? 'mine' : null, 'q' => $q !== '' ? $q : null], $changes); $params = array_filter($params, function ($v) { return $v !== null && $v !== ''; }); return 'assets.php' . ($params ? '?' . http_build_query($params) : ''); } ?>

Devices

'devices', 'filtered' => true, 'match_text' => 'Nothing here has “' . escapeHtml($q) . '” in its name, model, serial or person.', 'clear_url' => assetsUrl(['q' => null, 'page' => null])]) ?> 'No devices of yours', 'text' => 'Devices we have down as yours show here.', 'icon' => 'fa-desktop', 'filtered' => false]) ?> 'No devices yet', 'text' => 'The devices we look after for you show here.', 'icon' => 'fa-desktop', 'filtered' => false]) ?> 1) { ?>
- of