Skip to content

Commit

Permalink
Move display settings to the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
ellite committed Feb 23, 2024
1 parent 15f7156 commit 166d42e
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,45 @@
<input type="submit" value="<?= translate('save', $i18n) ?>" id="addFixerKey" onClick="addFixerKeyButton()"/>
</div>
</div>
</section>
</section>

<section class="account-section">
<header>
<h2><?= translate('payment_methods', $i18n) ?></h2>
</header>
<div class="payments-list">
<?php
$paymentsInUseQuery = $db->query('SELECT id FROM payment_methods WHERE id IN (SELECT DISTINCT payment_method_id FROM subscriptions)');
$paymentsInUse = [];
while ($row = $paymentsInUseQuery->fetchArray(SQLITE3_ASSOC)) {
$paymentsInUse[] = $row['id'];
}

foreach ($payments as $payment) {
$inUse = in_array($payment['id'], $paymentsInUse);
?>
<div class="payments-payment"
data-enabled="<?= $payment['enabled']; ?>"
data-in-use="<?= $inUse ? 'yes' : 'no' ?>"
data-paymentid="<?= $payment['id'] ?>"
title="<?= $inUse ? translate('cant_delete_payment_method_in_use', $i18n) : ($payment['enabled'] ? translate('disable', $i18n) : translate('enable', $i18n)) ?>"
onClick="togglePayment(<?= $payment['id'] ?>)">
<img src="images/uploads/icons/<?= $payment['icon'] ?>" alt="Logo" />
<span class="payment-name">
<?= $payment['name'] ?>
</span>
</div>
<?php
}
?>
</div>
<div class="settings-notes">
<p>
<i class="fa-solid fa-circle-info"></i>
<?= translate('payment_methods_info', $i18n) ?>
</p>
</div>
</section>

<section class="account-section">
<header>
Expand Down Expand Up @@ -513,44 +551,6 @@
<?= translate('experimental_info', $i18n) ?>
</p>
</div>
</section>

<section class="account-section">
<header>
<h2><?= translate('payment_methods', $i18n) ?></h2>
</header>
<div class="payments-list">
<?php
$paymentsInUseQuery = $db->query('SELECT id FROM payment_methods WHERE id IN (SELECT DISTINCT payment_method_id FROM subscriptions)');
$paymentsInUse = [];
while ($row = $paymentsInUseQuery->fetchArray(SQLITE3_ASSOC)) {
$paymentsInUse[] = $row['id'];
}

foreach ($payments as $payment) {
$inUse = in_array($payment['id'], $paymentsInUse);
?>
<div class="payments-payment"
data-enabled="<?= $payment['enabled']; ?>"
data-in-use="<?= $inUse ? 'yes' : 'no' ?>"
data-paymentid="<?= $payment['id'] ?>"
title="<?= $inUse ? translate('cant_delete_payment_method_in_use', $i18n) : ($payment['enabled'] ? translate('disable', $i18n) : translate('enable', $i18n)) ?>"
onClick="togglePayment(<?= $payment['id'] ?>)">
<img src="images/uploads/icons/<?= $payment['icon'] ?>" alt="Logo" />
<span class="payment-name">
<?= $payment['name'] ?>
</span>
</div>
<?php
}
?>
</div>
<div class="settings-notes">
<p>
<i class="fa-solid fa-circle-info"></i>
<?= translate('payment_methods_info', $i18n) ?>
</p>
</div>
</section>

<section class="account-section">
Expand Down

0 comments on commit 166d42e

Please sign in to comment.