diff --git a/admin_logs.php b/admin_logs.php index 99cc103c..124968ef 100644 --- a/admin_logs.php +++ b/admin_logs.php @@ -16,6 +16,16 @@ if (isset($_GET['user']) & !empty($_GET['user'])) { $user = ''; } +// Client Filter +if (isset($_GET['client']) & !empty($_GET['client'])) { + $client_query = 'AND (log_client_id = ' . intval($_GET['client']) . ')'; + $client = intval($_GET['client']); +} else { + // Default - any + $client_query = ''; + $client = ''; +} + // Log Type Filter if (isset($_GET['type']) & !empty($_GET['type'])) { $log_type_query = "AND (log_type = '" . sanitizeInput($_GET['type']) . "')"; @@ -42,14 +52,15 @@ $url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM logs - LEFT JOIN users ON log_user_id = user_id - LEFT JOIN clients ON log_client_id = client_id - WHERE (log_type LIKE '%$q%' OR log_action LIKE '%$q%' OR log_description LIKE '%$q%' OR log_ip LIKE '%$q%' OR log_user_agent LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%') - AND DATE(log_created_at) BETWEEN '$dtf' AND '$dtt' - $user_query - $log_type_query - $log_action_query - ORDER BY $sort $order LIMIT $record_from, $record_to" + LEFT JOIN users ON log_user_id = user_id + LEFT JOIN clients ON log_client_id = client_id + WHERE (log_type LIKE '%$q%' OR log_action LIKE '%$q%' OR log_description LIKE '%$q%' OR log_ip LIKE '%$q%' OR log_user_agent LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%') + AND DATE(log_created_at) BETWEEN '$dtf' AND '$dtt' + $user_query + $client_query + $log_type_query + $log_action_query + ORDER BY $sort $order LIMIT $record_from, $record_to" ); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); @@ -72,6 +83,27 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); + +
+
+ +
+
+
-
- -
-
- -
- -
-
-
- -
-
- -
- -
-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TimestampUserTypeActionDescriptionIP AddressUser AgentEntity ID
$log_user_browser"; ?>
-
- -
-
- - + + + diff --git a/client_side_nav.php b/client_side_nav.php index 4f3ebc52..074073be 100644 --- a/client_side_nav.php +++ b/client_side_nav.php @@ -339,19 +339,6 @@ - - diff --git a/inc_all_client.php b/inc_all_client.php index 0793590c..f1545712 100644 --- a/inc_all_client.php +++ b/inc_all_client.php @@ -213,9 +213,6 @@ if (isset($_GET['client_id'])) { $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('item_id') AS num FROM shared_items WHERE item_client_id = $client_id")); $num_shared_links = $row['num']; - $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('log_id') AS num FROM logs WHERE log_client_id = $client_id")); - $num_logs = $row['num']; - // Expiring Items // Count Domains Expiring within 30 Days