Add Option if visiting a deleted invoice / recurring to return to the listing page and added delete to invoice details page

This commit is contained in:
johnnyq 2025-06-11 15:57:52 -04:00
parent a462ab36f8
commit 18ce12f60d
2 changed files with 22 additions and 1 deletions

View File

@ -26,7 +26,12 @@ if (isset($_GET['invoice_id'])) {
);
if (mysqli_num_rows($sql) == 0) {
echo '<h1 class="text-secondary mt-5" style="text-align: center">Nothing to see here</h1>';
if (isset($_GET['client_id'])) {
$backlink_append = "?client_id=$client_id";
} else {
$backlink_append = '';
}
echo "<h1 class='text-secondary pt-5' style='text-align: center'>There is no Invoice here<br><small><a href='invoices.php$backlink_append'><i class='fas fa-arrow-left mr-2'></i>Back to Invoices</a></small></h1>";
require_once "includes/footer.php";
exit();
@ -280,6 +285,10 @@ if (isset($_GET['invoice_id'])) {
<i class="fa fa-fw fa-times mr-2"></i>Cancel
</a>
<?php } ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item text-danger text-bold confirm-link" href="post.php?delete_invoice=<?php echo $invoice_id; ?>">
<i class="fas fa-fw fa-trash mr-2"></i>Delete
</a>
</div>
</div>

View File

@ -21,6 +21,18 @@ if (isset($_GET['recurring_invoice_id'])) {
WHERE recurring_invoice_id = $recurring_invoice_id LIMIT 1"
);
if (mysqli_num_rows($sql) == 0) {
if (isset($_GET['client_id'])) {
$backlink_append = "?client_id=$client_id";
} else {
$backlink_append = '';
}
echo "<h1 class='text-secondary pt-5' style='text-align: center'>There is no Recurring Invoice here<br><small><a href='recurring_invoices.php$backlink_append'><i class='fas fa-arrow-left mr-2'></i>Back to Recurring Invoices</a></small></h1>";
require_once "includes/footer.php";
exit();
}
$row = mysqli_fetch_array($sql);
$recurring_invoice_prefix = nullable_htmlentities($row['recurring_invoice_prefix']);
$recurring_invoice_number = intval($row['recurring_invoice_number']);