From 52c67f41394def2439f6ce6936e1f05de4015ee6 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Thu, 30 Oct 2025 14:29:51 -0400 Subject: [PATCH] Remove unused budget code --- agent/budget.php | 113 ----------------------------------------- agent/budget_edit.php | 114 ------------------------------------------ agent/post/budget.php | 61 ---------------------- 3 files changed, 288 deletions(-) delete mode 100644 agent/budget.php delete mode 100644 agent/budget_edit.php delete mode 100644 agent/post/budget.php diff --git a/agent/budget.php b/agent/budget.php deleted file mode 100644 index ffd7510c..00000000 --- a/agent/budget.php +++ /dev/null @@ -1,113 +0,0 @@ - -
-
-

Budget for

- -
-
-
-
- -
-
- - - - - - - - - - - - - - - $month): - $amount = getBudgetAmount($budgets, $category['category_id'], $index + 1); - $rowTotal += $amount; - $columnTotals[$index] += $amount; - ?> - - - - - - - - - - - - - - - -
ExpenseTotal
Total
-
- - diff --git a/agent/budget_edit.php b/agent/budget_edit.php deleted file mode 100644 index 26af60ce..00000000 --- a/agent/budget_edit.php +++ /dev/null @@ -1,114 +0,0 @@ - -
-
-

Editing Budget for

-
- - View Budget - - - -
-
-
- -
-
- -
-
-
- - - - - - - - - - - - - - - - - - $month): - $amount = getBudgetAmount($budgets, $category['category_id'], $index + 1); - $rowTotal += $amount; - $columnTotals[$index] += $amount; - ?> - - - - - - - - - - - - - - - -
ExpenseTotal
Total
-
-
- -
- - diff --git a/agent/post/budget.php b/agent/post/budget.php deleted file mode 100644 index a095e18e..00000000 --- a/agent/post/budget.php +++ /dev/null @@ -1,61 +0,0 @@ - $months) { - foreach ($months as $month => $amount) { - $amount = (int)$amount; - - // Check if budget exists - $query = "SELECT * FROM budget WHERE budget_category_id = $category_id AND budget_month = $month AND budget_year = $year"; - $result = mysqli_query($mysqli, $query); - if (mysqli_num_rows($result) > 0) { - // Update existing budget - $query = "UPDATE budget SET budget_amount = $amount WHERE budget_category_id = $category_id AND budget_month = $month AND budget_year = $year"; - } else { - // Insert new budget - $query = "INSERT INTO budget SET budget_category_id = $category_id, budget_month = $month, budget_year = $year, budget_amount = $amount"; - } - mysqli_query($mysqli, $query); - } - } - - logAction("Budget", "Edit", "$session_name edited the budget for $year"); - - flash_alert("Budget Updated for $year"); - - redirect(); - -} - -if (isset($_POST['delete_budget'])) { - - validateCSRFToken($_POST['csrf_token']); - - enforceUserPermission('module_financial', 3); - - $year = intval($_POST['year']); - - mysqli_query($mysqli,"DELETE FROM budget WHERE budget_year = $year"); - - logAction("Budget", "Delete", "$session_name deleted the budget for $year"); - - flash_alert("Budget deleted for $year", 'error'); - - redirect(); - -}