['label' => 'Open', 'icon' => 'fa-link', 'where' => shareOpenSql(), 'title' => 'Still work - not used up, expired or turned off'], 'received' => ['label' => 'Sent back', 'icon' => 'fa-inbox', 'where' => "item_type = 'Request' AND item_received_at IS NOT NULL AND item_ended_at IS NULL", 'title' => 'Logins clients sent back, waiting to be saved'], 'ended' => ['label' => 'Ended', 'icon' => 'fa-history', 'where' => 'NOT (' . shareLiveSql() . ')', 'title' => 'Used up, expired, turned off, locked - kept for ' . SHARE_KEEP_DAYS . ' days'], 'all' => ['label' => 'All', 'where' => '1'], ]; $show = isset($shows[$_GET['show'] ?? '']) ? ($_GET['show'] ?? '') : ''; $show_query = 'AND ' . $shows[$show]['where']; // Only these sort - filter_header.php will hand through any lowercase word $sortable_columns = ['item_created_at' => 'item_created_at', 'item_name' => 'item_name', 'item_recipient' => 'item_recipient', 'item_expire_at' => 'item_expire_at', 'item_last_viewed_at' => 'item_last_viewed_at', 'client_name' => 'client_name']; if (!isset($sortable_columns[$sort])) { $sort = 'item_created_at'; } $sort_sql = ($sort === 'item_last_viewed_at' ? 'item_last_viewed_at IS NULL, ' : '') . $sortable_columns[$sort] . " $order"; $search_query = "AND (item_name LIKE '%$q%' OR item_recipient LIKE '%$q%' OR item_note LIKE '%$q%' OR creator.user_name LIKE '%$q%' OR client_name LIKE '%$q%')"; $scope_query = clientScopeSql('item_client_id'); $visible_sql = "item_type IN (" . shareVisibleTypesSql() . ")"; $filters = "$visible_sql $type_query $search_query $scope_query $client_query"; $shares = shareRows("$filters $show_query", "$sort_sql, shared_items.item_id DESC", $user_config_records_per_page, $record_from); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); // How many of each, for the pills - everything in scope, before the pill itself $count_sql = []; foreach ($shows as $key => $s) { $count_sql[] = "COALESCE(SUM({$s['where']}), 0)"; } $row = mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', $count_sql) . " FROM shared_items LEFT JOIN clients ON client_id = item_client_id LEFT JOIN users creator ON creator.user_id = item_created_by WHERE $filters")); $counts = []; foreach (array_keys($shows) as $i => $key) { $counts[$key] = intval($row[$i]); } $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; })); }; ?>

Shared Links

text-nowrap table-light"> $type, 'icon' => 'fa-share-alt']; $state = shareState($row); $is_open = in_array($state, ['active', 'waiting'], true); $can_end_row = shareCanMake($type); $protection = shareProtection($row); $quick_url = "modals/share/share.php?id=$item_id"; ?>
Shared With Made Works until Opened Status Client
Anyone with the link
Last
'shared links', 'icon' => 'fa-share-alt', 'filtered' => $q || $type_query, 'views' => ['show'], 'view' => emptyStatePill($shows, $show), 'title' => 'No open links' . ($client_url ? ' for this client' : ''), 'text' => 'Share a credential, document or file from its menu' . ($can_note || $can_request || $can_export ? ', or send a secure note, the IT documentation or ask for a login here' : '') . '.', 'actions' => array_merge( $can_note ? [['label' => 'Secure Note', 'modal' => 'modals/share/share_add.php?type=Note&client_id=' . intval($client_id), 'icon' => 'fa-user-secret']] : [], $can_export ? [['label' => 'IT documentation', 'modal' => 'modals/share/share_add.php?type=Export&client_id=' . intval($client_id), 'icon' => 'fa-book', 'size' => 'lg']] : [], $can_request ? [['label' => 'Ask the client for a login', 'modal' => 'modals/share/share_add.php?type=Request&client_id=' . intval($client_id), 'icon' => 'fa-inbox']] : [] ), ]; require_once "../includes/filter_footer.php"; ?>