From 571223d920ef766b11ac2cd1ae82614e2d2b404b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 18 Jun 2019 18:31:13 -0400 Subject: [PATCH] moved all table listing to server side tables and set the header to dark for better contrast --- accounts.php | 72 +++++++++++++++++++++++++++--- categories.php | 73 +++++++++++++++++++++++++++---- client_assets.php | 87 +++++++++++++++++++++++++++++++----- client_contacts.php | 3 ++ client_domains.php | 78 +++++++++++++++++++++++++++++---- client_files.php | 10 ++--- client_invoices.php | 86 ++++++++++++++++++++++++++++++------ client_locations.php | 79 +++++++++++++++++++++++++++++---- client_logins.php | 81 ++++++++++++++++++++++++++++++---- client_networks.php | 83 ++++++++++++++++++++++++++++++----- client_notes.php | 2 +- client_payments.php | 90 +++++++++++++++++++++++++++++++------- client_quotes.php | 83 ++++++++++++++++++++++++++++++----- client_recurring.php | 87 ++++++++++++++++++++++++++++++------ client_software.php | 80 +++++++++++++++++++++++++++++---- client_tickets.php | 84 ++++++++++++++++++++++++++++++----- client_vendors.php | 80 +++++++++++++++++++++++++++++---- expenses.php | 83 +++++++++++++++++++++++++++++------ payments.php | 82 ++++++++++++++++++++++++++++------ quotes.php | 83 +++++++++++++++++++++++++++++------ recurring.php | 83 +++++++++++++++++++++++++++++------ report_expense_summary.php | 14 +++--- report_income_summary.php | 14 +++--- report_profit_loss.php | 14 +++--- settings-backup.php | 4 +- settings-carddav.php | 4 +- settings-company.php | 4 +- settings-general.php | 4 +- settings-invoice.php | 4 +- settings-mail.php | 4 +- settings-user.php | 10 ++--- transfers.php | 73 ++++++++++++++++++++++++++----- trips.php | 81 +++++++++++++++++++++++++++++----- users.php | 74 +++++++++++++++++++++++++++---- 34 files changed, 1522 insertions(+), 271 deletions(-) diff --git a/accounts.php b/accounts.php index dc2991a1..36f0dac9 100644 --- a/accounts.php +++ b/accounts.php @@ -1,21 +1,76 @@ - + + $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $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 = "account_id"; + } + + 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 accounts + WHERE account_name 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); + +?>
-
+
Accounts
+
+
+ +
+ +
+
+
+
- - +
+ - + - + @@ -60,6 +115,9 @@
NameName BalanceActionsAction
+ + +
diff --git a/categories.php b/categories.php index 1cf1e7d5..23159970 100644 --- a/categories.php +++ b/categories.php @@ -1,22 +1,76 @@ - + + //Rebuild URL + + $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $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 = "category_type"; + } + + 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 categories WHERE category_name LIKE '%$q%' OR category_type 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); + + ?>
-
+
Categories
+
+
+ +
+ +
+
+
+
- - +
+ - - + + - + @@ -53,6 +107,9 @@
NameTypeNameType ColorActionsAction
+ + +
diff --git a/client_assets.php b/client_assets.php index 6275a932..5f9078f5 100644 --- a/client_assets.php +++ b/client_assets.php @@ -1,23 +1,83 @@ - + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "asset_type"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM assets + WHERE client_id = $client_id + AND (asset_name LIKE '%$q%' OR asset_type LIKE '%$q%' OR asset_ip LIKE '%$q%' OR asset_make LIKE '%$q%' OR asset_model LIKE '%$q%' OR asset_serial 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); + +?>
-
+
Assets
- +
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - - - - + + + + + + + @@ -143,6 +203,9 @@
TypeNameIPMakeModelSerialActionsTypeNameIPMakeModelSerialAction
+ + +
diff --git a/client_contacts.php b/client_contacts.php index 3a2efc85..680f5e7b 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -42,6 +42,9 @@ if(isset($_GET['o'])){ $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM contacts WHERE client_id = $client_id AND (contact_name 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); + ?> diff --git a/client_domains.php b/client_domains.php index de178e64..181edb3c 100644 --- a/client_domains.php +++ b/client_domains.php @@ -1,21 +1,80 @@ - + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "domain_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM domains + WHERE client_id = $client_id AND (domain_name 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); + +?>
-
+
Domains
- +
+ + +
+ +
+ +
+
+
+
- - +
+ - + - - + + @@ -64,6 +123,9 @@
DomainDomain Registrar WebHostExpireActionsExpireAction
+ + +
diff --git a/client_files.php b/client_files.php index 187d9b11..67181b01 100644 --- a/client_files.php +++ b/client_files.php @@ -3,7 +3,7 @@
-
+
Uploaded Files
@@ -25,12 +25,12 @@ - diff --git a/client_invoices.php b/client_invoices.php index 7fb45c3e..e82b07f0 100644 --- a/client_invoices.php +++ b/client_invoices.php @@ -1,27 +1,84 @@ - $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "invoice_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} - $sql = mysqli_query($mysqli,"SELECT * FROM invoices, categories WHERE invoices.client_id = $client_id AND invoices.category_id = categories.category_id ORDER BY invoice_number DESC"); +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices, categories + WHERE invoices.client_id = $client_id + AND invoices.category_id = categories.category_id + AND (invoice_number LIKE '%$q%' OR category_name LIKE '%$q%' OR invoice_status 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); ?>
-
+
Invoices
- +
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - - - - + + + + + + + @@ -98,6 +155,9 @@
NumberAmountDateDueCategoryStatusActionsNumberAmountDateDueCategoryStatusAction
+ + +
diff --git a/client_locations.php b/client_locations.php index f5a03e2e..e0b40a9c 100644 --- a/client_locations.php +++ b/client_locations.php @@ -1,21 +1,81 @@ - + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "location_name"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM locations + WHERE client_id = $client_id + AND (location_name LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone 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); + +?>
-
+
Locations
- +
+ + +
+ +
+ +
+
+
+
- +
- - + + - - + + @@ -65,6 +125,9 @@
NameAddressNameAddress PhoneHoursActionsHoursAction
+ + +
diff --git a/client_logins.php b/client_logins.php index 0ef69030..ce25f9b2 100644 --- a/client_logins.php +++ b/client_logins.php @@ -1,19 +1,81 @@ - + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "login_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM logins + WHERE client_id = $client_id + AND (login_description LIKE '%$q%' OR login_username LIKE '%$q%' OR login_password 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); + +?>
-
+
Logins
+
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - + + + + @@ -58,6 +120,9 @@
DescriptionUsernamePasswordActionsDescriptionUsernamePasswordAction
+ + +
diff --git a/client_networks.php b/client_networks.php index 14c0f040..6e9ad3d6 100644 --- a/client_networks.php +++ b/client_networks.php @@ -1,20 +1,81 @@ - + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "network_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM networks + WHERE client_id = $client_id + AND (network_name LIKE '%$q%' OR network LIKE '%$q%' OR network_gateway LIKE '%$q%' OR network_dhcp_range 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); + +?>
-
+
Networks
+
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - - + + + + + @@ -26,7 +87,6 @@ $network = $row['network']; $network_gateway = $row['network_gateway']; $network_dhcp_range = $row['network_dhcp_range']; - $network_dhcp_range = $row['network_dhcp_range']; $location_id = $row['location_id']; ?> @@ -57,6 +117,9 @@
NameNetworkGatewayDHCP RangeActionsNameNetworkGatewayDHCP RangeAction
+ + +
diff --git a/client_notes.php b/client_notes.php index c9b79834..7aa5650c 100644 --- a/client_notes.php +++ b/client_notes.php @@ -1,7 +1,7 @@
-
+
Notes
diff --git a/client_payments.php b/client_payments.php index ed5556f4..b2f2b8b5 100644 --- a/client_payments.php +++ b/client_payments.php @@ -1,26 +1,83 @@ - $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "payment_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + + +$sql = mysqli_query($mysqli,"SELECT * FROM payments, invoices, accounts + WHERE invoices.client_id = $client_id + AND payments.invoice_id = invoices.invoice_id + AND payments.account_id = accounts.account_id + AND (invoice_number LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method 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
- +
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - - + + + + + @@ -53,6 +110,9 @@
DateInvoiceAmountAccountMethodDateInvoiceAmountAccountMethod
+ + +
\ No newline at end of file diff --git a/client_quotes.php b/client_quotes.php index 0121b838..e4eeda30 100644 --- a/client_quotes.php +++ b/client_quotes.php @@ -1,25 +1,83 @@ - $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "quote_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} - $sql = mysqli_query($mysqli,"SELECT * FROM quotes, categories WHERE client_id = $client_id AND categories.category_id = quotes.category_id ORDER BY quote_number DESC"); +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM quotes, categories + WHERE client_id = $client_id + AND categories.category_id = quotes.category_id + AND (quote_id LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status 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); ?>
-
+
Quotes
+
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - - - + + + + + + @@ -89,6 +147,9 @@
NumberAmountDateCategoryStatusActionsNumberAmountDateCategoryStatusAction
+ + +
diff --git a/client_recurring.php b/client_recurring.php index 72d18e39..b8ca3a0e 100644 --- a/client_recurring.php +++ b/client_recurring.php @@ -1,27 +1,83 @@ - $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "recurring_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} - $sql = mysqli_query($mysqli,"SELECT * FROM recurring, categories - WHERE recurring.client_id = $client_id - AND recurring.category_id = categories.category_id - ORDER BY recurring.recurring_id DESC"); +$sql = mysqli_query($mysqli,"SELECT * FROM recurring, categories + WHERE recurring.client_id = $client_id + AND recurring.category_id = categories.category_id + AND (recurring_frequency LIKE '%$q%' OR category_name 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); + ?>
-
+
Recurring Invoices
- +
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - - + + + + + + @@ -84,6 +140,9 @@
FrequencyLast SentNext DateStatusActionsFrequencyLast SentNext DateCategoryStatusAction
+ + +
diff --git a/client_software.php b/client_software.php index 0c7cc57f..97d7556a 100644 --- a/client_software.php +++ b/client_software.php @@ -1,20 +1,81 @@ - + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "software_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM software + WHERE client_id = $client_id + AND (software_name LIKE '%$q%' OR software_type LIKE '%$q%' OR software_license 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); + +?>
-
+
Software
+
+ + +
+ +
+ +
+
+
+
- - +
+ - - - + + + - + @@ -86,6 +147,9 @@
SoftwareTypeLicenseSoftwareTypeLicense ActionsAction
+ + +
diff --git a/client_tickets.php b/client_tickets.php index c5ac3209..e2a107ed 100644 --- a/client_tickets.php +++ b/client_tickets.php @@ -1,20 +1,81 @@ - + -
+//Rebuild URL + +$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "ticket_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM tickets + WHERE client_id = $client_id + AND (ticket_id LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_status 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); + +?> + +
+
Tickets
+
+ + +
+ +
+ +
+
+
+
- - +
+ - - - - - + + + + + @@ -78,6 +139,9 @@
NumberSubjectDate OpenedStatusActionsNumberSubjectDate OpenedStatusAction
+ + +
diff --git a/client_vendors.php b/client_vendors.php index c4868714..fd6c5b8c 100644 --- a/client_vendors.php +++ b/client_vendors.php @@ -1,20 +1,81 @@ - + $sb, 'o' => $o))); + +if(isset($_GET['p'])){ + $p = intval($_GET['p']); + $record_from = (($p)-1)*6; + $record_to = 6; +}else{ + $record_from = 0; + $record_to = 6; + $p = 1; +} + +if(isset($_GET['q'])){ + $q = $_GET['q']; +}else{ + $q = ""; +} + +if(!empty($_GET['sb'])){ + $sb = $_GET['sb']; +}else{ + $sb = "vendor_id"; +} + +if(isset($_GET['o'])){ + if($_GET['o'] == 'ASC'){ + $o = "ASC"; + $disp = "DESC"; + }else{ + $o = "DESC"; + $disp = "ASC"; + } +}else{ + $o = "ASC"; + $disp = "DESC"; +} + +$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM vendors + WHERE client_id = $client_id + AND (vendor_name LIKE '%$q%' OR vendor_description LIKE '%$q%' OR vendor_account_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); + +?>
-
+
Vendors
+
+ + +
+ +
+ +
+
+
+
- - +
+ - - - + + + - + @@ -112,6 +173,9 @@
VendorDescriptionAccount NumberVendorDescriptionAccount Number ActionsAction
+ + +
diff --git a/expenses.php b/expenses.php index 938cf3a0..9aaac121 100644 --- a/expenses.php +++ b/expenses.php @@ -1,30 +1,82 @@ - + $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 = "expense_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 expenses, categories, vendors, accounts WHERE expenses.category_id = categories.category_id AND expenses.vendor_id = vendors.vendor_id AND expenses.account_id = accounts.account_id - ORDER BY expenses.expense_date DESC"); + AND (vendor_name LIKE '%$q%' OR category_name LIKE '%$q%' OR account_name 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); + ?>
-
+
Expenses
+
+
+ +
+ +
+
+
+
- - +
+ - - - - - - + + + + + + @@ -95,6 +147,9 @@
DateAmountVendorCategoryAccountActionsDateAmountVendorCategoryAccountAction
+ + +
diff --git a/payments.php b/payments.php index fae1f91c..ce7a7823 100644 --- a/payments.php +++ b/payments.php @@ -1,30 +1,81 @@ - + $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 = "payment_id"; + } + + 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 payments, invoices, clients, accounts WHERE invoices.client_id = clients.client_id AND payments.invoice_id = invoices.invoice_id AND payments.account_id = accounts.account_id - ORDER BY payments.payment_id DESC"); + AND (invoice_number LIKE '%$q%' OR client_name LIKE '%$q%' OR account_name LIKE '%$q%' OR payment_method 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
+
+
+ +
+ +
+
+
+
- - +
+ - - - - - - + + + + + + @@ -61,6 +112,9 @@
DateInvoiceClientAmountAccountMethodDateInvoiceClientAmountAccountMethod
+ + +
diff --git a/quotes.php b/quotes.php index c3b38c44..8a55deda 100644 --- a/quotes.php +++ b/quotes.php @@ -1,30 +1,82 @@ - + $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 = "quote_number"; + } + + 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 * FROM quotes, clients, categories + $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM quotes, clients, categories WHERE quotes.client_id = clients.client_id AND quotes.category_id = categories.category_id - ORDER BY quotes.quote_number DESC"); + AND (quote_number LIKE '%$q%' OR client_name 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); + ?>
-
+
Quotes
+
+
+ +
+ +
+
+
+
- - +
+ - - - - - - - + + + + + + + @@ -101,6 +153,9 @@
NumberClientAmountDateCategoryStatusActionsNumberClientAmountDateCategoryStatusAction
+ + +
diff --git a/recurring.php b/recurring.php index d213488a..45cc8dd3 100644 --- a/recurring.php +++ b/recurring.php @@ -1,30 +1,82 @@ - + $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 = "recurring_id"; + } + + 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 * FROM recurring, clients, categories + $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM recurring, clients, categories WHERE recurring.client_id = clients.client_id AND recurring.category_id = categories.category_id - ORDER BY recurring.recurring_id DESC"); + AND (recurring_frequency LIKE '%$q%' OR client_name LIKE '%$q%' OR category_name 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); + ?>
-
+
Recurring Invoices
+
+
+ +
+ +
+
+
+
- - +
+ - - - - - - - + + + + + + + @@ -89,6 +141,9 @@
FrequencyClientLast SentNext DateCategoryStatusActionsFrequencyClientLast SentNext DateCategoryStatusAction
+ + +
diff --git a/report_expense_summary.php b/report_expense_summary.php index 64352f99..31d9d338 100644 --- a/report_expense_summary.php +++ b/report_expense_summary.php @@ -13,12 +13,14 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_ ?> -
-
+
+
Expense Summary
-
-
-
-
- + diff --git a/report_income_summary.php b/report_income_summary.php index 9e336408..25b3b888 100644 --- a/report_income_summary.php +++ b/report_income_summary.php @@ -13,12 +13,14 @@ $sql_categories = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_ ?> -
-
+
+
Income Summary
-
- -
-
Category January
- + diff --git a/report_profit_loss.php b/report_profit_loss.php index 41cfcc0a..b88bab7c 100644 --- a/report_profit_loss.php +++ b/report_profit_loss.php @@ -18,12 +18,14 @@ $sql_categories_expense = mysqli_query($mysqli,"SELECT * FROM categories WHERE c ?> -
-
+
+
Profit & Loss
-
- -
-
Category January
- + diff --git a/settings-backup.php b/settings-backup.php index a61757ec..942fe98c 100644 --- a/settings-backup.php +++ b/settings-backup.php @@ -4,8 +4,8 @@ -
-
+
+
Backup
diff --git a/settings-carddav.php b/settings-carddav.php index 7ecf6c3a..4788c1e0 100644 --- a/settings-carddav.php +++ b/settings-carddav.php @@ -2,8 +2,8 @@ -
-
+
+
CardDAV Settings
diff --git a/settings-company.php b/settings-company.php index f7a85867..1983e281 100644 --- a/settings-company.php +++ b/settings-company.php @@ -2,8 +2,8 @@ -
-
+
+
Company Settings
diff --git a/settings-general.php b/settings-general.php index 912f0392..08bf5e10 100644 --- a/settings-general.php +++ b/settings-general.php @@ -2,8 +2,8 @@ -
-
+
+
General Settings
diff --git a/settings-invoice.php b/settings-invoice.php index 70674dca..d3080c2d 100644 --- a/settings-invoice.php +++ b/settings-invoice.php @@ -2,8 +2,8 @@ -
-
+
+
Invoice Settings
diff --git a/settings-mail.php b/settings-mail.php index 5bd15c3b..3ceebea3 100644 --- a/settings-mail.php +++ b/settings-mail.php @@ -2,8 +2,8 @@ -
-
+
+
Mail Settings
diff --git a/settings-user.php b/settings-user.php index 2f0e278f..0dd5246a 100644 --- a/settings-user.php +++ b/settings-user.php @@ -1,11 +1,7 @@ - - - -?> - -
-
+
+
Two Factor Authentication
diff --git a/transfers.php b/transfers.php index 993524c5..fe6aa960 100644 --- a/transfers.php +++ b/transfers.php @@ -1,27 +1,77 @@ - + $sb, 'o' => $o))); -$sql = mysqli_query($mysqli,"SELECT * FROM transfers ORDER BY transfer_date DESC"); + 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 = "transfer_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 transfers 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); ?> -
-
+
Transfers
+
+
+ +
+ +
+
+ +
-
Jan-Mar
- +
+ - + - - + + @@ -72,6 +122,9 @@ $sql = mysqli_query($mysqli,"SELECT * FROM transfers ORDER BY transfer_date DESC
DateDate From Account To AccountAmountActionsAmountAction
+ + +
diff --git a/trips.php b/trips.php index c8e36202..adf93ece 100644 --- a/trips.php +++ b/trips.php @@ -1,23 +1,79 @@ - + + //Rebuild URL + + $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $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 = "trip_id"; + } + + 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 trips + WHERE trip_purpose LIKE '%$q%' OR trip_starting_location LIKE '%$q%' OR trip_destination 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); + +?>
-
+
Trips
+
+
+ +
+ +
+
+
+
- - +
+ - - - - - - + + + + + + @@ -73,6 +129,9 @@
DatePurposeFromToMilesActionsDatePurposeFromToMilesAction
+ + +
diff --git a/users.php b/users.php index 905b8d51..923e93d1 100644 --- a/users.php +++ b/users.php @@ -1,23 +1,78 @@ - + + //Rebuild URL + + $url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $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 = "user_id"; + } + + 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 users + WHERE name LIKE '%$q%' OR email 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); + +?>
-
+
Users
+
+
+ +
+ +
+
+
- - +
+ - - + + - + @@ -72,6 +127,9 @@
NameEmailNameEmail Type StatusActionsAction
+ + +