From 1f3c103032969a67e2ea8c5c5afc5114f2bbf1ef Mon Sep 17 00:00:00 2001 From: o-psi Date: Sat, 14 Oct 2023 23:34:54 -0500 Subject: [PATCH] changed view from long list to broken down by type --- settings_account_types.php | 105 ++++++++++++++++++++++++++++--------- 1 file changed, 80 insertions(+), 25 deletions(-) diff --git a/settings_account_types.php b/settings_account_types.php index 55134c03..8663cd41 100644 --- a/settings_account_types.php +++ b/settings_account_types.php @@ -5,11 +5,40 @@ require_once("inc_all_settings.php"); $sort = "account_type_id"; $order = "ASC"; +if (isset($_GET['account_type'])) { + $account_type = sanitizeInput($_GET['account_type']); + switch ($account_type) { + case "Assets": + $account_type_id_min = "10"; + $account_type_id_max = "19"; + break; + case "Liabilities": + $account_type_id_min = "20"; + $account_type_id_max = "29"; + break; + case "Equity": + $account_type_id_min = "30"; + $account_type_id_max = "39"; + break; + default: + $account_type_id_min = "10"; + $account_type_id_max = "39"; + } +} else { + if (isset($_GET['archived'])) { + $account_type_id_min = "10"; + $account_type_id_max = "39"; } + +} + + $sql = mysqli_query( $mysqli, "SELECT * FROM account_types - WHERE account_type_archived_at IS NULL + WHERE account_type_$archive_query + AND account_type_id >= $account_type_id_min + AND account_type_id <= $account_type_id_max ORDER BY $sort $order" ); @@ -21,17 +50,41 @@ $num_rows = mysqli_num_rows($sql);

Finance Account Types

- +
+
- @@ -43,45 +96,47 @@ $num_rows = mysqli_num_rows($sql); $account_type_id = nullable_htmlentities($row['account_type_id']); $account_type_name = nullable_htmlentities($row['account_type_name']); $account_type_description = nullable_htmlentities($row['account_type_description']); - $account_type_group = $row['account_type_id']; - - if($account_type_group < 20) { - $account_type_group_name = "Assets"; - } elseif($account_type_group < 30) { - $account_type_group_name = "Liabilities"; - } elseif($account_type_group < 40) { - $account_type_group_name = "Equity"; - } else { - $account_type_group_name = "Other"; - } - - ?> + ?> - - - - + + + -
Account Type ID Account Type NameType Group Description
+ + + + + +