diff --git a/check_login.php b/check_login.php index d5a4fbda..d949a222 100644 --- a/check_login.php +++ b/check_login.php @@ -4,7 +4,9 @@ header("Location: setup.php"); } - session_start(); + if(!isset($_SESSION)){ + session_start(); + } if(!$_SESSION['logged']){ header("Location: logout.php"); diff --git a/client_contacts.php b/client_contacts.php index 01193809..373d60e9 100644 --- a/client_contacts.php +++ b/client_contacts.php @@ -1,9 +1,5 @@ $sb, 'o' => $o))); - //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); @@ -40,12 +36,12 @@ if(isset($_GET['o'])){ $disp = "DESC"; } +//Rebuild URL +$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $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); - ?> @@ -74,6 +70,7 @@ $total_pages = ceil($total_found_rows / 10);