Merge branch 'feature/editable-payment-methods' of https://github.com/ttam/Wallos into ttam-feature/editable-payment-methods
This commit is contained in:
+13
-1
@@ -479,9 +479,21 @@
|
||||
</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">
|
||||
<div class="payments-payment"
|
||||
data-enabled="<?= $payment['enabled']; ?>"
|
||||
data-in-use="<?= $inUse ? 'yes' : 'no' ?>"
|
||||
data-paymentid="<?= $payment['id'] ?>"
|
||||
title="<?= $inUse ? 'Can\'t delete used payment method' : '' ?>"
|
||||
onClick="togglePayment(<?= $payment['id'] ?>)">
|
||||
<img src="images/uploads/icons/<?= $payment['icon'] ?>" alt="Logo" />
|
||||
<span class="payment-name">
|
||||
<?= $payment['name'] ?>
|
||||
|
||||
Reference in New Issue
Block a user