diff --git a/accounts.php b/accounts.php index a201a792..511f8693 100644 --- a/accounts.php +++ b/accounts.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/categories.php b/categories.php index a76f5827..43868943 100644 --- a/categories.php +++ b/categories.php @@ -13,7 +13,7 @@ if (isset($_GET['category'])) { } //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_assets.php b/client_assets.php index 9c3917ce..dcdec50c 100644 --- a/client_assets.php +++ b/client_assets.php @@ -52,7 +52,8 @@ if (isset($_GET['type']) && ($_GET['type']) == 'workstation') { } //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +//Rebuild URL +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_certificates.php b/client_certificates.php index c6302611..d22ee6ba 100644 --- a/client_certificates.php +++ b/client_certificates.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM certificates WHERE certificate_client_id = $client_id AND (certificate_name LIKE '%$q%' OR certificate_domain LIKE '%$q%' OR certificate_issued_by LIKE '%$q%') diff --git a/client_contacts.php b/client_contacts.php index d3ee3b41..14d04332 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM contacts LEFT JOIN locations ON location_id = contact_location_id diff --git a/client_document_templates.php b/client_document_templates.php index 07b7af95..21437938 100644 --- a/client_document_templates.php +++ b/client_document_templates.php @@ -14,7 +14,7 @@ if (!empty($q)) { } //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_documents.php b/client_documents.php index 04f20684..1b752a66 100644 --- a/client_documents.php +++ b/client_documents.php @@ -21,7 +21,7 @@ if (!empty($q)) { } //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); // Folder ID $get_folder_id = 0; diff --git a/client_domains.php b/client_domains.php index f112c449..588a83c8 100644 --- a/client_domains.php +++ b/client_domains.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS * FROM domains LEFT JOIN vendors ON domain_registrar = vendor_id WHERE domain_client_id = $client_id AND (domain_name LIKE '%$q%' OR vendor_name LIKE '%$q%') diff --git a/client_invoices.php b/client_invoices.php index 4b2efcfb..d95f86e4 100644 --- a/client_invoices.php +++ b/client_invoices.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_locations.php b/client_locations.php index 47cabb9c..d6336966 100644 --- a/client_locations.php +++ b/client_locations.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_logins.php b/client_logins.php index d6999c11..b17a38d7 100644 --- a/client_logins.php +++ b/client_logins.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_logs.php b/client_logs.php index f6c6fb8c..47a8597e 100644 --- a/client_logs.php +++ b/client_logs.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_payments.php b/client_payments.php index b4241623..9012f253 100644 --- a/client_payments.php +++ b/client_payments.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_quotes.php b/client_quotes.php index 7d1fd722..15f97d22 100644 --- a/client_quotes.php +++ b/client_quotes.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_recurring_invoices.php b/client_recurring_invoices.php index 344d4212..38b0d445 100644 --- a/client_recurring_invoices.php +++ b/client_recurring_invoices.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_scheduled_tickets.php b/client_scheduled_tickets.php index c02b9553..bace654c 100644 --- a/client_scheduled_tickets.php +++ b/client_scheduled_tickets.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); // SQL $sql = mysqli_query( diff --git a/client_services.php b/client_services.php index 6faf3685..a104b24b 100644 --- a/client_services.php +++ b/client_services.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); // Overview SQL query $sql = mysqli_query( diff --git a/client_shared_items.php b/client_shared_items.php index 8c91678c..e02f16a5 100644 --- a/client_shared_items.php +++ b/client_shared_items.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_software.php b/client_software.php index 6cd3b2b5..13adf303 100644 --- a/client_software.php +++ b/client_software.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_tickets.php b/client_tickets.php index 5f0bed51..16dc1a6a 100644 --- a/client_tickets.php +++ b/client_tickets.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_trips.php b/client_trips.php index 7390c7bf..8a0d3000 100644 --- a/client_trips.php +++ b/client_trips.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/client_vendors.php b/client_vendors.php index 405eb713..bef9a64d 100644 --- a/client_vendors.php +++ b/client_vendors.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_client.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/clients.php b/clients.php index 73ea1efe..9a47be76 100644 --- a/clients.php +++ b/clients.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/expenses.php b/expenses.php index f5445d67..19e18888 100644 --- a/expenses.php +++ b/expenses.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/invoices.php b/invoices.php index a33fbd28..af4eb1bc 100644 --- a/invoices.php +++ b/invoices.php @@ -69,7 +69,7 @@ if (isset($_GET['status']) && ($_GET['status']) == 'Draft') { } //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/logs.php b/logs.php index 46c52c2f..cbdda141 100644 --- a/logs.php +++ b/logs.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all_settings.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/notifications_dismissed.php b/notifications_dismissed.php index c385cecf..5cedc798 100644 --- a/notifications_dismissed.php +++ b/notifications_dismissed.php @@ -8,7 +8,7 @@ require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/pagination.php b/pagination.php index b27d29b2..ce6fc8e6 100644 --- a/pagination.php +++ b/pagination.php @@ -58,12 +58,16 @@ if ($total_found_rows > 10) { } else { $next_class = "disabled"; } - $url_query_strings = http_build_query(array_merge($_GET, array('page' => $i))); + $get_copy = $_GET; // create a copy of the $_GET array + //unset($get_copy['page']); + // Unset Array Var to prevent Duplicate Get VARs + unset($get_copy['page']); + $url_query_strings_page = http_build_query($get_copy); $prev_page = $page - 1; $next_page = $page + 1; if ($page > 1) { - echo "
  • Prev
  • "; + echo "
  • Prev
  • "; } while ($i < $total_pages) { @@ -74,12 +78,12 @@ if ($total_found_rows > 10) { } else { $page_class = ""; } - echo "
  • $i
  • "; + echo "
  • $i
  • "; } } if ($page <> $total_pages) { - echo "
  • Next
  • "; + echo "
  • Next
  • "; } ?> diff --git a/pagination_head.php b/pagination_head.php index 717d4a8b..1a3c7ce8 100644 --- a/pagination_head.php +++ b/pagination_head.php @@ -7,6 +7,12 @@ * Should not be accessed directly, but called from other pages */ +// Unset Array Var to prevent Duplicate Get VARs +$get_copy = $_GET; // create a copy of the $_GET array +//unset($get_copy['page']); +unset($get_copy['sort']); +unset($get_copy['order']); + // Paging if (isset($_GET['page'])) { $page = intval($_GET['page']); diff --git a/payments.php b/payments.php index 36233c9b..52a90227 100644 --- a/payments.php +++ b/payments.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/quotes.php b/quotes.php index 249f2592..57caac02 100644 --- a/quotes.php +++ b/quotes.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/recurring_invoices.php b/recurring_invoices.php index 5cde8d64..be46d6b3 100644 --- a/recurring_invoices.php +++ b/recurring_invoices.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/revenues.php b/revenues.php index 0210925f..fa75ff77 100644 --- a/revenues.php +++ b/revenues.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/scheduled_tickets.php b/scheduled_tickets.php index ab6ccd91..0a0c141b 100644 --- a/scheduled_tickets.php +++ b/scheduled_tickets.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); // SQL $sql = mysqli_query( diff --git a/settings_api.php b/settings_api.php index 6193f736..f12c30bc 100644 --- a/settings_api.php +++ b/settings_api.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_settings.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/settings_custom_fields.php b/settings_custom_fields.php index f3a6d8f4..c82900b9 100644 --- a/settings_custom_fields.php +++ b/settings_custom_fields.php @@ -13,7 +13,7 @@ if (isset($_GET['table'])) { } //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/settings_mail_queue.php b/settings_mail_queue.php index 6aecb657..c9dc9a47 100644 --- a/settings_mail_queue.php +++ b/settings_mail_queue.php @@ -13,7 +13,7 @@ $purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'htt $purifier = new HTMLPurifier($purifier_config); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/settings_software_templates.php b/settings_software_templates.php index 1e7626f4..dc4a5e96 100644 --- a/settings_software_templates.php +++ b/settings_software_templates.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_settings.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/settings_tags.php b/settings_tags.php index 3933a232..a0ca3d51 100644 --- a/settings_tags.php +++ b/settings_tags.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_settings.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/settings_taxes.php b/settings_taxes.php index a17c0d8a..a29305b1 100644 --- a/settings_taxes.php +++ b/settings_taxes.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_settings.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/settings_vendor_templates.php b/settings_vendor_templates.php index 9094b4fb..1389ddbe 100644 --- a/settings_vendor_templates.php +++ b/settings_vendor_templates.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_settings.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/transfers.php b/transfers.php index dfed0c5a..aca98dab 100644 --- a/transfers.php +++ b/transfers.php @@ -6,7 +6,7 @@ $order = "DESC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/trips.php b/trips.php index 97f1068d..68247f4e 100644 --- a/trips.php +++ b/trips.php @@ -7,7 +7,7 @@ $order = "DESC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/users.php b/users.php index 6b8f0ba4..48759b7a 100644 --- a/users.php +++ b/users.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all_settings.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli, diff --git a/vendors.php b/vendors.php index f876d697..37ad6f46 100644 --- a/vendors.php +++ b/vendors.php @@ -7,7 +7,7 @@ $order = "ASC"; require_once("inc_all.php"); //Rebuild URL -$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order))); +$url_query_strings_sort = http_build_query($get_copy); $sql = mysqli_query( $mysqli,