diff --git a/admin/ai_models.php b/admin/ai_models.php index e30dc6db3..db8f96d81 100644 --- a/admin/ai_models.php +++ b/admin/ai_models.php @@ -6,7 +6,8 @@ $order = "ASC"; require_once "includes/inc_all_admin.php"; -$sql = mysqli_query($mysqli, "SELECT * FROM ai_models LEFT JOIN ai_providers ON ai_model_ai_provider_id = ai_provider_id ORDER BY $sort $order"); +$sql = mysqli_query($mysqli, "SELECT ai_model_id, ai_model_name, ai_model_prompt, ai_model_use_case, ai_provider_id, + ai_provider_name FROM ai_models LEFT JOIN ai_providers ON ai_model_ai_provider_id = ai_provider_id ORDER BY $sort $order"); $num_rows = mysqli_num_rows($sql); diff --git a/admin/audit_logs.php b/admin/audit_logs.php index fd91cd8f6..440907e9a 100644 --- a/admin/audit_logs.php +++ b/admin/audit_logs.php @@ -48,7 +48,8 @@ if (isset($_GET['action']) & !empty($_GET['action'])) { $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM logs + "SELECT SQL_CALC_FOUND_ROWS client_id, client_name, log_action, log_created_at, log_description, log_entity_id, log_id, + log_ip, log_type, log_user_agent, user_id, user_name 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%') @@ -87,7 +88,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); - No - diff --git a/admin/modals/user/user_add.php b/admin/modals/user/user_add.php index e89fe85eb..b81e505dc 100644 --- a/admin/modals/user/user_add.php +++ b/admin/modals/user/user_add.php @@ -138,7 +138,7 @@ ob_start();
- None - @@ -105,7 +105,7 @@ $net_terms_array = array ( @@ -128,7 +128,7 @@ $net_terms_array = array ( @@ -153,7 +153,7 @@ $net_terms_array = array ( diff --git a/admin/software_templates.php b/admin/software_templates.php index 4672b8706..660053b01 100644 --- a/admin/software_templates.php +++ b/admin/software_templates.php @@ -8,7 +8,9 @@ require_once "includes/inc_all_admin.php"; $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM software_templates + "SELECT SQL_CALC_FOUND_ROWS software_template_description, software_template_id, software_template_license_type, + software_template_name, software_template_notes, software_template_type, + software_template_version FROM software_templates WHERE software_template_name LIKE '%$q%' OR software_template_type LIKE '%$q%' ORDER BY $sort $order LIMIT $record_from, $record_to" ); diff --git a/admin/vendor_templates.php b/admin/vendor_templates.php index bbda9d1ef..6a58fdf5e 100644 --- a/admin/vendor_templates.php +++ b/admin/vendor_templates.php @@ -8,7 +8,10 @@ require_once "includes/inc_all_admin.php"; $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM vendor_templates + "SELECT SQL_CALC_FOUND_ROWS vendor_template_account_number, vendor_template_code, vendor_template_contact_name, + vendor_template_description, vendor_template_email, vendor_template_extension, + vendor_template_hours, vendor_template_id, vendor_template_name, vendor_template_notes, + vendor_template_phone, vendor_template_sla, vendor_template_website FROM vendor_templates WHERE vendor_template_name LIKE '%$q%' OR vendor_template_description LIKE '%$q%' OR vendor_template_account_number LIKE '%$q%' OR vendor_template_website LIKE '%$q%' OR vendor_template_contact_name LIKE '%$q%' OR vendor_template_email LIKE '%$q%' OR vendor_template_phone LIKE '%$phone_query%' ORDER BY $sort $order LIMIT $record_from, $record_to" ); diff --git a/agent/asset.php b/agent/asset.php index e2798c31f..eb95190e7 100644 --- a/agent/asset.php +++ b/agent/asset.php @@ -206,7 +206,8 @@ if (isset($_GET['asset_id'])) { } // Related Documents - $sql_related_documents = mysqli_query($mysqli, "SELECT * FROM asset_documents, documents + $sql_related_documents = mysqli_query($mysqli, "SELECT document_created_at, document_description, documents.document_id, document_name, + document_updated_at, user_name FROM asset_documents, documents LEFT JOIN users ON document_created_by = user_id WHERE asset_documents.asset_id = $asset_id AND asset_documents.document_id = documents.document_id @@ -253,7 +254,8 @@ if (isset($_GET['asset_id'])) { $software_count = mysqli_num_rows($sql_related_software); // Linked Services - $sql_linked_services = mysqli_query($mysqli, "SELECT * FROM service_assets, services + $sql_linked_services = mysqli_query($mysqli, "SELECT service_category, service_description, service_assets.service_id, service_importance, + service_name FROM service_assets, services WHERE service_assets.asset_id = $asset_id AND service_assets.service_id = services.service_id ORDER BY service_name ASC" @@ -263,7 +265,7 @@ if (isset($_GET['asset_id'])) { $linked_services = array(); // Notes - 1 to many relationship - $sql_related_notes = mysqli_query($mysqli, "SELECT * FROM asset_notes + $sql_related_notes = mysqli_query($mysqli, "SELECT asset_note, asset_note_created_at, asset_note_id, asset_note_type, user_name FROM asset_notes LEFT JOIN users ON asset_note_created_by = user_id WHERE asset_note_asset_id = $asset_id AND asset_note_archived_at IS NULL diff --git a/agent/assets.php b/agent/assets.php index bb0d8ded4..a5bef8fa9 100644 --- a/agent/assets.php +++ b/agent/assets.php @@ -150,7 +150,14 @@ $other_count = intval($row['other_count']); $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM assets + "SELECT SQL_CALC_FOUND_ROWS asset_archived_at, asset_contact_id, asset_created_at, asset_description, asset_favorite, + asset_id, asset_install_date, asset_location_id, asset_make, asset_model, asset_name, + asset_notes, asset_os, asset_photo, asset_physical_location, asset_purchase_date, + asset_purchase_reference, asset_serial, asset_status, asset_type, asset_uri, asset_uri_2, + asset_uri_client, asset_vendor_id, asset_warranty_expire, client_id, client_name, + contact_archived_at, contact_name, interface_ip, interface_ipv6, interface_mac, + interface_nat_ip, interface_network_id, location_archived_at, location_name, tag_color, + tag_icon, tag_id, tag_name FROM assets LEFT JOIN clients ON asset_client_id = client_id LEFT JOIN contacts ON asset_contact_id = contact_id LEFT JOIN locations ON asset_location_id = location_id diff --git a/agent/calendar.php b/agent/calendar.php index ceb20d164..08150d1f0 100644 --- a/agent/calendar.php +++ b/agent/calendar.php @@ -135,7 +135,8 @@ if (isset($_GET['calendar_id'])) { require_once "modals/calendar/calendar_event_add.php"; //loop through IDs and create a modal for each -$sql = mysqli_query($mysqli, "SELECT * FROM calendar_events LEFT JOIN calendars ON event_calendar_id = calendar_id $client_event_query"); +$sql = mysqli_query($mysqli, "SELECT calendar_color, calendar_id, calendar_name, event_client_id, event_description, event_end, + event_id, event_location, event_repeat, event_start, event_title FROM calendar_events LEFT JOIN calendars ON event_calendar_id = calendar_id $client_event_query"); while ($row = mysqli_fetch_assoc($sql)) { $event_id = intval($row['event_id']); $event_title = escapeHtml($row['event_title']); @@ -303,7 +304,8 @@ while ($row = mysqli_fetch_assoc($sql)) { }, events: [ - All Asset Locations - Revisions - +