From bec2156fa2dc6c32829fa8f29c765e376253eb53 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sun, 9 Jul 2023 12:25:42 -0400 Subject: [PATCH] Combine Montly Recurring and Yearly Recurring to together to create a new monthly recurring --- dashboard_financial.php | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/dashboard_financial.php b/dashboard_financial.php index eae8e9ee..14a22729 100644 --- a/dashboard_financial.php +++ b/dashboard_financial.php @@ -77,16 +77,19 @@ $sql_latest_expenses = mysqli_query( ORDER BY expense_id DESC LIMIT 5" ); -//Get Monthly Recurring Total -$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month'"); -$row = mysqli_fetch_array($sql_recurring_monthly_total); -$recurring_monthly_total = floatval($row['recurring_monthly_total']); - //Get Yearly Recurring Total $sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_yearly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'year'"); $row = mysqli_fetch_array($sql_recurring_yearly_total); $recurring_yearly_total = floatval($row['recurring_yearly_total']); +//Get Monthly Recurring Total +$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month'"); +$row = mysqli_fetch_array($sql_recurring_monthly_total); +$recurring_monthly_total = floatval($row['recurring_monthly_total']) + ($recurring_yearly_total / 12); + + + + //Get Total Miles Driven $sql_miles_driven = mysqli_query($mysqli, "SELECT SUM(trip_miles) AS total_miles FROM trips WHERE YEAR(trip_date) = $year"); $row = mysqli_fetch_array($sql_miles_driven); @@ -181,20 +184,6 @@ $vendors_added = intval($row['vendors_added']); -
- -
-
-

-

Yearly Recurring

-
-
- -
-
-
- -