Skip to content

Commit

Permalink
Moved Create and Disable Auto Pay from Hamburger menu to a button by …
Browse files Browse the repository at this point in the history
…Email Notify, also Tidied up the Header in add payment
  • Loading branch information
johnnyq committed Dec 22, 2024
1 parent 74770a9 commit a2f0f39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
28 changes: 12 additions & 16 deletions recurring_invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,6 @@
}
$recurring_payment_id = intval($row['recurring_payment_id']);
$recurring_payment_recurring_invoice_id = intval($row['recurring_payment_recurring_invoice_id']);
if ($recurring_payment_recurring_invoice_id) {
$auto_pay_display = "
<a class='dropdown-item' href='post.php?delete_recurring_payment=$recurring_payment_id'>
<i class='fas fa-fw fa-times-circle text-secondary mr-2'></i>Remove AutoPay
</a>
";
} else {
$auto_pay_display = "
<a class='dropdown-item' href='#' data-toggle='modal' data-target='#addRecurringPaymentModal$recurring_id'>
<i class='fas fa-fw fa-recycle text-secondary mr-2'></i>Create AutoPay
</a>
";
require "recurring_payment_add_modal.php";
}

$sql = mysqli_query($mysqli, "SELECT * FROM companies WHERE company_id = 1");
$row = mysqli_fetch_array($sql);
Expand Down Expand Up @@ -138,6 +124,18 @@
<a href="post.php?recurring_invoice_email_notify=1&recurring_id=<?php echo $recurring_id; ?>" class="btn btn-outline-danger"><i class="fas fa-fw fa-bell-slash mr-2"></i>Email Notify</a>
<?php } ?>
<?php } ?>

<?php if ($recurring_payment_recurring_invoice_id) { ?>
<a class="btn btn-outline-secondary" href="post.php?delete_recurring_payment=<?php echo $recurring_payment_id; ?>">
<i class="fas fa-fw fa-times-circle mr-2"></i>Disable AutoPay
</a>
<?php } else { ?>
<a class="btn btn-secondary" href='#' data-toggle="modal" data-target="#addRecurringPaymentModal<?php echo $recurring_id; ?>">
<i class="fas fa-fw fa-redo-alt mr-2"></i>Create AutoPay
</a>
<?php require_once "recurring_payment_add_modal.php"; ?>

<?php } ?>
</div>

<div class="col-4">
Expand All @@ -146,8 +144,6 @@
<i class="fas fa-ellipsis-v"></i>
</button>
<div class="dropdown-menu">
<?php echo $auto_pay_display; ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editRecurringModal<?php echo $recurring_id; ?>">
<i class="fa fa-fw fa-edit text-secondary mr-2"></i>Edit
</a>
Expand Down
2 changes: 1 addition & 1 deletion recurring_payment_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-credit-card mr-2"></i><?php echo "$recurring_prefix$recurring_number"; ?>: Create Recurring Payment</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-redo-alt mr-2"></i>Creating Recurring Payment: <strong><?php echo "$recurring_prefix$recurring_number"; ?></strong></h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
Expand Down

0 comments on commit a2f0f39

Please sign in to comment.