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); + +?> + +
| Date | +Due | +Invoice | +Invoice Amount | +
|---|---|---|---|
| + | + | + | $ | +
| Date Recieved | +Payment Method | +Payment Reference | +Payment Amount | +
| + | + | + | $ | +