From a340df0df9c43d8682f8cb6802434e33fd3adffa Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Mon, 23 Jan 2023 21:37:32 +0000 Subject: [PATCH] More general code cleanup/formatting --- logs.php | 302 ++++++++++++++++++++++---------------------- settings_backup.php | 50 ++++---- settings_quote.php | 112 ++++++++-------- settings_tags.php | 184 +++++++++++++-------------- settings_taxes.php | 118 ++++++++--------- settings_theme.php | 72 +++++------ 6 files changed, 418 insertions(+), 420 deletions(-) diff --git a/logs.php b/logs.php index 3f479f58..450e8e96 100644 --- a/logs.php +++ b/logs.php @@ -1,60 +1,60 @@ $sb, 'o' => $o))); -$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM logs +$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%') @@ -62,125 +62,125 @@ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM logs 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()")); ?> -
-
-

Audit Logs

-
-
-
-
-
-
- -
- - -
-
+
+
+

Audit Logs

-
-
" id="advancedFilter"> -
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- -
-
- - "> - - - - - - - - - - - - - $client_name"; - } - - ?> - - - - - - - - - - - +
+
+
+
+
+ +
+ + +
+
+
+
+
" id="advancedFilter"> +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
TimestampUserClientTypeActionDescriptionIP AddressUser Agent
$log_user_browser"; ?>
+ "> + + + + + + + + + + + + + + while ($row = mysqli_fetch_array($sql)) { + $log_id = $row['log_id']; + $log_type = htmlentities($row['log_type']); + $log_action = htmlentities($row['log_action']); + $log_description = htmlentities($row['log_description']); + $log_ip = htmlentities($row['log_ip']); + $log_user_agent = htmlentities($row['log_user_agent']); + $log_user_os = get_os($log_user_agent); + $log_user_browser = get_web_browser($log_user_agent); + $log_created_at = $row['log_created_at']; + $user_id = $row['user_id']; + $user_name = htmlentities($row['user_name']); + if (empty($user_name)) { + $user_name_display = "-"; + }else{ + $user_name_display = $user_name; + } + $client_name = htmlentities($row['client_name']); + $client_id = $row['client_id']; + if (empty($client_name)) { + $client_name_display = "-"; + }else{ + $client_name_display = "$client_name"; + } - -
TimestampUserClientTypeActionDescriptionIP AddressUser Agent
+ ?> + + + + + + + + + + $log_user_browser"; ?> + + + + + + +
+ +
- -
-
-
-
-

Download Database

+
+
+

Download Database

+
+
+
+

Download
+
+
-
-
-

Download
-
-
-
-
-
-

Backup Master Encryption Key

-
-
-
-
- -
-
- +
+
+

Backup Master Encryption Key

+
+
+
+ + +
+
+ +
+
- -
- -
+ + +
-
-
-
-

Quote Settings

-
-
-
- -
- -
-
- -
- +
+
+

Quote Settings

-
+
+ -
- -
-
- -
- +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ + +
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ + + +
-
- -
- - -
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- - - - -
-
+
- - $sb, 'o' => $o))); -$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM tags +$sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM tags WHERE tag_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()")); +$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); if ($num_row > 0) { //Colors Used -$sql_colors_used = mysqli_query($mysqli,"SELECT tag_color FROM tags - WHERE tag_archived_at IS NULL - AND company_id = $session_company_id" -); + $sql_colors_used = mysqli_query($mysqli, "SELECT tag_color FROM tags + WHERE tag_archived_at IS NULL + AND company_id = $session_company_id" + ); -while ($color_used_row = mysqli_fetch_array($sql_colors_used)) { - $colors_used_array[] = $color_used_row['tag_color']; -} -$colors_diff = array_diff($colors_array,$colors_used_array); + while ($color_used_row = mysqli_fetch_array($sql_colors_used)) { + $colors_used_array[] = $color_used_row['tag_color']; + } + $colors_diff = array_diff($colors_array, $colors_used_array); }else{ - $colors_diff = $colors_array; + $colors_diff = $colors_array; } ?>
-
-

Tags

-
- +
+

Tags

+
+ +
-
- -
-
-
-
-
- -
- + +
+
+
+ +
+ +
+ +
+
+
-
- -
-
-
+
+
+
+ +
+
+ + "> + + + + + + + + + + + + + + + + + + + +
NameTypeColorAction
"; ?> + +
+
+
- -
-
- - "> - - - - - - - - - - - - - - - - - - - -
NameTypeColorAction
"; ?> - -
-
- -
- diff --git a/settings_taxes.php b/settings_taxes.php index fcb749b8..33e71072 100644 --- a/settings_taxes.php +++ b/settings_taxes.php @@ -1,9 +1,9 @@ -
-
-

Taxes

-
- +
+

Taxes

+
+ +
-
-
-
- - "> - - - - - - - - - - - - - +
+
+
NamePercentAction
- -
+ "> + + + + + + + +

No Records Here

"; - } - - ?> + ?> + + + + + - -
NamePercentAction
+ +
+

No Records Here

"; + } + + ?> + + + + +
-
diff --git a/settings_theme.php b/settings_theme.php index 91d1136f..da2a44f1 100644 --- a/settings_theme.php +++ b/settings_theme.php @@ -1,42 +1,42 @@ -
-
-

Theme

-
-
-
- - -
- - - -
-
- > - -
-
- - - +
+
+

Theme

+
+ -
- - - - -
-
+ +
+ + + +
+
+ > + +
+
+ + + +
+ +
+ + + + +
+