From 45fba5762b8d0b087b1d9b03cc766cc31c46b76e Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Thu, 6 Feb 2020 20:25:28 -0500 Subject: [PATCH] Added unpaid and paid invoices to guest URL view --- client_payments_by_invoice.php | 140 ++++++++++++++++++++++++++++++ edit_item_modal.php | 14 ++- guest_view_invoice.php | 154 +++++++++++++++++++++++++++++++++ post.php | 30 +++++++ side_nav.php | 2 +- 5 files changed, 331 insertions(+), 9 deletions(-) create mode 100644 client_payments_by_invoice.php diff --git a/client_payments_by_invoice.php b/client_payments_by_invoice.php new file mode 100644 index 00000000..0d136638 --- /dev/null +++ b/client_payments_by_invoice.php @@ -0,0 +1,140 @@ + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*10; + $record_to = 10; +}else{ + $record_from = 0; + $record_to = 10; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = mysqli_real_escape_string($mysqli,$_GET['q']); +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); +}else{ + $sb = "invoice_date"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "DESC"; + $disp = "ASC"; +} + + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices + WHERE client_id = $client_id + AND (invoice_number LIKE '%$q%') + ORDER BY $sb $o LIMIT $record_from, $record_to"); + +$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); +$total_found_rows = $num_rows[0]; +$total_pages = ceil($total_found_rows / 10); + +?> + +
+
+
Payments
+
+
+
+ + +
+ +
+ +
+
+
+
+
+ + "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DateDueInvoiceInvoice Amount
$
Date RecievedPayment MethodPayment ReferencePayment Amount
$
+ + + +
+
+
\ No newline at end of file diff --git a/edit_item_modal.php b/edit_item_modal.php index 2ed65c2d..addb8f08 100644 --- a/edit_item_modal.php +++ b/edit_item_modal.php @@ -8,8 +8,9 @@
- - + + +