diff --git a/add_client_modal.php b/add_client_modal.php index 8d519e8f..12e30003 100644 --- a/add_client_modal.php +++ b/add_client_modal.php @@ -32,7 +32,7 @@
- +
@@ -42,7 +42,7 @@
- +
diff --git a/client_tickets.php b/client_tickets.php index 7c32061d..c5ac3209 100644 --- a/client_tickets.php +++ b/client_tickets.php @@ -2,8 +2,8 @@
-
Tickets
- +
Tickets
+
diff --git a/clients.php b/clients.php index 6fd0ee8b..09085cf3 100644 --- a/clients.php +++ b/clients.php @@ -1,24 +1,83 @@ - + $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 = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "client_name"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +?> + +
-
-
Clients
- +
+ +
Clients
+ +
+
+
+ +
+ +
+
+
+
- - +
+ - - + + - + @@ -91,6 +150,9 @@
NameTypeName ">Type Email Phone BalanceActionsAction
+ + +
diff --git a/clients_old.php b/clients_old.php new file mode 100644 index 00000000..cc83acd7 --- /dev/null +++ b/clients_old.php @@ -0,0 +1,100 @@ + + + + + +
+
+
Clients
+ +
+
+
+ + + + + + + + + + + + + 2){ + $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); + } + $client_email = $row['client_email']; + $client_website = $row['client_website']; + $client_net_terms = $row['client_net_terms']; + if($client_net_terms == 0){ + $client_net_terms = $config_default_net_terms; + } + + //Add up all the payments for the invoice and get the total amount paid to the invoice + $sql_invoice_amounts = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE client_id = $client_id AND invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled' "); + $row = mysqli_fetch_array($sql_invoice_amounts); + + $invoice_amounts = $row['invoice_amounts']; + + $sql_amount_paid = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS amount_paid FROM payments, invoices WHERE payments.invoice_id = invoices.invoice_id AND invoices.client_id = $client_id"); + $row = mysqli_fetch_array($sql_amount_paid); + + $amount_paid = $row['amount_paid']; + + $balance = $invoice_amounts - $amount_paid; + //set Text color on balance + if($balance > 0){ + $balance_text_color = "text-danger font-weight-bold"; + }else{ + $balance_text_color = ""; + } + + ?> + + + + + + + + + + + + +
NameTypeEmailPhoneBalanceActions
$ + + +
+
+
+
+ + + +
-
Invoices
- +
Invoices
+
diff --git a/pagination.php b/pagination.php new file mode 100644 index 00000000..a52b4f47 --- /dev/null +++ b/pagination.php @@ -0,0 +1,59 @@ + + +
    + + 100)){ + $pages_split = 100; + } + if(($total_pages <= 10000) AND ($total_pages > 1000)){ + $pages_split = 1000; + } + if($p > 1){ + $prev_class = ""; + }else{ + $prev_class = "disabled"; + } + if($p <> $total_pages) { + $next_class = ""; + }else{ + $next_class = "disabled"; + } + $url_query_strings = http_build_query(array_merge($_GET,array('p' => $i))); + $prev_page = $p - 1; + $next_page = $p + 1; + + if($p > 1){ + echo "
  • Prev
  • "; + } + + while($i < $total_pages){ + $i++; + if(($i == 1) OR (($p <= 3) AND ($i <= 6)) OR (($i > $total_pages - 6) AND ($p > $total_pages - 3 )) OR (is_int($i / $pages_split)) OR (($p > 3) AND ($i >= $p - 2) AND ($i <= $p + 3)) OR ($i == $total_pages)){ + if($p == $i ) { + $page_class = "active"; + }else{ + $page_class = ""; + } + echo "
  • $i
  • "; + } + } + + if($p <> $total_pages){ + echo "
  • Next
  • "; + } + +?> + +
+ +
$record_from to $record_to Records: $total_found_rows
"; + + +?> \ No newline at end of file diff --git a/products.php b/products.php index 1f61df7a..ca3285c5 100644 --- a/products.php +++ b/products.php @@ -5,8 +5,8 @@
-
Products
- +
Products
+
diff --git a/tickets.php b/tickets.php index 85b7c61e..d6855bf3 100644 --- a/tickets.php +++ b/tickets.php @@ -9,8 +9,8 @@
-
Tickets
- +
Tickets
+
diff --git a/vendors.php b/vendors.php index cdf42cd5..13491d5d 100644 --- a/vendors.php +++ b/vendors.php @@ -5,8 +5,8 @@
-
Vendors
- +
Vendors
+