More Select * Queries convert

This commit is contained in:
johnnyq
2026-08-06 13:57:46 -04:00
parent 108781db5b
commit f8899e592f
9 changed files with 22 additions and 18 deletions

View File

@@ -63,15 +63,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
$id = intval($row['contract_template_id']);
$name = escapeHtml($row['contract_template_name']);
$type = escapeHtml($row['contract_template_type']);
$freq = escapeHtml($row['contract_template_update_frequency']);
$sla_low_resp = escapeHtml($row['sla_low_response_time']);
$sla_med_resp = escapeHtml($row['sla_medium_response_time']);
$sla_high_resp = escapeHtml($row['sla_high_response_time']);
$sla_low_res = escapeHtml($row['sla_low_resolution_time']);
$sla_med_res = escapeHtml($row['sla_medium_resolution_time']);
$sla_high_res = escapeHtml($row['sla_high_resolution_time']);
$hourly_rate = escapeHtml($row['contract_template_hourly_rate']);
$after_hours = escapeHtml($row['contract_template_after_hours_hourly_rate']);
$freq = escapeHtml($row['contract_template_renewal_frequency']);
$sla_low_resp = escapeHtml($row['contract_template_sla_low_response_time']);
$sla_med_resp = escapeHtml($row['contract_template_sla_medium_response_time']);
$sla_high_resp = escapeHtml($row['contract_template_sla_high_response_time']);
$sla_low_res = escapeHtml($row['contract_template_sla_low_resolution_time']);
$sla_med_res = escapeHtml($row['contract_template_sla_medium_resolution_time']);
$sla_high_res = escapeHtml($row['contract_template_sla_high_resolution_time']);
$hourly_rate = escapeHtml($row['contract_template_rate_standard']);
$after_hours = escapeHtml($row['contract_template_rate_after_hours']);
$support_hours = escapeHtml($row['contract_template_support_hours']);
$net_terms = escapeHtml($row['contract_template_net_terms']);
$created = escapeHtml($row['contract_template_created_at']);

View File

@@ -4,7 +4,7 @@ require_once '../../includes/modal_header.php';
$task_template_id = intval($_GET['id']);
$sql = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE task_template_id = $task_template_id LIMIT 1");
$sql = mysqli_query($mysqli, "SELECT task_template_completion_estimate, task_template_name, task_template_order FROM task_templates WHERE task_template_id = $task_template_id LIMIT 1");
$row = mysqli_fetch_assoc($sql);
$task_template_name = escapeHtml($row['task_template_name']);

View File

@@ -355,7 +355,7 @@ if (isset($_POST['export_users'])) {
$sql = mysqli_query(
$mysqli,
"SELECT * FROM users
"SELECT user_status FROM users
LEFT JOIN user_roles ON user_role_id = role_id
WHERE (user_name LIKE '%$q%' OR user_email LIKE '%$q%')
AND user_type = 1

View File

@@ -34,7 +34,7 @@ $ticket_template_created_at = escapeHtml($row['ticket_template_created_at']);
$ticket_template_updated_at = escapeHtml($row['ticket_template_updated_at']);
// Get Task Templates
$sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE task_template_ticket_template_id = $ticket_template_id ORDER BY task_template_order ASC, task_template_id ASC");
$sql_task_templates = mysqli_query($mysqli, "SELECT task_template_completion_estimate, task_template_id, task_template_name FROM task_templates WHERE task_template_ticket_template_id = $ticket_template_id ORDER BY task_template_order ASC, task_template_id ASC");
?>

View File

@@ -6,7 +6,11 @@ enforceUserPermission('module_client', 2);
$location_id = intval($_GET['id']);
$sql = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_id = $location_id LIMIT 1");
$sql = mysqli_query($mysqli, "SELECT location_address, location_archived_at, location_city, location_client_id,
location_contact_id, location_country, location_created_at, location_description,
location_fax, location_fax_country_code, location_hours, location_name, location_notes,
location_phone, location_phone_country_code, location_phone_extension, location_photo, location_primary,
location_state, location_zip FROM locations WHERE location_id = $location_id LIMIT 1");
$row = mysqli_fetch_assoc($sql);
$location_name = escapeHtml($row['location_name']);
@@ -18,7 +22,7 @@ $location_state = escapeHtml($row['location_state']);
$location_zip = escapeHtml($row['location_zip']);
$location_phone_country_code = escapeHtml($row['location_phone_country_code']);
$location_phone = escapeHtml(formatPhoneNumber($row['location_phone'], $location_phone_country_code));
//$location_extension = intval($row['location_extension']);
$location_extension = escapeHtml($row['location_phone_extension']);
$location_fax_country_code = escapeHtml($row['location_fax_country_code']);
$location_fax = escapeHtml(formatPhoneNumber($row['location_fax'], $location_fax_country_code));
$location_hours = escapeHtml($row['location_hours']);

View File

@@ -734,7 +734,7 @@ if (isset($_POST['export_quotes'])) {
$sql = mysqli_query(
$mysqli,
"SELECT * FROM quotes
"SELECT quote_number, quote_prefix FROM quotes
LEFT JOIN clients ON quote_client_id = client_id
LEFT JOIN categories ON quote_category_id = category_id
WHERE (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%' OR quote_amount LIKE '%$q%' OR client_name LIKE '%$q%')

View File

@@ -671,7 +671,7 @@ if (isset($_POST['export_recurring_invoices'])) {
$sql = mysqli_query(
$mysqli,
"SELECT * FROM recurring_invoices
"SELECT recurring_invoice_frequency, recurring_invoice_number, recurring_invoice_prefix FROM recurring_invoices
LEFT JOIN clients ON recurring_invoice_client_id = client_id
LEFT JOIN categories ON recurring_invoice_category_id = category_id
WHERE (CONCAT(recurring_invoice_prefix,recurring_invoice_number) LIKE '%$q%' OR recurring_invoice_frequency LIKE '%$q%' OR recurring_invoice_scope LIKE '%$q%' OR client_name LIKE '%$q%' OR category_name LIKE '%$q%')

View File

@@ -292,7 +292,7 @@ if (isset($_POST['export_software'])) {
$sql = mysqli_query(
$mysqli,
"SELECT * FROM software
"SELECT software_id FROM software
LEFT JOIN clients ON client_id = software_client_id
LEFT JOIN vendors ON vendor_id = software_vendor_id
WHERE (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_key LIKE '%$q%' OR client_name LIKE '%$q%')

View File

@@ -2890,7 +2890,7 @@ if (isset($_POST['export_tickets'])) {
// Get records from database - same shape as the tickets page list query
$sql = mysqli_query(
$mysqli,
"SELECT * FROM tickets
"SELECT category_name, ticket_billable, ticket_number, ticket_prefix, user_name FROM tickets
LEFT JOIN clients ON ticket_client_id = client_id
LEFT JOIN contacts ON ticket_contact_id = contact_id
LEFT JOIN users ON ticket_assigned_to = user_id