diff --git a/src/server/cyberhex-code/system/secure_zone/php/export_log.php b/src/server/cyberhex-code/system/secure_zone/php/export_log.php index 6a8dfff..1de5f74 100644 --- a/src/server/cyberhex-code/system/secure_zone/php/export_log.php +++ b/src/server/cyberhex-code/system/secure_zone/php/export_log.php @@ -104,7 +104,7 @@ $filter_query = "&loglevel=$loglevel&logtext=$logtext&machine_id=$machine_id&tim $offset = ($current_page - 1) * $page_size; // Get total number of log entries based on filters - $sql = "SELECT count(*) AS log_count FROM machines,log WHERE machine_location LIKE ? AND loglevel LIKE ? AND logtext LIKE ? AND machine_id LIKE ? AND time LIKE ?"; + $sql = "SELECT count(log.id) AS log_count FROM machines,log WHERE machine_name=machine_id AND machine_location LIKE ? AND loglevel LIKE ? AND logtext LIKE ? AND machine_id LIKE ? AND time LIKE ?"; $stmt = $conn->prepare($sql); $loglevel = "%" . $loglevel . "%"; $logtext = "%" . $logtext . "%"; diff --git a/src/server/cyberhex-code/system/secure_zone/php/welcome.php b/src/server/cyberhex-code/system/secure_zone/php/welcome.php index 12bb2ba..769028a 100644 --- a/src/server/cyberhex-code/system/secure_zone/php/welcome.php +++ b/src/server/cyberhex-code/system/secure_zone/php/welcome.php @@ -100,7 +100,7 @@ $filter_query = "&hash=$hash&path=$path&machine_id=$machine_id&action=$action&ma if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } - $sql = "SELECT count(*) AS log_count FROM machines,vir_notify WHERE machine_location LIKE ? AND path LIKE ? AND hash LIKE ? AND machine_id LIKE ? AND action LIKE ?"; + $sql = "SELECT count(vir_notify.id) AS log_count FROM machines,vir_notify WHERE machine_name=machine_id AND machine_location LIKE ? AND path LIKE ? AND hash LIKE ? AND machine_id LIKE ? AND action LIKE ?"; $stmt = $conn->prepare($sql); $path = "%" . $path . "%"; $hash = "%" . $hash . "%";