$sb, 'o' => $o))); //Paging if(isset($_GET['p'])){ $p = intval($_GET['p']); $record_from = (($p)-1)*$config_records_per_page; $record_to = $config_records_per_page; }else{ $record_from = 0; $record_to = $config_records_per_page; $p = 1; } //Custom Query Filter if(isset($_GET['q'])){ $q = mysqli_real_escape_string($mysqli,$_GET['q']); }else{ $q = ""; } //Column Filter if(!empty($_GET['sb'])){ $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); }else{ $sb = "client_name"; } //Column Order Filter if(isset($_GET['o'])){ if($_GET['o'] == 'ASC'){ $o = "ASC"; $disp = "DESC"; }else{ $o = "DESC"; $disp = "ASC"; } }else{ $o = "ASC"; $disp = "DESC"; } //Date From and Date To Filter if(!empty($_GET['dtf'])){ $dtf = $_GET['dtf']; $dtt = $_GET['dtt']; }else{ $dtf = "0000-00-00"; $dtt = "9999-00-00"; } //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 clients WHERE (client_name LIKE '%$q%' OR client_type LIKE '%$q%' OR client_email LIKE '%$q%' OR client_contact LIKE '%$q%' OR client_phone LIKE '%$q%' OR client_mobile LIKE '%$q%' OR client_address LIKE '%$q%' OR client_city LIKE '%$q%' OR client_state LIKE '%$q%' OR client_zip LIKE '%$q%') AND DATE(client_created_at) BETWEEN '$dtf' AND '$dtt' AND company_id = $session_company_id ORDER BY $sb $o LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); ?>
| Name "> | Address | Contact | Balance | Action |
|---|---|---|---|---|
|
|
$client_city $client_state $client_zip"; ?> |
|
$ |
|