Switched to DB controlled Account Types

This commit is contained in:
Andrew Malsbury
2023-10-09 20:24:54 +00:00
parent 2ee87f0f66
commit f190e100e8

View File

@@ -28,15 +28,17 @@
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span> <span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
</div> </div>
<select class="form-control select" name="type" required> <select class="form-control select" name="type" required>
<option value="">- Select -</option> <option value="">- Select -</option>
<option value="11" <?php if ($account_type == 'Current Assets') echo 'selected'; ?>>Current Assets</option> <!-- If $account_type is set and exists in the array, show it as selected -->
<option value="12" <?php if ($account_type == 'Fixed Assets') echo 'selected'; ?>>Fixed Assets</option> <?php if (isset($account_type) && isset($account_types[$account_type])): ?>
<option value="13" <?php if ($account_type == 'Other Assets') echo 'selected'; ?>>Other Assets</option> <option value="<?php echo $account_type; ?>" selected><?php echo $account_types[$account_type]; ?></option>
<option value="21" <?php if ($account_type == 'Current Liabilities') echo 'selected'; ?>>Current Liabilities</option> <?php endif; ?>
<option value="22" <?php if ($account_type == 'Long Term Liabilities') echo 'selected'; ?>>Long Term Liabilities</option> <option value="">----------------</option>
<option value="23" <?php if ($account_type == 'Other Liabilities') echo 'selected'; ?>>Other Liabilities</option> <!-- Loop through the associative array to generate the options -->
<option value="30" <?php if ($account_type == 'Equity') echo 'selected'; ?>>Equity</option> <?php foreach ($account_types as $value => $label): ?>
</select> <option value="<?php echo $value; ?>"><?php echo $label; ?></option>
<?php endforeach; ?>
</select>
</div> </div>
</div> </div>