diff --git a/accounts.php b/accounts.php index 73e411d6..e2fb7a15 100644 --- a/accounts.php +++ b/accounts.php @@ -12,7 +12,7 @@ $url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM accounts - LEFT JOIN account_types ON account_types.account_type_id = accounts.account_type + LEFT JOIN account_types ON account_types.account_type_id = accounts.account_type WHERE (account_name LIKE '%$q%' OR account_type_name LIKE '%$q%') AND account_archived_at IS NULL ORDER BY $sort $order LIMIT $record_from, $record_to" diff --git a/admin_account_types.php b/admin_account_types.php index 88803e01..41e231c0 100644 --- a/admin_account_types.php +++ b/admin_account_types.php @@ -180,4 +180,5 @@ require_once "admin_account_types_add_modal.php"; require_once "footer.php"; -?> \ No newline at end of file +?> + diff --git a/admin_account_types_add_modal.php b/admin_account_types_add_modal.php index 7afd7645..7a6ed71d 100644 --- a/admin_account_types_add_modal.php +++ b/admin_account_types_add_modal.php @@ -16,10 +16,10 @@
@@ -34,4 +34,4 @@
- \ No newline at end of file + diff --git a/admin_account_types_edit_modal.php b/admin_account_types_edit_modal.php index 486a08e1..a9542bc6 100644 --- a/admin_account_types_edit_modal.php +++ b/admin_account_types_edit_modal.php @@ -19,9 +19,9 @@
diff --git a/admin_bulk_mail.php b/admin_bulk_mail.php index 2fc8ae87..5ad44629 100644 --- a/admin_bulk_mail.php +++ b/admin_bulk_mail.php @@ -149,4 +149,4 @@ $sql = mysqli_query($mysqli, "SELECT * FROM contacts close(); - return $tables; } diff --git a/admin_document_template_details.php b/admin_document_template_details.php index 4768ea51..592a4998 100644 --- a/admin_document_template_details.php +++ b/admin_document_template_details.php @@ -11,7 +11,7 @@ $purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'htt $purifier = new HTMLPurifier($purifier_config); if (isset($_GET['document_id'])) { - $document_id = intval($_GET['document_id']); + $document_id = intval($_GET['document_id']); } $sql_document = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_template = 1 AND document_id = $document_id"); @@ -26,36 +26,36 @@ $document_updated_at = nullable_htmlentities($row['document_updated_at']); ?> - + -
-
+
+
-

+

-
- +
+ +
+
+
+ +
-
-
- -
-
- + set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'htt $purifier = new HTMLPurifier($purifier_config); if (isset($_GET['ticket_template_id'])) { - $ticket_template_id = intval($_GET['ticket_template_id']); + $ticket_template_id = intval($_GET['ticket_template_id']); } $sql_ticket_templates = mysqli_query($mysqli, "SELECT * FROM ticket_templates WHERE ticket_template_id = $ticket_template_id"); @@ -30,101 +30,101 @@ $sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE ?> - + -
-
+
+
-
-
-

-
- -
-

-
+
+
+

+
+ +
+

+
+
+
+

+
+ +
+
+
+
+ +
-
-

-
- +
-
-
-
- -
+ +
+ +
+
+
Tasks
+
+
+
+ +
+
+
+ +
+ +
+ +
+
+
+
+ + + + + + + + +
+ + + + +
+
+
+ +
+
-
- -
- -
-
-
Tasks
-
-
-
- -
-
-
- -
- -
- -
-
-
-
- - - - - - - - -
- - - - -
-
-
- -
- -
- - + - - + + - -

Blank Page

-
-

This is a great starting point for new custom pages.

+ +

Blank Page

+
+

This is a great starting point for new custom pages.

-
+
-
-
Requester
-
Sam Adams
+
+
Requester
+
Sam Adams
-
Created
-
+
Created
+
-
Last activity
-
-
+
Last activity
+
+
- -
+ +
$date_time"; +echo "Current Date and Time: $date_time"; ?> diff --git a/budget.php b/budget.php index 834ca0f5..d4ccf9c5 100644 --- a/budget.php +++ b/budget.php @@ -50,7 +50,7 @@ $grandTotal = 0;
@@ -69,9 +69,9 @@ $grandTotal = 0; - $month): + foreach ($months as $index => $month): $amount = getBudgetAmount($budgets, $category['category_id'], $index + 1); $rowTotal += $amount; $columnTotals[$index] += $amount; @@ -80,7 +80,7 @@ $grandTotal = 0; - diff --git a/budget_edit.php b/budget_edit.php index c25007af..fe448b0c 100644 --- a/budget_edit.php +++ b/budget_edit.php @@ -66,9 +66,9 @@ $grandTotal = 0; - $month): + foreach ($months as $index => $month): $amount = getBudgetAmount($budgets, $category['category_id'], $index + 1); $rowTotal += $amount; $columnTotals[$index] += $amount; @@ -77,7 +77,7 @@ $grandTotal = 0; - diff --git a/client_location_bulk_assign_tags_modal.php b/client_location_bulk_assign_tags_modal.php index 5bd6c636..d92894f3 100644 --- a/client_location_bulk_assign_tags_modal.php +++ b/client_location_bulk_assign_tags_modal.php @@ -45,4 +45,4 @@
- \ No newline at end of file + diff --git a/cron.php b/cron.php index 8fcbb977..07d73a84 100644 --- a/cron.php +++ b/cron.php @@ -696,7 +696,7 @@ while ($row = mysqli_fetch_array($sql_recurring_expenses)) { // TELEMETRY -if ($config_telemetry > 0 OR $config_telemetry == 2) { +if ($config_telemetry > 0 || $config_telemetry == 2) { $current_version = exec("git rev-parse HEAD"); diff --git a/cron_certificate_refresher.php b/cron_certificate_refresher.php index 3d0e76e5..61a4a346 100644 --- a/cron_certificate_refresher.php +++ b/cron_certificate_refresher.php @@ -59,4 +59,4 @@ while ($row = mysqli_fetch_array($sql_certificates)) { mysqli_query($mysqli,"UPDATE certificates SET certificate_issued_by = '$issued_by', certificate_expire = $expire, certificate_public_key = '$public_key' WHERE certificate_id = $certificate_id"); -} \ No newline at end of file +} diff --git a/cron_ticket_email_parser.php b/cron_ticket_email_parser.php index 9fff2b81..68557e7f 100644 --- a/cron_ticket_email_parser.php +++ b/cron_ticket_email_parser.php @@ -345,7 +345,7 @@ function createMailboxFolder($client, $folderName) { } // Function to subscribe to a folder in the mailbox -function subscribeMailboxFolder($client, $folder) { +function subscribeMailboxFolder($folder) { if ($folder) { try { // Subscribe to the folder @@ -378,7 +378,7 @@ $client->connect(); $folder = createMailboxFolder($client, 'ITFlow'); // Subscribe to the "ITFlow" mailbox folder -subscribeMailboxFolder($client, $folder); +subscribeMailboxFolder($folder); // Possible names for the inbox folder $inboxNames = ['Inbox', 'INBOX', 'inbox']; diff --git a/functions.php b/functions.php index 1202e192..0821cb4d 100644 --- a/functions.php +++ b/functions.php @@ -867,23 +867,6 @@ function roundToNearest15($time) return number_format($decimalHours, 2); } -// Get the value of a setting from the database -function getSettingValue($mysqli, $setting_name) -{ - //if starts with config_ then get from config table - if (substr($setting_name, 0, 7) == "config_") { - $sql = mysqli_query($mysqli, "SELECT $setting_name FROM settings"); - $row = mysqli_fetch_array($sql); - return $row[$setting_name]; - } elseif (substr($setting_name, 0, 7) == "company") { - $sql = mysqli_query($mysqli, "SELECT $setting_name FROM companies"); - $row = mysqli_fetch_array($sql); - return $row[$setting_name]; - } else { - return "Cannot Find Setting Name"; - } -} - function getMonthlyTax($tax_name, $month, $year, $mysqli) { // SQL to calculate monthly tax @@ -932,8 +915,7 @@ function getAccountCurrencyCode($mysqli, $account_id) { $sql = mysqli_query($mysqli, "SELECT account_currency_code FROM accounts WHERE account_id = $account_id"); $row = mysqli_fetch_array($sql); - $account_currency_code = nullable_htmlentities($row['account_currency_code']); - return $account_currency_code; + return nullable_htmlentities($row['account_currency_code']); } function calculateAccountBalance($mysqli, $account_id) @@ -1059,32 +1041,6 @@ function addToMailQueue($mysqli, $data) { return true; } -function calculateInvoiceBalance($mysqli, $invoice_id) -{ - $invoice_id_int = intval($invoice_id); - $sql_invoice = mysqli_query($mysqli, "SELECT * FROM invoices WHERE invoice_id = $invoice_id_int"); - $row = mysqli_fetch_array($sql_invoice); - $invoice_amount = floatval($row['invoice_amount']); - - $sql_payments = mysqli_query( - $mysqli, - "SELECT SUM(payment_amount) AS total_payments FROM payments - WHERE payment_invoice_id = $invoice_id - " - ); - - $row = mysqli_fetch_array($sql_payments); - $total_payments = floatval($row['total_payments']); - - $balance = $invoice_amount - $total_payments; - - if ($balance == '') { - $balance = '0.00'; - } - - return $balance; -} - function createiCalStr($datetime, $title, $description, $location) { require_once "plugins/zapcal/zapcallib.php"; @@ -1148,21 +1104,6 @@ function createiCalStrCancel($originaliCalStr) { return $cal_event->export(); } -function getTicketStatusColor($ticket_status) { - - global $mysqli; - - $status_id = intval($ticket_status); - $row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_status_color FROM ticket_statuses WHERE ticket_status_id = $status_id LIMIT 1")); - - if ($row) { - return nullable_htmlentities($row['ticket_status_color']); - } - - // Default return - return "Unknown"; -} - function getTicketStatusName($ticket_status) { global $mysqli; @@ -1195,7 +1136,6 @@ function fetchUpdates() { $update_message = "New Updates are Available [$latest_version]"; } - $updates = new stdClass(); $updates->output = $output; @@ -1203,8 +1143,7 @@ function fetchUpdates() { $updates->current_version = $current_version; $updates->latest_version = $latest_version; $updates->update_message = $update_message; - - + return $updates; diff --git a/guest_footer.php b/guest_footer.php index 1204bc87..c11e4c88 100644 --- a/guest_footer.php +++ b/guest_footer.php @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/guest_pay_invoice_stripe.php b/guest_pay_invoice_stripe.php index 9072519d..d3eb6b72 100644 --- a/guest_pay_invoice_stripe.php +++ b/guest_pay_invoice_stripe.php @@ -2,13 +2,6 @@ require_once 'guest_header.php'; -function log_to_console($message) { - $message = date("H:i:s") . " - $message - ".PHP_EOL; - print($message); - flush(); - ob_flush(); -} - // Define wording DEFINE("WORDING_PAYMENT_FAILED", "

There was an error verifying your payment. Please contact us for more information before attempting payment again.

"); diff --git a/notifications_dismissed.php b/notifications_dismissed.php index 8b63899c..ff5992af 100644 --- a/notifications_dismissed.php +++ b/notifications_dismissed.php @@ -13,8 +13,8 @@ $url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, - "SELECT SQL_CALC_FOUND_ROWS * FROM notifications - LEFT JOIN users ON notification_dismissed_by = user_id + "SELECT SQL_CALC_FOUND_ROWS * FROM notifications + LEFT JOIN users ON notification_dismissed_by = user_id LEFT JOIN clients ON notification_client_id = client_id WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%') AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt' diff --git a/pagination.php b/pagination.php index 73d4099e..88b91444 100644 --- a/pagination.php +++ b/pagination.php @@ -59,9 +59,8 @@ if ($total_found_rows > 5) { $next_class = "disabled"; } $get_copy = $_GET; // create a copy of the $_GET array - //unset($get_copy['page']); // Unset Array Var to prevent Duplicate Get VARs - unset($get_copy['page']); + unset($get_copy['page']); $url_query_strings_page = http_build_query($get_copy); $prev_page = $page - 1; $next_page = $page + 1; diff --git a/pagination_head.php b/pagination_head.php index b2e5033d..600b4cb3 100644 --- a/pagination_head.php +++ b/pagination_head.php @@ -11,7 +11,7 @@ $get_copy = $_GET; // create a copy of the $_GET array //unset($get_copy['page']); unset($get_copy['sort']); -unset($get_copy['order']); +unset($get_copy['order']); // Paging if (isset($_GET['page'])) { @@ -107,8 +107,8 @@ if (isset($_GET['archived'])) { $archived = intval($_GET['archived']); } -if($archived == 1){ +if ($archived == 1){ $archive_query = "archived_at IS NOT NULL"; } else { $archive_query = "archived_at IS NULL"; -} \ No newline at end of file +} diff --git a/portal/portal_footer.php b/portal/portal_footer.php index 6ab4d9cb..7793f8e7 100644 --- a/portal/portal_footer.php +++ b/portal/portal_footer.php @@ -64,4 +64,4 @@ - \ No newline at end of file + diff --git a/portal/portal_header.php b/portal/portal_header.php index 17cc1b29..1e6f6c55 100644 --- a/portal/portal_header.php +++ b/portal/portal_header.php @@ -18,11 +18,8 @@ header("X-Frame-Options: DENY"); // Legacy - - + + @@ -50,10 +47,10 @@ header("X-Frame-Options: DENY"); // Legacy - - + +