From 615f317d2b6d7a169214d3b4a311736142f94117 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Thu, 9 Feb 2023 12:29:12 +0000 Subject: [PATCH] General cleanup/formatting --- accounts.php | 11 +- ajax.php | 10 +- base32static.php | 4 +- calendar_event_add_modal.php | 4 +- calendar_event_edit_modal.php | 4 +- calendar_events.php | 14 +- categories.php | 32 +- client_add_modal.php | 4 +- client_asset_add_modal.php | 8 +- client_asset_copy_modal.php | 8 +- client_asset_edit_modal.php | 10 +- client_asset_interface_add_modal.php | 2 +- client_assets.php | 24 +- client_certificates.php | 16 +- client_contact_add_modal.php | 2 +- client_contact_details.php | 6 +- client_contact_edit_modal.php | 2 +- client_contacts.php | 20 +- client_document_add_from_template_modal.php | 4 +- client_document_add_modal.php | 2 +- client_document_details.php | 2 +- client_document_edit_modal.php | 2 +- client_document_template_details.php | 2 +- client_document_templates.php | 26 +- client_documents.php | 26 +- client_domain_add_modal.php | 4 +- client_domains.php | 10 +- client_edit_modal.php | 4 +- client_events.php | 4 +- client_invoices.php | 9 +- client_location_add_modal.php | 2 +- client_location_edit_modal.php | 2 +- client_locations.php | 12 +- client_login_add_modal.php | 8 +- client_login_edit_modal.php | 8 +- client_logins.php | 17 +- client_logs.php | 39 +- client_network_add_modal.php | 2 +- client_networks.php | 27 +- client_overview.php | 4 +- client_payments.php | 20 +- client_quotes.php | 8 +- client_recurring_invoices.php | 18 +- client_scheduled_tickets.php | 10 +- client_service_edit_modal.php | 14 +- client_services.php | 80 ++-- client_shared_items.php | 217 +++++------ client_software.php | 354 +++++++++--------- client_software_add_from_template_modal.php | 2 +- client_software_add_modal.php | 4 +- client_software_edit_modal.php | 8 +- client_software_templates.php | 37 +- client_tickets.php | 360 +++++++++--------- client_trips.php | 12 +- client_vendor_templates.php | 312 ++++++++-------- client_vendors.php | 12 +- clients.php | 46 +-- companies.php | 8 +- cron.php | 245 +++++++------ cron_ticket_email_parser.php | 19 +- dashboard_financial.php | 14 +- dashboard_technical.php | 28 +- expense_add_modal.php | 14 +- expense_copy_modal.php | 14 +- expense_edit_modal.php | 14 +- expenses.php | 32 +- functions.php | 18 +- get_credential.php | 4 +- get_settings.php | 2 +- global_search.php | 14 +- guest_download_file.php | 8 +- guest_pay_invoice_stripe.php | 16 +- guest_post.php | 16 +- guest_view_item.php | 6 +- guest_view_quote.php | 10 +- inc_all_client.php | 88 +++-- invoice_add_modal.php | 4 +- invoice_edit_modal.php | 2 +- invoice_payment_add_modal.php | 12 +- invoices.php | 24 +- item_edit_modal.php | 2 +- logs.php | 30 +- notifications_dismissed.php | 12 +- pagination.php | 2 +- pagination_head.php | 38 +- payments.php | 319 ++++++++-------- product_add_modal.php | 202 +++++----- product_edit_modal.php | 196 +++++----- products.php | 191 +++++----- quote_add_modal.php | 4 +- quote_edit_modal.php | 2 +- quotes.php | 386 ++++++++++---------- recurring_invoice.php | 7 +- recurring_invoice_add_modal.php | 4 +- recurring_invoice_edit_modal.php | 2 +- recurring_invoices.php | 352 +++++++++--------- report_expense_by_vendor.php | 12 +- report_expense_summary.php | 10 +- report_income_by_client.php | 4 +- report_income_summary.php | 12 +- report_profit_loss.php | 54 +-- report_tax_summary.php | 104 +++--- report_ticket_by_client.php | 4 +- revenue_add_modal.php | 336 ++++++++--------- revenue_edit_modal.php | 336 ++++++++--------- revenues.php | 30 +- rfc6238.php | 12 +- scheduled_ticket_add_modal.php | 6 +- scheduled_tickets.php | 182 ++++----- settings_api.php | 6 +- settings_defaults.php | 14 +- settings_software_templates.php | 193 +++++----- settings_tags.php | 37 +- settings_taxes.php | 29 +- settings_vendor_templates.php | 309 ++++++++-------- side_nav.php | 2 +- ticket.php | 28 +- ticket_add_modal.php | 12 +- ticket_edit_modal.php | 10 +- ticket_invoice_add_modal.php | 6 +- tickets.php | 2 +- top_nav.php | 2 +- transfer_add_modal.php | 20 +- transfer_edit_modal.php | 20 +- transfers.php | 322 ++++++++-------- trip_add_modal.php | 4 +- trip_copy_modal.php | 4 +- trip_edit_modal.php | 4 +- trips.php | 35 +- user_add_modal.php | 2 +- user_companies_modal.php | 93 ++--- user_edit_modal.php | 248 +++++++------ user_invite_modal.php | 127 ++++--- user_profile.php | 2 +- users.php | 10 +- vendor_add_from_template_modal.php | 2 +- vendor_edit_modal.php | 2 +- vendors.php | 343 +++++++++-------- 138 files changed, 3706 insertions(+), 3556 deletions(-) diff --git a/accounts.php b/accounts.php index 6b6413e8..c73e7fe6 100644 --- a/accounts.php +++ b/accounts.php @@ -9,11 +9,14 @@ if (!empty($_GET['sb'])) { } //Rebuild URL -$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o))); +$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o))); -$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM accounts - WHERE account_name LIKE '%$q%' AND company_id = $session_company_id - ORDER BY $sb $o LIMIT $record_from, $record_to"); +$sql = mysqli_query( + $mysqli, + "SELECT SQL_CALC_FOUND_ROWS * FROM accounts + WHERE account_name LIKE '%$q%' AND company_id = $session_company_id + ORDER BY $sb $o LIMIT $record_from, $record_to" +); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); diff --git a/ajax.php b/ajax.php index 3902a37b..2e8610c0 100644 --- a/ajax.php +++ b/ajax.php @@ -141,7 +141,9 @@ if (isset($_GET['network_get_json_details'])) { } // Lookup all client locations, as networks can be associated with any client location - $locations_sql = mysqli_query($mysqli, "SELECT location_id, location_name FROM locations + $locations_sql = mysqli_query( + $mysqli, + "SELECT location_id, location_name FROM locations WHERE location_client_id = '$client_id' AND company_id = '$session_company_id'" ); while ($row = mysqli_fetch_array($locations_sql)) { @@ -226,11 +228,11 @@ if (isset($_GET['share_generate_link'])) { $item_encrypted_credential = ''; // Default empty $client_id = intval($_GET['client_id']); - $item_type = trim(strip_tags(mysqli_real_escape_string($mysqli,$_GET['type']))); + $item_type = trim(strip_tags(mysqli_real_escape_string($mysqli, $_GET['type']))); $item_id = intval($_GET['id']); - $item_note = trim(strip_tags(mysqli_real_escape_string($mysqli,$_GET['note']))); + $item_note = trim(strip_tags(mysqli_real_escape_string($mysqli, $_GET['note']))); $item_view_limit = intval($_GET['views']); - $item_expires = trim(strip_tags(mysqli_real_escape_string($mysqli,$_GET['expires']))); + $item_expires = trim(strip_tags(mysqli_real_escape_string($mysqli, $_GET['expires']))); $item_key = randomString(156); if ($item_type == "Document") { diff --git a/base32static.php b/base32static.php index 1bfad4cc..a59feaff 100644 --- a/base32static.php +++ b/base32static.php @@ -44,7 +44,7 @@ class Base32Static { $i=0; while($i < count($fiveBitBinaryArray)) { - $base32 .= self::$map[base_convert(str_pad($fiveBitBinaryArray[$i], 5,'0'), 2, 10)]; + $base32 .= self::$map[base_convert(str_pad($fiveBitBinaryArray[$i], 5, '0'), 2, 10)]; $i++; } @@ -71,7 +71,7 @@ class Base32Static { substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false; } - $input = str_replace('=','', $input); + $input = str_replace('=', '', $input); $input = str_split($input); $binaryString = ""; diff --git a/calendar_event_add_modal.php b/calendar_event_add_modal.php index a3428a52..40a8be28 100644 --- a/calendar_event_add_modal.php +++ b/calendar_event_add_modal.php @@ -48,7 +48,7 @@ - Client - - Client - $sb, 'o' => $o))); +$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o))); -$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM categories - WHERE category_name LIKE '%$q%' - AND category_type = '$category' - AND category_archived_at IS NULL - AND company_id = $session_company_id - ORDER BY $sb $o LIMIT $record_from, $record_to" +$sql = mysqli_query( + $mysqli, + "SELECT SQL_CALC_FOUND_ROWS * FROM categories + WHERE category_name LIKE '%$q%' + AND category_type = '$category' + AND category_archived_at IS NULL + AND company_id = $session_company_id + ORDER BY $sb $o LIMIT $record_from, $record_to" ); -$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); +$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); //Colors Used -$sql_colors_used = mysqli_query($mysqli,"SELECT category_color FROM categories - WHERE category_type = '$category' - AND category_archived_at IS NULL - AND company_id = $session_company_id" +$sql_colors_used = mysqli_query( + $mysqli, + "SELECT category_color FROM categories + WHERE category_type = '$category' + AND category_archived_at IS NULL + AND company_id = $session_company_id" ); while ($color_used_row = mysqli_fetch_array($sql_colors_used)) { diff --git a/client_add_modal.php b/client_add_modal.php index c1db4453..b3515ea7 100644 --- a/client_add_modal.php +++ b/client_add_modal.php @@ -64,7 +64,7 @@ @@ -271,7 +271,7 @@