$sb, 'o' => $o))); // ////Paging //if(isset($_GET['p'])){ // $p = intval($_GET['p']); // $record_from = (($p)-1)*$_SESSION['records_per_page']; // $record_to = $_SESSION['records_per_page']; //}else{ // $record_from = 0; // $record_to = $_SESSION['records_per_page']; // $p = 1; //} // //if(isset($_GET['q'])){ // $q = mysqli_real_escape_string($mysqli,$_GET['q']); //}else{ // $q = ""; //} // //if(!empty($_GET['sb'])){ // $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); //}else{ // $sb = "invoice_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 invoices // WHERE client_id = $client_id // AND (invoice_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); // //?>