diff --git a/accounts.php b/accounts.php index 4ad2995a..bbc8b942 100644 --- a/accounts.php +++ b/accounts.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/alerts_archived.php b/alerts_archived.php index d3519787..cc3f5515 100644 --- a/alerts_archived.php +++ b/alerts_archived.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/assets.php b/assets.php index a4f7b727..46944194 100644 --- a/assets.php +++ b/assets.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/categories.php b/categories.php index f0a45bba..6bd05333 100644 --- a/categories.php +++ b/categories.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_assets.php b/client_assets.php index f12c7dd4..26cff128 100644 --- a/client_assets.php +++ b/client_assets.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_certificates.php b/client_certificates.php index 166d8341..e4bb20c3 100644 --- a/client_certificates.php +++ b/client_certificates.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_contacts.php b/client_contacts.php index 64cf9ef3..e17f5a08 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_documents.php b/client_documents.php index f779f18c..bc2cd88b 100644 --- a/client_documents.php +++ b/client_documents.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_domains.php b/client_domains.php index 04335e2a..797a8a6d 100644 --- a/client_domains.php +++ b/client_domains.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_invoices.php b/client_invoices.php index 27d03899..a562c11e 100644 --- a/client_invoices.php +++ b/client_invoices.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_locations.php b/client_locations.php index d51c40d0..5fd82c8d 100644 --- a/client_locations.php +++ b/client_locations.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_logins.php b/client_logins.php index 7115dd20..421fb3d6 100644 --- a/client_logins.php +++ b/client_logins.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_networks.php b/client_networks.php index c56e3af8..a3eb9185 100644 --- a/client_networks.php +++ b/client_networks.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_payments.php b/client_payments.php index 83893681..ada705b9 100644 --- a/client_payments.php +++ b/client_payments.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_quotes.php b/client_quotes.php index ec8285cb..cced16f6 100644 --- a/client_quotes.php +++ b/client_quotes.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_recurring.php b/client_recurring.php index aaceb729..07d644c9 100644 --- a/client_recurring.php +++ b/client_recurring.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_software.php b/client_software.php index 0673c4f9..cfa61512 100644 --- a/client_software.php +++ b/client_software.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_tickets.php b/client_tickets.php index aaf2359a..bc98b57d 100644 --- a/client_tickets.php +++ b/client_tickets.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_trips.php b/client_trips.php index f13b46fd..905b7690 100644 --- a/client_trips.php +++ b/client_trips.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/client_vendors.php b/client_vendors.php index 555bba5b..29730b90 100644 --- a/client_vendors.php +++ b/client_vendors.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/clients.php b/clients.php index b8237305..7d8e88ff 100644 --- a/clients.php +++ b/clients.php @@ -10,11 +10,11 @@ if($session_permission_level == 2){ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/companies.php b/companies.php index 1755c1c3..bc52d959 100644 --- a/companies.php +++ b/companies.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/db.sql b/db.sql index 8f2faf67..77c11ce9 100644 --- a/db.sql +++ b/db.sql @@ -729,7 +729,6 @@ CREATE TABLE `settings` ( `config_default_expense_payment_method` varchar(200) DEFAULT NULL, `config_default_calendar` int(11) DEFAULT NULL, `config_default_net_terms` int(11) DEFAULT NULL, - `config_records_per_page` int(10) NOT NULL, `config_invoice_prefix` varchar(200) DEFAULT NULL, `config_invoice_next_number` int(11) DEFAULT NULL, `config_invoice_footer` text DEFAULT NULL, @@ -970,4 +969,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-02-08 20:00:18 +-- Dump completed on 2021-02-10 13:39:33 diff --git a/expenses.php b/expenses.php index ae9abbd1..bbe59557 100644 --- a/expenses.php +++ b/expenses.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/get_settings.php b/get_settings.php index 833d1c99..c9d4f818 100644 --- a/get_settings.php +++ b/get_settings.php @@ -26,7 +26,6 @@ $config_default_payment_method = $row['config_default_payment_method']; $config_default_expense_payment_method = $row['config_default_expense_payment_method']; $config_default_calendar = $row['config_default_calendar']; $config_default_net_terms = $row['config_default_net_terms']; -$config_records_per_page = $row['config_records_per_page']; //Invoice/Quote $config_invoice_prefix = $row['config_invoice_prefix']; diff --git a/header.php b/header.php index 2c7a623a..0638bc4e 100644 --- a/header.php +++ b/header.php @@ -76,4 +76,9 @@ scratch. This page gets rid of all links and provides the needed markup only. } + //Set Records Per Page + if(empty($_SESSION['records_per_page'])){ + $_SESSION['records_per_page'] = 10; + } + ?> \ No newline at end of file diff --git a/invoices.php b/invoices.php index 08d709c7..5cf6fa61 100644 --- a/invoices.php +++ b/invoices.php @@ -54,11 +54,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/logs.php b/logs.php index c0bea253..e5261689 100644 --- a/logs.php +++ b/logs.php @@ -3,11 +3,11 @@ //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); - $record_from = (($p)-1)*$config_records_per_page; - $record_to = $config_records_per_page; + $record_from = (($p)-1)*$_SESSION['records_per_page']; + $record_to = $_SESSION['records_per_page']; }else{ $record_from = 0; - $record_to = $config_records_per_page; + $record_to = $_SESSION['records_per_page']; $p = 1; } diff --git a/pagination.php b/pagination.php index 3e4001f7..736f5e51 100644 --- a/pagination.php +++ b/pagination.php @@ -1,7 +1,7 @@ 10) { $i=0; @@ -14,12 +14,12 @@ if ($total_found_rows > 10) {